What does calling fit() multiple times on the same model do?

后端 未结 2 739
闹比i
闹比i 2021-02-05 00:48

After I instantiate a scikit model (e.g. LinearRegression), if I call its fit() method multiple times (with different X and y

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 01:17

    If you will execute model.fit(X_train, y_train) for a second time - it'll overwrite all previously fitted coefficients, weights, intercept (bias), etc.

    If you want to fit just a portion of your data set and then to improve your model by fitting a new data, then you can use estimators, supporting "Incremental learning" (those, that implement partial_fit() method)

提交回复
热议问题