Last active
April 5, 2020 08:28
-
-
Save MaxHalford/db0f419c3919a4c2585ec86b07127c09 to your computer and use it in GitHub Desktop.
creme Phishing
This file contains hidden or 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
>>> 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% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
X_y
is not instantiated anywhere! 😄