-
-
Save fernandonieuwveldt/ebb5a67415f462f1aa09ebd2913eca1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preprocess = ColumnTransformer( | |
transformers=[ | |
("num", StandardScaler(), NUMERICAL_FEATURES), | |
("cat", OneHotEncoder(handle_unknown="ignore"), CATEGORICAL_FEATURES+STRING_CATEGORICAL_FEATURES) | |
] | |
) | |
sklearn_model = Pipeline( | |
steps=[ | |
('preprocessor', preprocess), | |
('classifier', LogisticRegression()) | |
] | |
) | |
sklearn_model.fit(dataframe, labels) | |
sklearn_model.score(dataframe, labels) | |
>>> 0.8613861386138614 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment