问题描述
您能否解释一下合适"的含义是什么?scikit-learn中的方法呢?为什么有用?
简而言之:拟合等于培训.然后,在对其进行训练之后,通常可以使用 .predict()
方法调用来使用该模型进行预测.
要详细说明:将模型拟合到训练数据上(即使用 .fit()
方法)基本上是建模过程中的训练部分.它找到通过使用的算法指定的方程式的系数(例如,上面的 umutto的线性回归示例)./p>
然后,对于分类器,您可以使用 predict
方法对传入的数据点(来自测试集或其他)进行分类.或者,在回归的情况下,当对传入的数据点使用 predict
时,您的模型将进行插值/插值.
还应注意,有时适合"命名法用于非机器学习方法,例如缩放器和其他预处理步骤.在这种情况下,就像在最小-最大缩放器,TF-IDF或其他转换的情况下一样,您只是在数据上应用"指定的功能.
注意:这里有一些参考资料...
Could you please explain what the "fit" method in scikit-learn does? Why is it useful?
In a nutshell: fitting is equal to training. Then, after it is trained, the model can be used to make predictions, usually with a .predict()
method call.
To elaborate: Fitting your model to (i.e. using the .fit()
method on) the training data is essentially the training part of the modeling process. It finds the coefficients for the equation specified via the algorithm being used (take for example umutto's linear regression example, above).
Then, for a classifier, you can classify incoming data points (from a test set, or otherwise) using the predict
method. Or, in the case of regression, your model will interpolate/extrapolate when predict
is used on incoming data points.
It also should be noted that sometimes the "fit" nomenclature is used for non-machine-learning methods, such as scalers and other preprocessing steps. In this case, you are merely "applying" the specified function to your data, as in the case with a min-max scaler, TF-IDF, or other transformation.
Note: here are a couple of references...
这篇关于“适合"是什么?scikit-learn中的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!