July 2019
Beginner to intermediate
740 pages
16h 52m
English
Continuous updating will help the model adapt to changes in hacker behavior over time. Now that we have evaluated our January predictions, we can use them to update the model. To do so, we use the partial_fit() method and the labeled data for January, which will run a single epoch on the January data:
>>> model.partial_fit(X_jan, y_jan)
Our model has now been updated, so we can test its performance on the February data now. Let's grab the February data, first:
>>> X_feb, y_feb = get_X_y(logs_2019, '2019-02', hackers_2019)
February had fewer attacks, but we caught a higher percentage of them (79%):
>>> from sklearn.metrics import classification_report>>> print(classification_report(... y_feb, model.predict_proba(X_feb)[:,1] ...
Read now
Unlock full access