text_plain_output_1.png
from sklearn.ensemble import ExtraTreesClassifier

import numpy as np

import pandas as pd

import seaborn as sns

df = pd.read_csv('../input/HR_comma_sep.csv')

df.isnull().any()

df = df.rename(columns={'sales': 'job'})

X = np.array(df.drop('left', 1))
y = np.array(df['left'])
model = ExtraTreesClassifier()
model.fit(X, y)
feature_list = list(df.drop('left', 1).columns)
feature_importance_dict = dict(zip(feature_list, model.feature_importances_))
print(sorted(feature_importance_dict.items(), key=lambda x: x[1], reverse=True))