Ejemplo 1: soluciones del conjunto de datos de diabetes de la India pima
coeff = list(diabetesCheck.coef_[0])labels = list(trainData.columns)features = pd.DataFrame()features['Features'] = labelsfeatures['importance'] = coefffeatures.sort_values(by=['importance'], ascending=True, inplace=True)features['positive'] = features['importance'] > 0features.set_index('Features', inplace=True)features.importance.plot(kind='barh', figsize=(11, 6),color = features.positive.map({True: 'blue', False: 'red'}))plt.xlabel('Importance')
Ejemplo 2: soluciones del conjunto de datos de diabetes de la India pima
import pandas as pdimport numpy as npimport seaborn as snsimport matplotlib.pyplot as plt% matplotlib inlinefrom sklearn.linear_model import LogisticRegressionfrom sklearn.externals import joblib
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)