87 references to KeyValues
Microsoft.ML.Core (4)
Data\AnnotationBuilderExtensions.cs (1)
30=> builder.Add(AnnotationUtils.Kinds.KeyValues, new VectorDataViewType(valueType, size), getter);
Data\AnnotationUtils.cs (3)
189return GetNamesType(size).GetPair(Kinds.KeyValues); 312return col.Annotations.TryFindColumn(Kinds.KeyValues, out var metaCol) 446if (labelColumn.Value.Annotations.TryFindColumn(Kinds.KeyValues, out var metaCol) &&
Microsoft.ML.Core.Tests (1)
UnitTests\ScoreSchemaTest.cs (1)
61Assert.Equal(AnnotationUtils.Kinds.KeyValues, scoreMetadata.Schema[0].Name);
Microsoft.ML.Data (28)
Data\SchemaAnnotationsExtensions.cs (2)
57var metaColumn = column.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues); 74=> column.Annotations.GetValue(AnnotationUtils.Kinds.KeyValues, ref keyValues);
DataView\LambdaColumnMapper.cs (1)
127bldr.AddGetter(AnnotationUtils.Kinds.KeyValues, new VectorDataViewType(TextDataViewType.Instance, _typeDst.GetItemType().GetKeyCountAsInt32(Host)), mdGetter);
Evaluators\BinaryClassifierEvaluator.cs (1)
178labelCol.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type is VectorDataViewType vecType &&
Evaluators\EvaluatorUtils.cs (3)
569var keyValueType = schema[indices[i]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 867labelColKeyValuesType = dv.Schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 1236var keyValuesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Scorers\BinaryClassifierScorer.cs (2)
67var keyType = trainSchema.Label.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 115var type = labelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Scorers\MulticlassClassificationScorer.cs (2)
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;
Scorers\PredictedLabelScorerBase.cs (1)
89builder.Add(AnnotationUtils.Kinds.KeyValues, metaCol.Type, meta.GetGetter<T>(metaCol));
Transforms\Hashing.cs (1)
1967metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
Transforms\KeyToValue.cs (2)
230var typeVals = schema[ColMapNewToOld[iinfo]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 645if (!col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMetaCol))
Transforms\KeyToVector.cs (3)
313var keyValuesColumn = inputMetadata.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues); 394inputMetadata.GetValue(AnnotationUtils.Kinds.KeyValues, ref namesKeySrc); 830if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMeta))
Transforms\LabelConvertTransform.cs (1)
167return kind != AnnotationUtils.Kinds.KeyValues;
Transforms\SlotsDroppingTransformer.cs (1)
870builder.Add(InputSchema[_cols[iinfo]].Annotations, x => x == AnnotationUtils.Kinds.KeyValues || x == AnnotationUtils.Kinds.IsNormalized);
Transforms\TypeConverting.cs (4)
452builder.Add(InputSchema[ColMapNewToOld[i]].Annotations, name => name == AnnotationUtils.Kinds.KeyValues); 640if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMeta)) 642metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false)); 645metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, normMeta.ItemType, false));
Transforms\ValueToKeyMappingEstimator.cs (2)
193if (!col.IsKey || !col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var kv) || kv.Kind != SchemaShape.Column.VectorKind.Vector) 195kv = new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
Transforms\ValueToKeyMappingTransformerImpl.cs (2)
1098VectorDataViewType srcMetaType = _schema[srcCol].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 1179VectorDataViewType srcMetaType = _schema[srcCol].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Microsoft.ML.Ensemble (2)
PipelineEnsemble.cs (2)
608var mdType = labelCol.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 669var mdType = labelCol.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type;
Microsoft.ML.EntryPoints (1)
FeatureCombiner.cs (1)
123var type = col.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Microsoft.ML.LightGbm (1)
LightGbmMulticlassTrainer.cs (1)
367var metadata = LightGbmTrainerOptions.LightGbmModel == null ? new SchemaShape(labelCol.Annotations.Where(x => x.Name == AnnotationUtils.Kinds.KeyValues).Concat(AnnotationUtils.GetTrainerOutputAnnotation())) : new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation());
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
251var metaColumn = column.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues);
Microsoft.ML.StandardTrainers (5)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (2)
182var labelMetadataType = labelCol.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 374var metadata = new SchemaShape(labelCol.Annotations.Where(x => x.Name == AnnotationUtils.Kinds.KeyValues)
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (1)
172inputLabelCol.Annotations.Where(x => x.Name == AnnotationUtils.Kinds.KeyValues));
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (1)
119var predLabelMetadata = new SchemaShape(labelCol.Annotations.Where(x => x.Name == AnnotationUtils.Kinds.KeyValues)
Standard\SdcaMulticlass.cs (1)
164var metadata = new SchemaShape(labelCol.Annotations.Where(x => x.Name == AnnotationUtils.Kinds.KeyValues)
Microsoft.ML.TestFramework (2)
DataPipe\TestDataPipeBase.cs (2)
477var typeKeys = sch[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 502if (metaColumn.Name == AnnotationUtils.Kinds.KeyValues)
Microsoft.ML.Tests (9)
Transformers\CategoricalHashTests.cs (2)
191Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 197Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues });
Transformers\CategoricalTests.cs (2)
267Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues }); 273Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues });
Transformers\ConvertTests.cs (2)
296output.Schema["CatA"].Annotations.GetValue(AnnotationUtils.Kinds.KeyValues, ref slotNames); 359Assert.Equal(result.Schema["ConvB"].Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.KeyValues });
Transformers\HashTests.cs (3)
87Assert.Equal(AnnotationUtils.Kinds.KeyValues, column.Annotations.Schema.Single().Name); 92Assert.Equal(AnnotationUtils.Kinds.KeyValues, column.Annotations.Schema.Single().Name); 97Assert.Equal(AnnotationUtils.Kinds.KeyValues, column.Annotations.Schema.Single().Name);
Microsoft.ML.TorchSharp (24)
AutoFormerV2\ObjectDetectionTrainer.cs (8)
447metadata.Add(new SchemaShape.Column(Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, 625var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 636ValueGetter<VBuffer<T>> getter = LabelColumn.Annotations.GetGetter<VBuffer<T>>(LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]); 642var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 704meta.Add(AnnotationUtils.Kinds.KeyValues, type, labelGetter); 755var keyType = _parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 765labelBuilder.Add(AnnotationUtils.Kinds.KeyValues, keyType, getter); 778return labelCol.Annotations.GetGetter<VBuffer<T>>(labelCol.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
NasBert\NasBertTrainer.cs (7)
329metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, 344metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, 520var keyType = Parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 532labelBuilder.Add(AnnotationUtils.Kinds.KeyValues, keyType, getter); 542var keyType = Parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 546labelBuilder.Add(AnnotationUtils.Kinds.KeyValues, keyType, getter); 563return labelCol.Annotations.GetGetter<VBuffer<T>>(labelCol.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
NasBert\NerTrainer.cs (4)
281var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 287ValueGetter<VBuffer<T>> getter = LabelColumn.Annotations.GetGetter<VBuffer<T>>(LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]); 293var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 350meta.Add(AnnotationUtils.Kinds.KeyValues, type, labelGetter);
NasBert\TextClassificationTrainer.cs (4)
218var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 224ValueGetter<VBuffer<T>> getter = LabelColumn.Annotations.GetGetter<VBuffer<T>>(LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]); 230var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 287meta.Add(AnnotationUtils.Kinds.KeyValues, type, labelGetter);
TorchSharpBaseTrainer.cs (1)
452return labelCol.Annotations.GetGetter<VBuffer<T>>(labelCol.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
Microsoft.ML.Transforms (8)
GroupTransform.cs (1)
293s => s == AnnotationUtils.Kinds.IsNormalized || s == AnnotationUtils.Kinds.KeyValues);
KeyToVectorMapping.cs (2)
227if (inputMetadata.Schema.TryGetColumnIndex(AnnotationUtils.Kinds.KeyValues, out metaKeyValuesCol)) 479if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMeta))
MissingValueDroppingTransformer.cs (1)
211builder.Add(InputSchema[ColMapNewToOld[i]].Annotations, x => x == AnnotationUtils.Kinds.KeyValues || x == AnnotationUtils.Kinds.IsNormalized);
SvmLight\SvmLightLoader.cs (2)
728var keyValuesCol = col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues); 732col.Annotations.GetValue(AnnotationUtils.Kinds.KeyValues, ref keyValues);
Text\TokenizingByCharacters.cs (1)
695metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
UngroupTransform.cs (1)
209case AnnotationUtils.Kinds.KeyValues:
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
637metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,