1 write to Annotations
Microsoft.ML.DataView (1)
DataViewSchema.cs (1)
116Annotations = annotations ?? Annotations.Empty;
255 references to Annotations
DnnAnalyzer (4)
DnnAnalyzer.cs (4)
40var metadataType = schema[i].Annotations.Schema.GetColumnOrNull("TensorflowOperatorType")?.Type; 42schema[i].Annotations.GetValue("TensorflowOperatorType", ref opType); 43metadataType = schema[i].Annotations.Schema.GetColumnOrNull("TensorflowUpstreamOperators")?.Type; 47schema[i].Annotations.GetValue("TensorflowUpstreamOperators", ref inputOps);
Microsoft.ML.Core (13)
Data\AnnotationUtils.cs (12)
226var columnType = schema[col].Annotations.Schema.GetColumnOrNull(annotationKind)?.Type; 232schema[col].Annotations.GetValue(annotationKind, ref value); 250var columnType = schema[col].Annotations.Schema.GetColumnOrNull(annotationKind)?.Type; 254schema[col].Annotations.GetValue(annotationKind, ref val); 269var columnType = schema[col].Annotations.Schema.GetColumnOrNull(annotationKind)?.Type; 273schema[col].Annotations.GetValue(annotationKind, ref val); 290var metaColumn = column.Annotations.Schema.GetColumnOrNull(Kinds.SlotNames); 307schema.Schema[list[0].Index].Annotations.GetValue(Kinds.SlotNames, ref slotNames); 363var annotationType = schema[col].Annotations.Schema.GetColumnOrNull(kind)?.Type; 366schema[col].Annotations.GetValue(kind, ref value); 388var type = schema[colIndex].Annotations.Schema.GetColumnOrNull(Kinds.CategoricalSlotRanges)?.Type; 392schema[colIndex].Annotations.GetValue(Kinds.CategoricalSlotRanges, ref catIndices);
Data\IEstimator.cs (1)
189foreach (var annotationColumn in schema[iCol].Annotations.Schema)
Microsoft.ML.Core.Tests (13)
UnitTests\ScoreSchemaTest.cs (6)
57var scoreMetadata = scoreColumn.Annotations; 69Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[1].Type); 70Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[2].Type); 114var scoreMetadata = scoreColumn.Annotations; 122Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[0].Type); 123Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[1].Type);
UnitTests\TestEntryPoints.cs (7)
1633var type = binaryScored.Schema[scoreCol.Value.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 1636binaryScored.Schema[scoreCol.Value.Index].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref kind); 1642type = regressionScored.Schema[scoreCol.Value.Index].Annotations.Schema[AnnotationUtils.Kinds.ScoreColumnKind].Type; 1644regressionScored.Schema[scoreCol.Value.Index].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref kind); 1650type = anomalyScored.Schema[scoreCol.Value.Index].Annotations.Schema[AnnotationUtils.Kinds.ScoreColumnKind].Type; 1652anomalyScored.Schema[scoreCol.Value.Index].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref kind); 5406var type = schema["Count"].Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type;
Microsoft.ML.Data (101)
Commands\ShowSchemaCommand.cs (5)
156if ((typeNames = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type) == null) 163schema[col].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref names); 191foreach (var metaColumn in schema[col].Annotations.Schema.OrderBy(mcol => mcol.Name)) 241schema[col].Annotations.GetValue(kind, ref value); 278schema[col].Annotations.GetValue(kind, ref value);
Data\SchemaAnnotationsExtensions.cs (10)
10/// Extension methods to facilitate easy consumption of popular contents of <see cref="DataViewSchema.Column.Annotations"/>. 20/// <param name="column">The column whose <see cref="DataViewSchema.Column.Annotations"/> will be queried.</param> 32/// <param name="column">The column whose <see cref="DataViewSchema.Column.Annotations"/> will be queried.</param> 35=> column.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref slotNames); 43/// <param name="column">The column whose <see cref="DataViewSchema.Column.Annotations"/> will be queried.</param> 57var metaColumn = column.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues); 71/// <param name="column">The column whose <see cref="DataViewSchema.Column.Annotations"/> will be queried.</param> 74=> column.Annotations.GetValue(AnnotationUtils.Kinds.KeyValues, ref keyValues); 82var metaColumn = column.Annotations.Schema.GetColumnOrNull((AnnotationUtils.Kinds.IsNormalized)); 87column.Annotations.GetValue(AnnotationUtils.Kinds.IsNormalized, ref value);
DataLoadSave\Binary\BinarySaver.cs (2)
281foreach (var metaColumn in schema[col].Annotations.Schema) 361schema[col].Annotations.GetValue(kind, ref value);
DataLoadSave\Text\TextSaver.cs (3)
167&& (typeNames = cursor.Schema[source].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType) != null 170cursor.Schema[source].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref _slotNames); 422var typeNames = data.Schema[cols[i]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType;
DataView\DataViewConstructionUtils.cs (1)
81var annotations = col.Annotations;
DataView\Transposer.cs (1)
1018schemaBuilder.AddColumn(selectedColumn.Name, selectedColumn.Type, selectedColumn.Annotations);
Dirty\ChooseColumnsByIndexTransform.cs (1)
117schemaBuilder.AddColumn(selectedColumn.Name, selectedColumn.Type, selectedColumn.Annotations);
Evaluators\EvaluatorUtils.cs (27)
66schema[col].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref tmp); 77schema[col].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref tmp); 87var columnType = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 91schema[col].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref tmp); 99var columnType = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 136col.Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref tmp); 142if (col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreValueKind)?.Type == TextDataViewType.Instance) 144col.Annotations.GetValue(AnnotationUtils.Kinds.ScoreValueKind, ref tmp); 186var type = schema[colScore].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnSetId)?.Type; 193schema[colScore].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnSetId, ref setId); 203if (col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreValueKind)?.Type == TextDataViewType.Instance) 205col.Annotations.GetValue(AnnotationUtils.Kinds.ScoreValueKind, ref tmp); 222var type = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 226schema[col].Annotations.GetValue(AnnotationUtils.Kinds.ScoreColumnKind, ref tmp); 353var slotNamesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 355schema[i].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref names); 481idv.Schema[col].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref slotNamesCur); 569var keyValueType = schema[indices[i]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 731(ref VBuffer<ReadOnlyMemory<char>> dst) => schema[index].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref dst); 846dv.Schema[i].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref slotNames); 867labelColKeyValuesType = dv.Schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 965dv.Schema[col].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref currSlotNames); 1027var slotNamesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 1029schema[i].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref names); 1236var keyValuesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 1392var type = countColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 1398countColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref labelNames);
Evaluators\MulticlassClassificationEvaluator.cs (3)
101var mdType = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 105schema.Schema[scoreInfo.Index].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref labelNames); 625schema[(int)ScoreIndex].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref classNames);
Evaluators\MultiOutputRegressionEvaluator.cs (2)
595var type = schema[column].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type; 599(ref VBuffer<ReadOnlyMemory<char>> dst) => schema[column].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref dst);
Evaluators\QuantileRegressionEvaluator.cs (3)
47var type = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 50schema.Schema[scoreInfo.Index].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref quantiles); 74var slotNamesType = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType;
Prediction\CalibratorCatalog.cs (1)
283var annotation = InputSchema[_scoreColIndex].Annotations;
Scorers\BinaryClassifierScorer.cs (1)
99if (mapper.OutputSchema[scoreIdx].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.TrainingLabelValues)?.Type != null)
Scorers\FeatureContributionCalculation.cs (2)
332FeatureColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref _slotNames); 341FeatureColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref value));
Scorers\MulticlassClassificationScorer.cs (3)
323meta.Add(partialSchema[i].Annotations, selector: s => s != labelNameKind); 329meta.Add(partialSchema[i].Annotations, selector: s => true); 459if (outSchema[scoreIdx].Annotations.Schema.GetColumnOrNull(metaKind)?.Type != null)
Scorers\PredictedLabelScorerBase.cs (1)
66var scoreColMetadata = mapper.OutputSchema[scoreColIndex].Annotations;
Scorers\RowToRowScorerBase.cs (3)
441foreach (var pair in Mapper.OutputSchema[iinfo - DerivedColumnCount].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type))) 452return Mapper.OutputSchema[iinfo - DerivedColumnCount].Annotations.Schema.GetColumnOrNull(kind)?.Type; 466Mapper.OutputSchema[iinfo - DerivedColumnCount].Annotations.GetValue(kind, ref value);
Scorers\ScoreSchemaFactory.cs (2)
58schemaBuilder.AddColumn(partialSchema[0].Name, partialSchema[0].Type, partialSchema[0].Annotations); 99metadataBuilder.Add(partialSchema[0].Annotations, (string kind) => true);
Transforms\ColumnBindingsBase.cs (3)
516return Input[index].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type)); 529return Input[index].Annotations.Schema.GetColumnOrNull(kind)?.Type; 542Input[index].Annotations.GetValue(kind, ref value);
Transforms\ColumnConcatenatingTransformer.cs (2)
576return new DataViewSchema.DetachedColumn(_columnOptions.Name, inputCol.Type, inputCol.Annotations); 648var inputMetadata = _inputSchema[colSrc].Annotations;
Transforms\ColumnCopying.cs (1)
233result[i] = new DataViewSchema.DetachedColumn(_columns[i].outputColumnName, srcCol.Type, srcCol.Annotations);
Transforms\FeatureContributionCalculationTransformer.cs (2)
188InputSchema[_featureColumnIndex].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref _slotNames); 199builder.Add(InputSchema[_featureColumnIndex].Annotations, x => x == AnnotationUtils.Kinds.SlotNames);
Transforms\Hashing.cs (1)
1337meta.Add(InputSchema[colIndex].Annotations, name => name == AnnotationUtils.Kinds.SlotNames);
Transforms\KeyToValue.cs (2)
177meta.Add(InputSchema[ColMapNewToOld[i]].Annotations, name => name == AnnotationUtils.Kinds.SlotNames); 230var typeVals = schema[ColMapNewToOld[iinfo]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type;
Transforms\KeyToVector.cs (2)
306var inputMetadata = InputSchema[srcCol].Annotations; 377var inputMetadata = InputSchema[_infos[iinfo].InputColumnName].Annotations;
Transforms\MetadataDispatcher.cs (3)
236foreach (var kvp in info.SchemaSrc[info.IndexSrc].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type))) 268return info.SchemaSrc[info.IndexSrc].Annotations.Schema.GetColumnOrNull(kind)?.Type; 298info.SchemaSrc[info.IndexSrc].Annotations.GetValue(kind, ref value);
Transforms\Normalizer.cs (1)
747builder.Add(InputSchema[ColMapNewToOld[iinfo]].Annotations, name => name == AnnotationUtils.Kinds.SlotNames);
Transforms\SlotsDroppingTransformer.cs (1)
870builder.Add(InputSchema[_cols[iinfo]].Annotations, x => x == AnnotationUtils.Kinds.KeyValues || x == AnnotationUtils.Kinds.IsNormalized);
Transforms\TypeConverting.cs (3)
442builder.Add(InputSchema[ColMapNewToOld[i]].Annotations, name => name == AnnotationUtils.Kinds.SlotNames); 452builder.Add(InputSchema[ColMapNewToOld[i]].Annotations, name => name == AnnotationUtils.Kinds.KeyValues); 456builder.Add(InputSchema[ColMapNewToOld[i]].Annotations, name => name == AnnotationUtils.Kinds.IsNormalized);
Transforms\ValueMapping.cs (6)
366internal DataViewSchema.Annotations ValueColumnMetadata => _valueMap.ValueColumn.Annotations; 451Host.Check(retrievedKeyColumn.Annotations == keyColumn.Annotations, nameof(keyColumn) + "'s column annotations don't match those of the associated column in " + nameof(dataView)); 459Host.Check(retrievedValueColumn.Annotations == valueColumn.Annotations, nameof(valueColumn) + "'s column annotations don't match those of the associated column in " + nameof(dataView)); 1288result[i] = new DataViewSchema.DetachedColumn(_columns[i].outputColumnName, colType, _valueMap.ValueColumn.Annotations);
Transforms\ValueToKeyMappingTransformer.cs (1)
750builder.Add(InputSchema[colIndex].Annotations, name => name == AnnotationUtils.Kinds.SlotNames);
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.DataView (6)
DataViewSchema.cs (6)
121var annotationsString = (Annotations == null || Annotations.Schema.Count == 0) ? 122null : $" {{{string.Join(", ", Annotations.Schema.Select(x => x.Name))}}}"; 165Annotations = column.Annotations; 282_items.Add((column.Name, column.Type, annotations.GetGetterInternal(column.Index), column.Annotations)); 413AddColumn(column.Name, column.Type, column.Annotations);
Microsoft.ML.EntryPoints (1)
FeatureCombiner.cs (1)
123var type = col.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Microsoft.ML.FastTree (1)
TreeEnsemble\InternalTreeEnsemble.cs (1)
447sch[feat.Index].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref _names);
Microsoft.ML.IntegrationTests (2)
Common.cs (2)
114AssertEqual(schemaPair.Item1.Annotations.Schema, schemaPair.Item1.Annotations.Schema);
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
251var metaColumn = column.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues);
Microsoft.ML.Samples (2)
Dynamic\Transforms\Conversion\Hash.cs (1)
80transformedData.Schema["CategoryHashed"].Annotations.GetValue(
Dynamic\Transforms\Conversion\HashWithOptions.cs (1)
94transformedData.Schema["CategoryHashed"].Annotations.GetValue(
Microsoft.ML.StandardTrainers (1)
Standard\ModelStatistics.cs (1)
434featureColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref names);
Microsoft.ML.TensorFlow (2)
TensorflowUtils.cs (2)
25/// Key to access operator's type (a string) in <see cref="DataViewSchema.Column.Annotations"/>. 30/// Key to access upstream operators' names (a string array) in <see cref="DataViewSchema.Column.Annotations"/>.
Microsoft.ML.TensorFlow.Tests (15)
TensorflowTests.cs (15)
586var metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 590schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowOperatorTypeKind, ref opType); 592metadataType = schema[col].Annotations.Schema.GetColumnOrNull(TensorFlowUtils.TensorflowUpstreamOperatorsKind)?.Type; 598metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 601schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowOperatorTypeKind, ref opType); 603metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowUpstreamOperatorsKind].Type; 606schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowUpstreamOperatorsKind, ref inputOps); 613metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 616schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowOperatorTypeKind, ref opType); 618metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowUpstreamOperatorsKind].Type; 620schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowUpstreamOperatorsKind, ref inputOps); 628metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 631schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowOperatorTypeKind, ref opType); 633metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowUpstreamOperatorsKind].Type; 635schema[col].Annotations.GetValue(TensorFlowUtils.TensorflowUpstreamOperatorsKind, ref inputOps);
Microsoft.ML.TestFramework (3)
DataPipe\TestDataPipeBase.cs (3)
476var typeSlot = sch[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type; 477var typeKeys = sch[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 480foreach (var metaColumn in sch[col].Annotations.Schema)
Microsoft.ML.TestFrameworkCommon (5)
TestCommon.cs (5)
237var t1 = sch1[col].Annotations.Schema.GetColumnOrNull(kind)?.Type; 238var t2 = sch2[col].Annotations.Schema.GetColumnOrNull(kind)?.Type; 262sch1[col].Annotations.GetValue(kind, ref names1); 263sch2[col].Annotations.GetValue(kind, ref names2); 273sch[col].Annotations.GetValue(kind, ref names);
Microsoft.ML.Tests (76)
FakeSchemaTest.cs (1)
49var metaC = columnC.Annotations;
Scenarios\Api\Estimators\PredictAndMetadata.cs (3)
47engine.OutputSchema[nameof(IrisPrediction.Score)].Annotations.GetValue(AnnotationUtils.Kinds.TrainingLabelValues, ref originalLabels); 92Assert.NotNull(scoredData.Schema["Score"].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)); 126Assert.Null(scoredData2.Schema["Score"].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames));
Scenarios\Api\TestApi.cs (15)
231Assert.True(idv.Schema[0].Annotations.Schema.Count == 2); 232Assert.True(idv.Schema[0].Annotations.Schema[0].Name == kindFloat); 233Assert.True(idv.Schema[0].Annotations.Schema[0].Type == coltypeFloat); 234Assert.True(idv.Schema[0].Annotations.Schema[1].Name == kindString); 235Assert.True(idv.Schema[0].Annotations.Schema[1].Type == TextDataViewType.Instance); 237Assert.True(idv.Schema[1].Annotations.Schema.Count == 3); 238Assert.True(idv.Schema[1].Annotations.Schema[0].Name == kindStringArray); 239Assert.True(idv.Schema[1].Annotations.Schema[0].Type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType); 240Assert.Throws<ArgumentOutOfRangeException>(() => idv.Schema[1].Annotations.Schema[kindFloat]); 243idv.Schema[0].Annotations.GetValue(kindFloat, ref retrievedFloat); 247idv.Schema[0].Annotations.GetValue(kindString, ref retrievedReadOnlyMemory); 251idv.Schema[1].Annotations.GetValue(kindStringArray, ref retrievedReadOnlyMemoryVBuffer); 255idv.Schema[1].Annotations.GetValue(kindFloatArray, ref retrievedFloatVBuffer); 260idv.Schema[1].Annotations.GetValue(kindVBuffer, ref retrievedVBuffer); 263Assert.Throws<InvalidOperationException>(() => idv.Schema[1].Annotations.GetValue(kindFloat, ref retrievedReadOnlyMemoryVBuffer));
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (8)
66Assert.Single(treeValuesColumn.Annotations.Schema); 68treeValuesColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref slotNames); 84Assert.Equal(2, treeLeafIdsColumn.Annotations.Schema.Count); 87treeLeafIdsColumn.Annotations.GetValue(AnnotationUtils.Kinds.IsNormalized, ref leafIdsNormalizedFlag); 91treeLeafIdsColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref leafIdsSlotNames); 107Assert.Equal(2, treePathIdsColumn.Annotations.Schema.Count); 110treePathIdsColumn.Annotations.GetValue(AnnotationUtils.Kinds.IsNormalized, ref pathIdsNormalizedFlag); 114treePathIdsColumn.Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref pathIdsSlotNames);
Transformers\CategoricalHashTests.cs (12)
143Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 149Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 156Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 162Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 169Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 175column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 181Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 185column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 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 }); 203Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 208Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized });
Transformers\CategoricalTests.cs (14)
221Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 227Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 234Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 240Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 247Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 251column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 257Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 261column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 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 }); 279Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 285Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 292Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 298Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized });
Transformers\ConvertTests.cs (3)
296output.Schema["CatA"].Annotations.GetValue(AnnotationUtils.Kinds.KeyValues, ref slotNames); 352Assert.Equal(result.Schema["ConvA"].Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 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);
Transformers\KeyToBinaryVectorEstimatorTest.cs (4)
117Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 123Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 130Assert.Empty(column.Annotations.Schema); 133Assert.Equal(AnnotationUtils.Kinds.IsNormalized, column.Annotations.Schema.Single().Name);
Transformers\KeyToVectorEstimatorTests.cs (12)
136Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 142Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 146column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 152Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 156column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 162Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.IsNormalized }); 169Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[2] { AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 170column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges); 176Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.IsNormalized }); 180Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[1] { AnnotationUtils.Kinds.SlotNames }); 186Assert.Equal(column.Annotations.Schema.Select(x => x.Name), new string[3] { AnnotationUtils.Kinds.SlotNames, AnnotationUtils.Kinds.CategoricalSlotRanges, AnnotationUtils.Kinds.IsNormalized }); 190column.Annotations.GetValue(AnnotationUtils.Kinds.CategoricalSlotRanges, ref slotRanges);
Transformers\ValueMappingTests.cs (1)
573var annotations = result.Schema["D"].Annotations;
Microsoft.ML.Transforms (9)
GroupTransform.cs (2)
285schemaBuilder.AddColumn(groupKeyColumnName, sourceSchema[groupKeyColumnName].Type, sourceSchema[groupKeyColumnName].Annotations); 292metadataBuilder.Add(sourceSchema[groupValueColumnName].Annotations,
PermutationFeatureImportance.cs (1)
57data.Schema[featuresColumnIndex].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref slotNames);
PermutationFeatureImportanceExtensions.cs (1)
705data.Schema[featureColumnName].Annotations.GetValue("SlotNames", ref nameBuffer);
SvmLight\SvmLightLoader.cs (2)
728var keyValuesCol = col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues); 732col.Annotations.GetValue(AnnotationUtils.Kinds.KeyValues, ref keyValues);
Text\LdaTransform.cs (1)
851inputSchema[srcCol].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref dst);
UngroupTransform.cs (2)
298schemaBuilder.AddColumn(inputSchema[i].Name, inputSchema[i].Type, inputSchema[i].Annotations); 304metadataBuilder.Add(inputSchema[i].Annotations, metadataName => ShouldPreserveMetadata(metadataName));