Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.preprocessing import StandardScaler
- scaler = StandardScaler()
- # transform data
- scaled_X_train = scaler.fit_transform(X_train)
- scaled_X_test = scaler.transform(X_test)
- from sklearn.linear_model import LogisticRegressionCV
- log_model = LogisticRegressionCV(cv=5, random_state=101).fit(scaled_X_train, y_train)
- log_model
- log_model.C_
- log_model.get_params()
- log_model.coef_
- coefs = pd.Series(index=X.columns,data=log_model.coef_[0])
- coefs = coefs.sort_values()
- plt.figure(figsize=(10,6))
- sns.barplot(x=coefs.index,y=coefs.values);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement