1 write to Label
Microsoft.ML.Core (1)
Data\RoleMappedSchema.cs (1)
180Label = cols[0];
164 references to Label
Microsoft.ML.Core (1)
Data\RoleMappedSchema.cs (1)
21/// cref="Label"/>), but can hold an arbitrary set of column infos. The convenience fields are non-null if and only
Microsoft.ML.Data (105)
EntryPoints\PredictorModelImpl.cs (4)
125if (trainRms.Label != null) 127labelType = trainRms.Label.Value.Type; 128if (trainRms.Label.Value.HasKeyValues()) 131trainRms.Label.Value.GetKeyValues(ref keyValues);
Evaluators\AnomalyDetectionEvaluator.cs (7)
101Host.Check(schema.Label.HasValue, "Could not find the label column"); 102t = schema.Label.Value.Type; 104throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single or a Key with cardinality 2", t.ToString()); 505Host.Assert(schema.Label.HasValue); 509_labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index); 792Host.CheckParam(schema.Label.HasValue, nameof(schema), "Data must contain a label column"); 795yield return schema.Label.Value.Name;
Evaluators\BinaryClassifierEvaluator.cs (10)
133host.Check(schema.Label.HasValue, "Could not find the label column"); 134t = schema.Label.Value.Type; 136throw host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single, Double, Boolean, or a Key with cardinality 2", t.ToString()); 176var labelCol = schema.Label.Value; 194Contracts.CheckParam(schema.Label != null, nameof(schema), "Could not find the label column"); 199return new BinaryPerInstanceEvaluator(Host, schema.Schema, scoreInfo.Name, probCol, schema.Label.Value.Name, _threshold, _useRaw); 622Host.Assert(schema.Label.HasValue); 627_labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index); 1475Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 1478yield return schema.Label.Value.Name;
Evaluators\ClusteringEvaluator.cs (6)
99DataViewType type = schema.Label?.Type; 102throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, 505if (schema.Label.HasValue) 506_labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index); 826if (schema.Label.HasValue) 827yield return schema.Label.Value.Name;
Evaluators\EvaluatorBase.cs (2)
61/// Access the label column with the <see cref="RoleMappedSchema.Label"/> property, and the score column with the 94int label = schema.Label?.Index ?? -1;
Evaluators\EvaluatorUtils.cs (1)
774var combined = AppendPerInstanceDataViews(env, perInstance[0].Schema.Label?.Name, foldDataViews, out variableSizeVectorColumnNames);
Evaluators\MamlEvaluator.cs (1)
142string label = EvaluateUtils.GetColName(LabelCol, schema.Label, DefaultColumnNames.Label);
Evaluators\MulticlassClassificationEvaluator.cs (10)
81Host.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 82var labelType = schema.Label.Value.Type; 84throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single or Key", labelType.ToString()); 122Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 125return new MulticlassPerInstanceEvaluator(Host, schema.Schema, scoreInfo, schema.Label.Value.Name); 415Host.Assert(schema.Label.HasValue); 419_labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index); 1039Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 1042yield return schema.Label.Value.Name; 1056string labelName = schema.Label.Value.Name;
Evaluators\MultiOutputRegressionEvaluator.cs (10)
52Host.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 55return new MultiOutputRegressionPerInstanceEvaluator(Host, schema.Schema, scoreCol.Name, schema.Label.Value.Name); 64Host.Check(schema.Label.HasValue, "Could not find the label column"); 65t = schema.Label.Value.Type as VectorDataViewType; 67throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "known-size vector of Single or Double", schema.Label.Value.Type.ToString()); 305Contracts.Assert(schema.Label.HasValue); 309_labelGetter = RowCursorUtils.GetVecGetterAs<float>(NumberDataViewType.Single, row, schema.Label.Value.Index); 643Host.CheckParam(schema.Label != null, nameof(schema), "Schema must contain a label column"); 648yield return schema.Label.Value.Name;
Evaluators\QuantileRegressionEvaluator.cs (7)
44Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column"); 53return new QuantileRegressionPerInstanceEvaluator(Host, schema.Schema, scoreInfo.Name, schema.Label.Value.Name, scoreSize, quantiles); 62Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column"); 63var labelType = schema.Label.Value.Type; 65throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single", t.ToString()); 542Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column"); 545yield return schema.Label.Value.Name;
Evaluators\RankingEvaluator.cs (8)
98var t = schema.Label.Value.Type; 102"label", schema.Label.Value.Name, "Single or a Key", t.ToString()); 137Host.CheckParam(data.Schema.Label.HasValue, nameof(data), "Schema must contain a label column"); 142data.Schema.Label.Value.Name, scoreInfo.Name, data.Schema.Group.Value.Name, _truncationLevel, _labelGains); 455Contracts.Assert(schema.Label.HasValue); 460_labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index); 943Host.CheckParam(schema.Label.HasValue, nameof(schema), "Data must contain a label column"); 948yield return schema.Label.Value.Name;
Evaluators\RegressionEvaluator.cs (7)
61Host.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 62t = schema.Label.Value.Type; 64throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single", t.ToString()); 74Contracts.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column"); 77return new RegressionPerInstanceEvaluator(Host, schema.Schema, scoreInfo.Name, schema.Label.Value.Name); 364Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 367yield return schema.Label.Value.Name;
Evaluators\RegressionEvaluatorBase.cs (2)
203Contracts.Assert(schema.Label.HasValue); 207_labelGetter = RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index);
Prediction\Calibrator.cs (4)
865if (schema.Label == null) 1020ch.CheckParam(data.Schema.Label.HasValue, nameof(data), "data must have a Label column"); 1024return TrainCalibrator(env, ch, caliTrainer, scored, data.Schema.Label.Value.Name, DefaultColumnNames.Score, data.Schema.Weight?.Name, maxRows); 2222if (data.Schema.Label == null && scp != null)
Scorers\BinaryClassifierScorer.cs (4)
65if (trainSchema?.Label == null) 67var keyType = trainSchema.Label.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 111env.Assert(trainSchema.Label.HasValue); 112var labelColumn = trainSchema.Label.Value;
Scorers\MulticlassClassificationScorer.cs (4)
415if (trainSchema?.Label == null) 417var keyType = trainSchema.Label.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 493var type = trainSchema.Label.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 501trainSchema.Label.Value.GetKeyValues(ref value);
Scorers\SchemaBindablePredictorWrapper.cs (3)
463Contracts.Assert(schema.Label.HasValue); 464var labelColumnName = schema.Label.Value.Name; 550yield return (InputRoleMappedSchema.Feature.HasValue) ? RoleMappedSchema.ColumnRole.Feature.Bind(InputRoleMappedSchema.Feature?.Name) : RoleMappedSchema.ColumnRole.Label.Bind(InputRoleMappedSchema.Label?.Name);
Training\TrainerUtils.cs (15)
86if (!data.Schema.Label.HasValue) 88var col = data.Schema.Label.Value; 121if (!data.Schema.Label.HasValue) 123var col = data.Schema.Label.Value; 141if (!data.Schema.Label.HasValue) 143var col = data.Schema.Label.Value; 189if (!data.Schema.Label.HasValue) 191var col = data.Schema.Label.Value; 233if ((opt & CursOpt.Label) != 0 && data.Schema.Label.HasValue) 234columns.Add(data.Schema.Label.Value); 290Contracts.CheckParam(schema.Label.HasValue, nameof(schema), "Missing label column"); 292return RowCursorUtils.GetLabelGetter(row, schema.Label.Value.Index); 431if (tschema.Label?.Name is string lname && lname != DefaultColumnNames.Label) 901if ((opt & CursOpt.Label) != 0 && data.Schema.Label != null) 973if ((opt & CursOpt.Label) != 0 && data.Schema.Label != null)
Microsoft.ML.Ensemble (13)
OutputCombiners\BaseStacking.cs (3)
155switch (data.Schema.Label.Value.Type.GetRawKind()) 162ch.Check(data.Schema.Label.Value.Type is KeyDataViewType); 208bldr.AddColumn(DefaultColumnNames.Label, data.Schema.Label.Value.Type as PrimitiveDataViewType, labels);
PipelineEnsemble.cs (7)
165Parent.Host.Check(Mappers[i].InputRoleMappedSchema.Label.HasValue, "Mapper was not trained using a label column"); 166var labelCol = Mappers[i].InputRoleMappedSchema.Label.Value; 597if (!rmd.Schema.Label.HasValue) 599var labelCol = rmd.Schema.Label.Value; 660var labelInfo = rmd.Schema.Label.HasValue; 661if (!rmd.Schema.Label.HasValue) 663var labelCol = rmd.Schema.Label.Value;
Selector\SubModelSelector\BaseSubModelSelector.cs (3)
108yield return RoleMappedSchema.CreatePair(RoleMappedSchema.ColumnRole.Label, testSchema.Label.Value.Name); 119yield return RoleMappedSchema.CreatePair(RoleMappedSchema.ColumnRole.Label, testSchema.Label.Value.Name); 125yield return RoleMappedSchema.CreatePair(RoleMappedSchema.ColumnRole.Label, testSchema.Label.Value.Name);
Microsoft.ML.EntryPoints (1)
PermutationFeatureImportance.cs (1)
66Contracts.Check(roleMappedData.Schema.Label != null, "Label column not found.");
Microsoft.ML.FastTree (2)
FastTree.cs (2)
1345var labelName = examples.Schema.Label?.Name; 1365int labelIdx = AddColumnIfNeeded(examples.Schema.Label, toTranspose);
Microsoft.ML.LightGbm (10)
LightGbmBinaryTrainer.cs (2)
270var labelType = data.Schema.Label.Value.Type; 274$"Label column '{data.Schema.Label.Value.Name}' is of type '{labelType.RawType}', but must be unsigned int, boolean or float.");
LightGbmMulticlassTrainer.cs (3)
240var labelType = data.Schema.Label.Value.Type; 244$"Label column '{data.Schema.Label.Value.Name}' is of type '{labelType.RawType}', but must be of unsigned int, boolean or float."); 293if (data.Schema.Label.Value.Type is KeyDataViewType keyType)
LightGbmRankingTrainer.cs (1)
248var labelCol = data.Schema.Label.Value;
LightGbmRegressionTrainer.cs (2)
232var labelType = data.Schema.Label.Value.Type; 236$"Label column '{data.Schema.Label.Value.Name}' is of type '{labelType.RawType}', but must be an unsigned int, boolean or float.");
LightGbmTrainerBase.cs (2)
526ch.CheckParam(data.Schema.Label.HasValue, nameof(data), "Need a label column"); 769ch.Check(factory.Data.Schema.Label != null, "The data should have label.");
Microsoft.ML.Mkl.Components (3)
OlsLinearRegression.cs (2)
158ch.CheckParam(examples.Schema.Label.HasValue, nameof(examples), "Need a labelColumn column"); 161var typeLab = examples.Schema.Label.Value.Type;
SymSgdClassificationTrainer.cs (1)
208ch.Assert(examplesToFeedTrain.Schema.Label.HasValue);
Microsoft.ML.Recommender (8)
MatrixFactorizationTrainer.cs (8)
441ch.CheckParam(data.Schema.Label.HasValue, nameof(data), "Input data did not have a unique label"); 443var labelCol = data.Schema.Label.Value; 450ch.CheckParam(validData.Schema.Label.HasValue, nameof(validData), "Input validation data did not have a unique label"); 452var validLabelCol = validData.Schema.Label.Value; 474using (var cursor = data.Data.GetRowCursor(matrixColumnIndexColInfo, matrixRowIndexColInfo, data.Schema.Label.Value)) 477var labGetter = RowCursorUtils.GetGetterAs<float>(NumberDataViewType.Single, cursor, data.Schema.Label.Value.Index); 493using (var validCursor = validData.Data.GetRowCursor(matrixColumnIndexColInfo, matrixRowIndexColInfo, data.Schema.Label.Value)) 495ValueGetter<float> validLabelGetter = RowCursorUtils.GetGetterAs<float>(NumberDataViewType.Single, validCursor, validData.Schema.Label.Value.Index);
Microsoft.ML.StandardTrainers (19)
FactorizationMachine\FactorizationMachineTrainer.cs (4)
373columns.Add(data.Schema.Label.Value); 379var labelGetter = RowCursorUtils.GetLabelGetter(cursor, data.Schema.Label.Value.Index); 479columns.Add(data.Schema.Label.Value); 491var labelGetter = RowCursorUtils.GetLabelGetter(cursor, data.Schema.Label.Value.Index);
LdSvm\LdSvmTrainer.cs (1)
633var labelCol = _data.Data.Schema[_data.Schema.Label.Value.Name];
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
181var labelCol = data.Schema.Label.Value;
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (2)
97Host.Assert(data.Schema.Label.HasValue); 99var label = data.Schema.Label.Value;
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (2)
136Host.Check(data.Schema.Label.HasValue, "Missing Label column"); 137var labelCol = data.Schema.Label.Value;
Standard\MulticlassClassification\OneVersusAllTrainer.cs (2)
167string trainerLabel = data.Schema.Label.Value.Name; 193var label = data.Schema.Label.Value;
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (2)
149string trainerLabel = data.Schema.Label.Value.Name; 166var label = data.Schema.Label.Value;
Standard\SdcaBinary.cs (1)
119ch.Assert(examplesToFeedTrain.Schema.Label.HasValue);
Standard\Simple\SimpleTrainers.cs (3)
255_host.CheckParam(data.Schema.Label.HasValue, nameof(data), "Missing Label column"); 256var labelCol = data.Schema.Label.Value; 270var getLab = cursor.GetGetter<bool>(data.Schema.Label.Value);
Standard\StochasticTrainerBase.cs (1)
83ch.Assert(examplesToFeedTrain.Schema.Label.HasValue);
Microsoft.ML.Transforms (2)
Dracula\CountTableTransformer.cs (2)
298_host.Assert(data.Schema.Label.HasValue); 300if (data.Schema.Label.Value.Type == BooleanDataViewType.Instance)