The cross_validate function differs from cross_val_score in two ways: It allows specifying multiple metrics for evaluation. It returns a dict containing fit- ...
Evaluate an estimator by cross-validation using given metric.
cross_validate¶ Computes the k-fold cross validation of an estimator. Parameters¶. Name, Type, Optional, Description. estimator. object. ❌. Vertica estimator
Evaluate metric(s) by cross-validation and also record fit/score times. Parameters: estimator : estimator. An estimator object that implements the
Strategy to evaluate the performance of the cross-validated model on the test set. If None, the default evaluation criterion of the estimator is used.
这一下就清晰了:cross_validate是直接算出CV的指标值,而KFold只负责将数据按K折要求切分数据,然后通过迭代器对外提供,至于你怎么用,是用来计算指标还是
sklearn.model_selection.cross_validate¶ 通过交叉验证和记录拟合(或准确率)的时间评估指标。 在用户指南中阅读更多内容。 另见:. sklearn.model_selection.