Horje
how to improve accuracy of random forest classifier Code Example
how to improve accuracy of random forest classifier
from sklearn.model_selection import GridSearchCV
cv = GridSearchCV(rfc,parameters,cv=5)
cv.fit(train_features,train_label.values.ravel())
how to improve accuracy of random forest classifier
display(cv)
how to improve accuracy of random forest classifier
def display(results):
    print(f'Best parameters are: {results.best_params_}')
    print("\n")
    mean_score = results.cv_results_['mean_test_score']
    std_score = results.cv_results_['std_test_score']
    params = results.cv_results_['params']
    for mean,std,params in zip(mean_score,std_score,params):
        print(f'{round(mean,3)} + or -{round(std,3)} for the {params}')




Python

Related
python input list of ints Code Example python input list of ints Code Example
open file python Code Example open file python Code Example
sequence with numbers in python Code Example sequence with numbers in python Code Example
get index of item in list Code Example get index of item in list Code Example
round to nearest multiple of 5 python Code Example round to nearest multiple of 5 python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9