共用方式為


RankingCatalog.CrossValidate 方法

定義

在 的折迭上 numberOfFolds 執行交叉驗證,方法是調整 estimator ,並在提供時遵守 rowGroupColumnNamedata 然後根據 labelColumnName 評估每個子模型,並傳回計量。

public System.Collections.Generic.IReadOnlyList<Microsoft.ML.TrainCatalogBase.CrossValidationResult<Microsoft.ML.Data.RankingMetrics>> CrossValidate (Microsoft.ML.IDataView data, Microsoft.ML.IEstimator<Microsoft.ML.ITransformer> estimator, int numberOfFolds = 5, string labelColumnName = "Label", string rowGroupColumnName = "GroupId", int? seed = default);
member this.CrossValidate : 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.RankingMetrics>>
Public Function CrossValidate (data As IDataView, estimator As IEstimator(Of ITransformer), Optional numberOfFolds As Integer = 5, Optional labelColumnName As String = "Label", Optional rowGroupColumnName As String = "GroupId", Optional seed As Nullable(Of Integer) = Nothing) As IReadOnlyList(Of TrainCatalogBase.CrossValidationResult(Of RankingMetrics))

參數

data
IDataView

要執行交叉驗證的資料。

estimator
IEstimator<ITransformer>

要符合的估算器。

numberOfFolds
Int32

交叉驗證折迭的數目。

labelColumnName
String

用於評估) 的標籤資料行 (。

rowGroupColumnName
String

data groupId 資料行的名稱,用來群組資料列。 分割交叉驗證的資料時,此資料行會自動當做 SamplingKeyColumn 使用,因為排名演算法需要此資料行。如果未 null 執行任何資料列群組,則此資料行是必要的。

seed
Nullable<Int32>

亂數產生器的種子,用來選取交叉驗證折迭的資料列。

傳回

個別折迭結果:計量、模型、評分資料集。

適用於