Dela via


BinaryClassificationCatalog.CrossValidateNonCalibrated Method

Definition

Run cross-validation over numberOfFolds folds of data, by fitting estimator, and respecting samplingKeyColumnName if provided. Then evaluate each sub-model against labelColumnName and return a BinaryClassificationMetrics object, which do not include probability-based metrics, for each sub-model. Each sub-model is evaluated on the cross-validation fold that it did not see during training.

public System.Collections.Generic.IReadOnlyList<Microsoft.ML.TrainCatalogBase.CrossValidationResult<Microsoft.ML.Data.BinaryClassificationMetrics>> CrossValidateNonCalibrated (Microsoft.ML.IDataView data, Microsoft.ML.IEstimator<Microsoft.ML.ITransformer> estimator, int numberOfFolds = 5, string labelColumnName = "Label", string samplingKeyColumnName = default, int? seed = default);
member this.CrossValidateNonCalibrated : Microsoft.ML.IDataView * Microsoft.ML.IEstimator<Microsoft.ML.ITransformer> * int * string * string * Nullable<int> -> System.Collections.Generic.IReadOnlyList<Microsoft.ML.TrainCatalogBase.CrossValidationResult<Microsoft.ML.Data.BinaryClassificationMetrics>>
Public Function CrossValidateNonCalibrated (data As IDataView, estimator As IEstimator(Of ITransformer), Optional numberOfFolds As Integer = 5, Optional labelColumnName As String = "Label", Optional samplingKeyColumnName As String = Nothing, Optional seed As Nullable(Of Integer) = Nothing) As IReadOnlyList(Of TrainCatalogBase.CrossValidationResult(Of BinaryClassificationMetrics))

Parameters

data
IDataView

The data to run cross-validation on.

estimator
IEstimator<ITransformer>

The estimator to fit.

numberOfFolds
Int32

Number of cross-validation folds.

labelColumnName
String

The label column (for evaluation).

samplingKeyColumnName
String

Name of a column to use for grouping rows. If two examples share the same value of the samplingKeyColumnName, they are guaranteed to appear in the same subset (train or test). This can be used to ensure no label leakage from the train to the test set. If null no row grouping will be performed.

seed
Nullable<Int32>

Seed for the random number generator used to select rows for cross-validation folds.

Returns

Per-fold results: metrics, models, scored datasets.

Applies to