Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

random forrest plotting feature importance function

def plot_feature_importances(model):
    n_features = data_train.shape[1]
    plt.figure(figsize=(20,20))
    plt.barh(range(n_features), model.feature_importances_, align='center') 
    plt.yticks(np.arange(n_features), data_train.columns.values) 
    plt.xlabel('Feature importance')
    plt.ylabel('Feature')
 
Comment

PREVIOUS NEXT
Code Example
Python :: flask return html 
Python :: create pdf from images python 
Python :: how to replace a row value in pyspark dataframe 
Python :: how to fix geometry of a window in tkinter 
Python :: email authentication python 
Python :: how to print alternate numbers in python 
Python :: pygame draw rect syntax 
Python :: convert number to time python 
Python :: python reduce function to sum array 
Python :: django get user model funciton 
Python :: pyqt5 change table widget column width 
Python :: md5 hash python 
Python :: except index out of range python 
Python :: How can one find the three largest values of an input array efficiently, namely without having to sort the input array? 
Python :: how to check if two columns match in pandas 
Python :: python loop certain number of times 
Python :: how to change the title of a tkinter widnow 
Python :: with python how to check alomost similar words 
Python :: string to hex python 
Python :: python: check type and ifno of a data frame 
Python :: lda scikit learn 
Python :: python datetime into 12-hour format 
Python :: python live radio 
Python :: godot string format 
Python :: django wait for database 
Python :: how to iterate pandas dataframe 
Python :: pandas replace na with 0 
Python :: how to create data dictionary in python using keys and values 
Python :: pandas display only certain columns 
Python :: tensorflow keras save model 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =