Skip to content

Instantly share code, notes, and snippets.

@MaxHalford
Last active April 5, 2020 08:28
Show Gist options
  • Save MaxHalford/db0f419c3919a4c2585ec86b07127c09 to your computer and use it in GitHub Desktop.
Save MaxHalford/db0f419c3919a4c2585ec86b07127c09 to your computer and use it in GitHub Desktop.
creme Phishing
>>> from creme import compose
>>> from creme import datasets
>>> from creme import linear_model
>>> from creme import metrics
>>> from creme import preprocessing
>>> X_y = datasets.Phishing()
>>> model = compose.Pipeline(
... preprocessing.StandardScaler(),
... linear_model.LogisticRegression()
... )
>>> metric = metrics.Accuracy()
>>> for x, y in X_y:
... y_pred = model.predict_one(x) # make a prediction
... metric = metric.update(y, y_pred) # update the metric
... model = model.fit_one(x, y) # make the model learn
>>> metric
Accuracy: 89.28%
@kinoute
Copy link

kinoute commented Apr 4, 2020

X_y is not instantiated anywhere! 😄

@MaxHalford
Copy link
Author

Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment