About model relearning in sklearn

Asked 1 years ago, Updated 1 years ago, 61 views

I am currently using Python's sklearn for machine learning.
You can create a model and make predictions from that model.
So I have a question. If you want to learn this model again, use that model
Is it possible to do additional learning?
Or do I have to use the data I used for my previous study?
This may be a basic question, but I appreciate your cooperation.

python scikit-learn

2022-09-30 11:35

1 Answers

Several models of scikit-learn implement a feature called online learning (or incremental learning).
https://scikit-learn.org/0.18/modules/scaling_strategies.html#incremental-learning

With online learning, you can learn more with additional learning data each time.

The following algorithms support online learning in the scikit-learn classification model:

  • sklearn.naive_bayes.MultinomialNB
  • sklearn.naive_bayes.BernoulliNB
  • sklearn.linear_model.Perceptron
  • sklearn.linear_model.SGDCclassifier
  • sklearn.linear_model.PassiveAggressiveClassifier

For additional learning, call the partial_fit method in the same way as calling the fit method.

For machine learning algorithms that do not support online learning, the fit method will retrain from scratch using one huge training data that adds additional data to the previous training data.


2022-09-30 11:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.