Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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())
Comment

how to improve accuracy of random forest classifier

def display(results):
    print(f'Best parameters are: {results.best_params_}')
    print("
")
    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}')
Comment

how to improve accuracy of random forest classifier

display(cv)
Comment

PREVIOUS NEXT
Code Example
Python :: numpy reshape (n ) to (n 1) 
Python :: plt dashed line 
Python :: join tuple to string python 
Python :: function to remove punctuation in python 
Python :: python sys 
Python :: python check None 
Python :: python check if key exist in json 
Python :: Matplotlib add text to axes 
Python :: Adding new column to existing DataFrame in Pandas using concat method 
Python :: numpy get index of list of values 
Python :: find & replace in csv file 
Python :: create requirements file and load it in new envirnment. 
Python :: structure ternaire python 
Python :: convert python project to exe 
Python :: print format round python 
Python :: decision tree classifier python code for visualization 
Python :: stop flask server 
Python :: string equals python 
Python :: array creation in numpy 
Python :: django changing boolean field from view 
Python :: print each element of list in new line python 
Python :: sum of product 1 codechef solution 
Python :: pandas bins dummy 
Python :: python outlook 
Python :: create new dataframe from existing data frame python 
Python :: how to convert string to float in python 
Python :: Python Create a nonlocal variable 
Python :: append list python 
Python :: can a function output be save as a variable python 
Python :: groupby fillna 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =