255 instantiations of VectorDataViewType
Microsoft.Data.Analysis (14)
DataFrameColumns\VBufferDataFrameColumn.cs (14)
317return new VectorDataViewType(BooleanDataViewType.Instance); 321return new VectorDataViewType(NumberDataViewType.Byte); 325return new VectorDataViewType(NumberDataViewType.Double); 329return new VectorDataViewType(NumberDataViewType.Single); 333return new VectorDataViewType(NumberDataViewType.Int32); 337return new VectorDataViewType(NumberDataViewType.Int64); 341return new VectorDataViewType(NumberDataViewType.SByte); 345return new VectorDataViewType(NumberDataViewType.Int16); 349return new VectorDataViewType(NumberDataViewType.UInt32); 353return new VectorDataViewType(NumberDataViewType.UInt64); 357return new VectorDataViewType(NumberDataViewType.UInt16); 361return new VectorDataViewType(NumberDataViewType.UInt16); 365return new VectorDataViewType(NumberDataViewType.Double); 369return new VectorDataViewType(TextDataViewType.Instance);
Microsoft.ML.AutoML (1)
AutoMLExperiment\ITrialResultManager.cs (1)
50schemaBuilder.AddColumn("parameter", new VectorDataViewType(NumberDataViewType.Double));
Microsoft.ML.AutoML.Tests (6)
TransformInferenceTests.cs (6)
251new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 304new DatasetColumnInfo("Numeric", new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 637new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 647new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 673new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 684new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)),
Microsoft.ML.Core (4)
Data\AnnotationBuilderExtensions.cs (2)
19=> builder.Add(AnnotationUtils.Kinds.SlotNames, new VectorDataViewType(TextDataViewType.Instance, size), getter); 30=> builder.Add(AnnotationUtils.Kinds.KeyValues, new VectorDataViewType(valueType, size), getter);
Data\AnnotationUtils.cs (2)
145return new VectorDataViewType(TextDataViewType.Instance, size); 157return new VectorDataViewType(NumberDataViewType.Int32, rangeCount, 2);
Microsoft.ML.Core.Tests (6)
UnitTests\ColumnTypes.cs (6)
39tmp1 = new VectorDataViewType(tmp, size); 45tmp2 = new VectorDataViewType(tmp, size, size1); 66tmp1 = new VectorDataViewType(tmp, size); 72tmp2 = new VectorDataViewType(tmp, size, size1); 86tmp1 = new VectorDataViewType(tmp, size); 92tmp2 = new VectorDataViewType(tmp, size, size1);
Microsoft.ML.Data (72)
Data\SchemaDefinition.cs (2)
459columnType = new VectorDataViewType(itemType, 0); 461columnType = new VectorDataViewType(itemType, dims);
DataLoadSave\Binary\Codecs.cs (1)
1147type = new VectorDataViewType(itemType);
DataLoadSave\Database\DatabaseLoader.cs (1)
452type = new VectorDataViewType(itemType, size);
DataLoadSave\FakeSchema.cs (2)
53curType = new VectorDataViewType((PrimitiveDataViewType)curType, 0); 55curType = new VectorDataViewType((PrimitiveDataViewType)curType, AllVectorSizes);
DataLoadSave\Text\TextLoader.cs (2)
677type = new VectorDataViewType(itemType); 679type = new VectorDataViewType(itemType, size);
DataLoadSave\Transpose\TransposeSaver.cs (1)
78var newVectorType = new VectorDataViewType(primitiveType, size: 2);
DataView\ArrayDataViewBuilder.cs (1)
480return new VectorDataViewType(itemType, degree);
DataView\DataViewConstructionUtils.cs (1)
887annotationType = isVector ? new VectorDataViewType(primitiveItemType) : (DataViewType)primitiveItemType;
DataView\InternalSchemaDefinition.cs (1)
269colType = isVector ? new VectorDataViewType(itemType) : (DataViewType)itemType;
DataView\LambdaColumnMapper.cs (1)
135bldr.AddGetter(AnnotationUtils.Kinds.SlotNames, new VectorDataViewType(TextDataViewType.Instance, vectorSize), mdGetter);
DataView\Transposer.cs (3)
275return new VectorDataViewType(elementType, RowCount); 1105_types[0] = new VectorDataViewType(type.ItemType, _lims[0]); 1107_types[c] = new VectorDataViewType(type.ItemType, _lims[c] - _lims[c - 1]);
Deprecated\Instances\HeaderSchema.cs (2)
33_colType = new VectorDataViewType(NumberDataViewType.Single, collection.Count); 34_slotNamesType = new VectorDataViewType(TextDataViewType.Instance, collection.Count);
Evaluators\ClusteringEvaluator.cs (5)
598_types[SortedClusterCol] = new VectorDataViewType(key, _numClusters); 599_types[SortedClusterScoreCol] = new VectorDataViewType(NumberDataViewType.Single, _numClusters); 617_types[SortedClusterCol] = new VectorDataViewType(key, _numClusters); 618_types[SortedClusterScoreCol] = new VectorDataViewType(NumberDataViewType.Single, _numClusters); 724var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _numClusters);
Evaluators\EvaluatorUtils.cs (3)
547var typeDst = new VectorDataViewType(itemType, slotNames.Count); 734type, new VectorDataViewType(keyType, ((VectorDataViewType)type).Dimensions), mapper, keyValueGetter, slotNamesGetter); 987variableSizeVectorColumnName + "_VarLength", typeSrc, new VectorDataViewType((PrimitiveDataViewType)typeSrc.ItemType),
Evaluators\MulticlassClassificationEvaluator.cs (4)
635_types[SortedScoresCol] = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 636_types[SortedClassesCol] = new VectorDataViewType(key, _numClasses); 664_types[SortedScoresCol] = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 665_types[SortedClassesCol] = new VectorDataViewType(key, _numClasses);
Evaluators\MultiOutputRegressionEvaluator.cs (3)
552labelType = new VectorDataViewType((PrimitiveDataViewType)t.ItemType, t.Size); 553var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, t.Size); 561scoreType = new VectorDataViewType((PrimitiveDataViewType)t.ItemType, t.Size);
Evaluators\QuantileRegressionEvaluator.cs (3)
295_outputType = new VectorDataViewType(NumberDataViewType.Double, _scoreSize); 314_outputType = new VectorDataViewType(NumberDataViewType.Double, _scoreSize); 355var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _scoreSize);
Evaluators\RankingEvaluator.cs (2)
642_outputType = new VectorDataViewType(NumberDataViewType.Double, _truncationLevel); 643_slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _truncationLevel);
Scorers\FeatureContributionCalculation.cs (1)
344var featureContributionType = new VectorDataViewType(NumberDataViewType.Single, ((VectorDataViewType)FeatureColumn.Type).Dimensions);
Scorers\SchemaBindablePredictorWrapper.cs (1)
130var typeIn = ValueMapper != null ? ValueMapper.InputType : new VectorDataViewType(NumberDataViewType.Single);
Scorers\ScoreSchemaFactory.cs (1)
87var partialSchema = Create(new VectorDataViewType(scoreType as PrimitiveDataViewType, quantiles.Length), AnnotationUtils.Const.ScoreColumnKind.QuantileRegression);
Transforms\ColumnConcatenatingTransformer.cs (3)
515return new BoundColumn(InputSchema, _parent._columns[iinfo], sources, new VectorDataViewType((PrimitiveDataViewType)itemType, totalSize), 938var vectorizerOutputType = new VectorDataViewType(NumberDataViewType.Single, outVectorSize); 945var dstVectorType = new VectorDataViewType(outColType.GetItemType() as PrimitiveDataViewType, outVectorSize);
Transforms\FeatureContributionCalculationTransformer.cs (1)
200return new[] { new DataViewSchema.DetachedColumn(DefaultColumnNames.FeatureContributions, new VectorDataViewType(NumberDataViewType.Single, _featureColumnType.Size), builder.ToAnnotations()) };
Transforms\Hashing.cs (2)
168return new VectorDataViewType(itemType, vectorType.Size); 254_kvTypes[invertIinfos[i]] = new VectorDataViewType(TextDataViewType.Instance, _keyValues[invertIinfos[i]].Length);
Transforms\InvertHashUtils.cs (2)
393var result = factory.TryGetCodec(new VectorDataViewType(TextDataViewType.Instance), out codec); 469kvTypesLocal[iinfo] = new VectorDataViewType(TextDataViewType.Instance, keyValuesLocal[iinfo].Length);
Transforms\KeyToValue.cs (4)
238types[iinfo] = new VectorDataViewType((PrimitiveDataViewType)valsItemType, vectorType.Dimensions); 512var castNodeOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Int64, srcShape), "CastNodeOutput"); 520labelEncoderOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, srcShape), "CastNodeOutput"); 524labelEncoderOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, srcShape), "CastNodeOutput");
Transforms\KeyToVector.cs (4)
260_types[i] = new VectorDataViewType(NumberDataViewType.Single, keyCount); 262_types[i] = new VectorDataViewType(NumberDataViewType.Single, valueCount, keyCount); 327var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 339var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions);
Transforms\LabelConvertTransform.cs (1)
191Interlocked.CompareExchange(ref _slotType, new VectorDataViewType(NumberDataViewType.Single, srcSlotType.Dimensions), null);
Transforms\Normalizer.cs (1)
442return isVectorOld ? (DataViewType)(new VectorDataViewType(itemTypeOld, vectorSize)) : itemTypeOld;
Transforms\SlotsDroppingTransformer.cs (3)
545type = new VectorDataViewType(vectorType.ItemType, Math.Max(dstLength, 1)); 841var type = new VectorDataViewType(vectorType.ItemType, Math.Max(dstLength, 1)); 847builder.Add(AnnotationUtils.Kinds.SlotNames, new VectorDataViewType(TextDataViewType.Instance, dstLength), slotNamesGetter);
Transforms\TypeConverting.cs (1)
429typeDst = new VectorDataViewType(itemType, vectorType.Dimensions);
Transforms\ValueMapping.cs (6)
1073colType = new VectorDataViewType((PrimitiveDataViewType)_parent.ValueColumnType, vectorType.Dimensions); 1088var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(itemType, (int)srcShape[1]), "castOutput"); 1114(typeValue == NumberDataViewType.Double || typeValue == BooleanDataViewType.Instance) ? ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, (int)srcShape[1]), "LabelEncoderOutput") : 1115ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Int64, (int)srcShape[1]), "LabelEncoderOutput"); 1200var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, (int)srcShape[1]), "castOutput"); 1287colType = new VectorDataViewType(ColumnTypeExtensions.PrimitiveTypeFromType(_valueMap.ValueColumn.Type.GetItemType().RawType));
Transforms\ValueToKeyMappingTransformer.cs (3)
728colType = new VectorDataViewType(keyType, vectorType.Dimensions); 791var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, (int)srcShape[1]), "castOutput"); 804var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, (int)srcShape[1]), "castOutput");
Microsoft.ML.Ensemble (5)
PipelineEnsemble.cs (2)
280_scoreType = new VectorDataViewType(NumberDataViewType.Single, classCount); 287_scoreType = new VectorDataViewType(NumberDataViewType.Single, classCount);
Trainer\EnsembleDistributionModelParameters.cs (1)
102return inputType ?? new VectorDataViewType(NumberDataViewType.Single);
Trainer\EnsembleModelParameters.cs (1)
93return inputType ?? new VectorDataViewType(NumberDataViewType.Single);
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (1)
91inputType = new VectorDataViewType(NumberDataViewType.Single);
Microsoft.ML.EntryPoints (1)
PermutationFeatureImportance.cs (1)
325schema[metricName].ColumnType = new VectorDataViewType(type, size);
Microsoft.ML.FastTree (7)
FastTree.cs (2)
2853InputType = new VectorDataViewType(NumberDataViewType.Single, NumFeatures); 2891InputType = new VectorDataViewType(NumberDataViewType.Single, NumFeatures);
GamModelParameters.cs (2)
112_inputType = new VectorDataViewType(NumberDataViewType.Single, _numInputFeatures); 162_inputType = new VectorDataViewType(NumberDataViewType.Single, _numInputFeatures);
TreeEnsembleFeaturizer.cs (3)
118var treeValueType = new VectorDataViewType(NumberDataViewType.Single, owner._ensemble.TrainedEnsemble.NumTrees); 121var leafIdType = new VectorDataViewType(NumberDataViewType.Single, owner._totalLeafCount); 129var pathIdType = new VectorDataViewType(NumberDataViewType.Single, owner._totalLeafCount - owner._ensemble.TrainedEnsemble.NumTrees);
Microsoft.ML.ImageAnalytics (4)
ImageLoader.cs (1)
365return new VectorDataViewType(NumberDataViewType.Byte);
ImagePixelExtractor.cs (2)
470types[i] = new VectorDataViewType(column.OutputAsFloatArray ? NumberDataViewType.Single : NumberDataViewType.Byte, height, width, column.Planes); 472types[i] = new VectorDataViewType(column.OutputAsFloatArray ? NumberDataViewType.Single : NumberDataViewType.Byte, column.Planes, height, width);
VectorToImageTransform.cs (1)
307throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, new VectorDataViewType(vectorType.ItemType, _columns[col].ImageHeight, _columns[col].ImageWidth, _columns[col].Planes).ToString(), vectorType.ToString());
Microsoft.ML.IntegrationTests (3)
ModelFiles.cs (2)
235inputSchemaDefinition[nameof(ModelInput.CategoricalFeatures)].ColumnType = new VectorDataViewType(TextDataViewType.Instance, 5); 236inputSchemaDefinition[nameof(ModelInput.NumericalFeatures)].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 3);
SchemaDefinitionTests.cs (1)
76outputSchemaDefinition["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, (schema["Features"].Type as VectorDataViewType).Size * 2);
Microsoft.ML.KMeansClustering (6)
KMeansModelParameters.cs (6)
101_inputType = new VectorDataViewType(NumberDataViewType.Single, _dimensionality); 102_outputType = new VectorDataViewType(NumberDataViewType.Single, _k); 143_inputType = new VectorDataViewType(NumberDataViewType.Single, _dimensionality); 144_outputType = new VectorDataViewType(NumberDataViewType.Single, _k); 337var nameX2 = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, 1), "X2"); 343var dataViewType = new VectorDataViewType(NumberDataViewType.Single, _centroids.Length);
Microsoft.ML.Mkl.Components (1)
VectorWhitening.cs (1)
591DataViewType outType = (info.Kind == WhiteningKind.PrincipalComponentAnalysis && info.Rank > 0) ? new VectorDataViewType(NumberDataViewType.Single, info.Rank) : _srcTypes[iinfo];
Microsoft.ML.OnnxTransformer (4)
OnnxTypeParser.cs (2)
239return new VectorDataViewType((PrimitiveDataViewType)GetScalarDataViewType(typeProto.TensorType.ElemType), shape.ToArray()); 242return new VectorDataViewType((PrimitiveDataViewType)GetScalarDataViewType(typeProto.TensorType.ElemType), 0);
OnnxUtils.cs (2)
327dataViewType = new VectorDataViewType(vectorType.ItemType, shapeDictionary[name]); 329dataViewType = new VectorDataViewType(vectorType.ItemType);
Microsoft.ML.Parquet (1)
ParquetLoader.cs (1)
353return new VectorDataViewType(NumberDataViewType.Byte);
Microsoft.ML.PCA (5)
PcaTrainer.cs (2)
472_inputType = new VectorDataViewType(NumberDataViewType.Single, _dimension); 516_inputType = new VectorDataViewType(NumberDataViewType.Single, _dimension);
PcaTransformer.cs (3)
106public DataViewType OutputType => new VectorDataViewType(NumberDataViewType.Single, Rank); 556new VectorDataViewType(NumberDataViewType.Single, _parent._transformInfos[i].Dimension).ToString(), colSchemaInfo.InputType.ToString()); 638new VectorDataViewType(NumberDataViewType.Single, transformInfo.Dimension);
Microsoft.ML.PerformanceTests (1)
HashBench.cs (1)
130InitMapMurmurHashV2(vbuf, new VectorDataViewType(itemType, vals.Length), numberOfBits, vbuf.CopyTo);
Microsoft.ML.Samples (1)
Dynamic\DataOperations\LoadFromEnumerable.cs (1)
77definedSchema[0].ColumnType = new VectorDataViewType(vectorItemType,
Microsoft.ML.StandardTrainers (35)
LdSvm\LdSvmModelParameters.cs (2)
84InputType = new VectorDataViewType(NumberDataViewType.Single, _w[0].Length); 121InputType = new VectorDataViewType(NumberDataViewType.Single, numFeatures);
Standard\LinearModelParameters.cs (3)
128_inputType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 202_inputType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 380var colType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (6)
478InputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfFeatures); 479OutputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfClasses); 523InputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfFeatures); 524OutputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfClasses); 605InputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfFeatures); 606OutputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfClasses);
Standard\ModelStatistics.cs (1)
581var colType = new VectorDataViewType(NumberDataViewType.Single, stdErr.Length);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (12)
304_inputType = new VectorDataViewType(NumberDataViewType.Single, _featureCount); 305_outputType = new VectorDataViewType(NumberDataViewType.Single, _labelCount); 351_inputType = new VectorDataViewType(NumberDataViewType.Single, _featureCount); 352_outputType = new VectorDataViewType(NumberDataViewType.Single, _labelCount); 450var typeOne = new VectorDataViewType(NumberDataViewType.Single, 1); 451var typeFea = new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length); 452var typeLabelByFea = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, _featureHistogram[0].Length); 453var typeLabelByOne = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, 1); 455var greaterOutput = ctx.AddIntermediateVariable(new VectorDataViewType(BooleanDataViewType.Instance, _featureHistogram[0].Length), "greaterOutput"); 466var isFeaturePresent = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, 1, _featureHistogram[0].Length), "isFeaturePresent"); 549var scoreIndex = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Int64, 1), "ScoreIndex"); 576var logOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length), "LogOutput");
Standard\MulticlassClassification\OneVersusAllTrainer.cs (5)
363DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length); 395DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length); 668var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length); 835var type = new VectorDataViewType(NumberDataViewType.Single, divOutputs.Length); 924var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length);
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (2)
283_outputType = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 311_outputType = new VectorDataViewType(NumberDataViewType.Single, _numClasses);
Standard\Simple\SimpleTrainers.cs (4)
81_inputType = new VectorDataViewType(NumberDataViewType.Single); 98_inputType = new VectorDataViewType(NumberDataViewType.Single); 366_inputType = new VectorDataViewType(NumberDataViewType.Single); 380_inputType = new VectorDataViewType(NumberDataViewType.Single);
Microsoft.ML.TensorFlow (5)
TensorflowTransform.cs (1)
421outputTypes[i] = new VectorDataViewType(type, dims);
TensorflowUtils.cs (4)
75metadataBuilder.Add(TensorflowUpstreamOperatorsKind, new VectorDataViewType(TextDataViewType.Instance, op.NumInputs), 90DataViewType columnType = new VectorDataViewType(mlType); 99columnType = new VectorDataViewType(mlType, tensorShape[0] > 0 ? tensorShape : tensorShape.Skip(1).ToArray()); 109columnType = new VectorDataViewType(mlType, tensorShape);
Microsoft.ML.TensorFlow.Tests (2)
TensorFlowEstimatorTests.cs (2)
215Assert.Equal(new VectorDataViewType(NumberDataViewType.Single, 0, 10), schema["Output"].Type); 229Assert.Equal(new VectorDataViewType(NumberDataViewType.Single, 10), schema["Output"].Type);
Microsoft.ML.Tests (15)
FakeSchemaTest.cs (1)
26schemaBuilder.AddColumn("A", new VectorDataViewType(NumberDataViewType.Single, 94));
Scenarios\Api\TestApi.cs (3)
211var coltypeStringArray = new VectorDataViewType(coltypeString, valueStringArray.Length); 214var coltypeFloatArray = new VectorDataViewType(coltypeFloat, valueFloatArray.Length); 217var coltypeVBuffer = new VectorDataViewType(coltypeFloat, valueVBuffer.Length);
SvmLightTests.cs (9)
75schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 5); 104schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 5); 132schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 6); 160schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 3); 163new VectorDataViewType(TextDataViewType.Instance, 3)); 211schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 1); 305schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 6); 462schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 6); 489schemaDef["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, 6);
Transformers\HashTests.cs (2)
166builder.Add("Foo", new VectorDataViewType(type, vecLen), (ref VBuffer<T> dst) => denseVec.CopyTo(ref dst)); 197builder.Add("Foo", new VectorDataViewType(type, vecLen), (ref VBuffer<T> dst) => sparseVec.CopyTo(ref dst));
Microsoft.ML.TimeSeries (10)
SequentialAnomalyDetectionTransformBase.cs (2)
171: base(Contracts.CheckRef(env, nameof(env)).Register(name), windowSize, initialWindowSize, outputColumnName, inputColumnName, new VectorDataViewType(NumberDataViewType.Double, GetOutputLength(alertingScore, env))) 336info[0] = new DataViewSchema.DetachedColumn(_parent.OutputColumnName, new VectorDataViewType(NumberDataViewType.Double, _parent.OutputLength), meta.ToAnnotations());
SequentialForecastingTransformBase.cs (5)
64confidenceUpperBoundColumn, inputColumnName, new VectorDataViewType(NumberDataViewType.Single, outputLength)) 133info[0] = new DetachedColumn(_parent.OutputColumnName, new VectorDataViewType(NumberDataViewType.Single, _parent._outputLength)); 134info[1] = new DetachedColumn(_parent.ConfidenceLowerBoundColumn, new VectorDataViewType(NumberDataViewType.Single, _parent._outputLength)); 135info[2] = new DetachedColumn(_parent.ConfidenceUpperBoundColumn, new VectorDataViewType(NumberDataViewType.Single, _parent._outputLength)); 140info[0] = new DetachedColumn(_parent.OutputColumnName, new VectorDataViewType(NumberDataViewType.Single, _parent._outputLength));
SrCnnEntireAnomalyDetector.cs (1)
200_bindings = new Bindings(input.Schema, inputColumnName, outputColumnName, new VectorDataViewType(NumberDataViewType.Double, _outputLength));
SrCnnTransformBase.cs (2)
71: base(Contracts.CheckRef(env, nameof(env)).Register(name), windowSize, initialWindowSize, outputColumnName, inputColumnName, new VectorDataViewType(NumberDataViewType.Double, 3)) 179info[0] = new DataViewSchema.DetachedColumn(_parent.OutputColumnName, new VectorDataViewType(NumberDataViewType.Double, _parent.OutputLength), meta.ToAnnotations());
Microsoft.ML.TorchSharp (9)
AutoFormerV2\ObjectDetectionTrainer.cs (5)
484new VectorDataViewType(new KeyDataViewType(typeof(uint), uint.MaxValue)).ToString(), labelCol.GetTypeString()); 490new VectorDataViewType(NumberDataViewType.Single).ToString(), boundingBoxCol.GetTypeString()); 767info[0] = new DataViewSchema.DetachedColumn(_parent.Options.PredictedLabelColumnName, new VectorDataViewType(new KeyDataViewType(typeof(uint), _parent.Options.NumberOfClasses)), labelBuilder.ToAnnotations()); 769info[1] = new DataViewSchema.DetachedColumn(_parent.Options.ScoreColumnName, new VectorDataViewType(NumberDataViewType.Single), meta.ToAnnotations()); 771info[2] = new DataViewSchema.DetachedColumn(_parent.Options.PredictedBoundingBoxColumnName, new VectorDataViewType(NumberDataViewType.Single));
NasBert\NasBertTrainer.cs (2)
536info[1] = new DataViewSchema.DetachedColumn(Parent.Options.ScoreColumnName, new VectorDataViewType(NumberDataViewType.Single, Parent.Options.NumberOfClasses), meta.ToAnnotations()); 548info[0] = new DataViewSchema.DetachedColumn(Parent.Options.PredictionColumnName, new VectorDataViewType(new KeyDataViewType(typeof(uint), Parent.Options.NumberOfClasses - 1)), labelBuilder.ToAnnotations());
Roberta\QATrainer.cs (2)
746info[0] = new DataViewSchema.DetachedColumn(_parent.Options.PredictedAnswerColumnName, new VectorDataViewType(TextDataViewType.Instance)); 748info[1] = new DataViewSchema.DetachedColumn(_parent.Options.ScoreColumnName, new VectorDataViewType(NumberDataViewType.Single), meta.ToAnnotations());
Microsoft.ML.TorchSharp.Tests (2)
QATests.cs (2)
58Assert.Equal(new VectorDataViewType(TextDataViewType.Instance), transformerSchema[4].Type); 59Assert.Equal(new VectorDataViewType(NumberDataViewType.Single), transformerSchema[5].Type);
Microsoft.ML.Transforms (31)
GroupTransform.cs (1)
298var aggregatedResultType = new VectorDataViewType(aggregatedValueType);
HashJoiningTransform.cs (2)
140OutputColumnType = new VectorDataViewType(itemType, SlotMap.Length); 403new VectorDataViewType(TextDataViewType.Instance, ex.SlotMap.Length), GetSlotNames);
KeyToVectorMapping.cs (4)
182_types[i] = new VectorDataViewType(NumberDataViewType.Single, _bitsPerKey[i]); 185_types[i] = new VectorDataViewType(NumberDataViewType.Single, srcValueCount, _bitsPerKey[i]); 244var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 262var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions);
MissingValueDroppingTransformer.cs (1)
201_types[i] = new VectorDataViewType((PrimitiveDataViewType)srcCol.Type.GetItemType());
MissingValueIndicatorTransform.cs (2)
142types[iinfo] = new VectorDataViewType(NumberDataViewType.Single, 2); 145types[iinfo] = new VectorDataViewType(NumberDataViewType.Single, vectorType.Dimensions.Add(2));
MissingValueIndicatorTransformer.cs (2)
197outType = new VectorDataViewType(BooleanDataViewType.Instance, vectorType.Dimensions); 548new VectorDataViewType(BooleanDataViewType.Instance, vectorType.Dimensions);
MissingValueReplacing.cs (3)
295type = new VectorDataViewType(vectorType.ItemType, vectorType.Dimensions); 569vectorType = new VectorDataViewType(vectorType.ItemType, vectorType.Dimensions); 1052new VectorDataViewType(vectorType.ItemType, vectorType.Dimensions);
RandomFourierFeaturizing.cs (2)
250new VectorDataViewType(NumberDataViewType.Single, _transformInfos[col].SrcDim).ToString(), type.ToString()); 489_types[i] = new VectorDataViewType(NumberDataViewType.Single, _parent._transformInfos[i].RotationTerms == null ?
SvmLight\SvmLightLoader.cs (1)
722schemaDef[0].ColumnType = new VectorDataViewType(NumberDataViewType.Single, keyCount);
Text\LdaTransform.cs (1)
591result[i] = new DataViewSchema.DetachedColumn(_parent.ColumnPairs[i].outputColumnName, new VectorDataViewType(NumberDataViewType.Single, info.NumberOfTopics), null);
Text\NgramHashingTransformer.cs (2)
407_types[i] = new VectorDataViewType(NumberDataViewType.Single, 1 << _parent._columns[i].NumberOfBits); 852types[iinfo] = new VectorDataViewType(TextDataViewType.Instance, vec.Length);
Text\StopWordsRemovingTransformer.cs (3)
377_types[i] = new VectorDataViewType(TextDataViewType.Instance); 773private static readonly DataViewType _outputType = new VectorDataViewType(TextDataViewType.Instance); 1080_types[i] = new VectorDataViewType(TextDataViewType.Instance);
Text\TextNormalizing.cs (1)
212_types[i] = srcType is VectorDataViewType ? new VectorDataViewType(TextDataViewType.Instance) : srcType;
Text\TokenizingByCharacters.cs (2)
203_type = new VectorDataViewType(keyType); 240dataViewType = new VectorDataViewType(TextDataViewType.Instance, _sourceVectorLength[iinfo]);
Text\WordEmbeddingsExtractor.cs (2)
324_outputType = new VectorDataViewType(NumberDataViewType.Single, 3 * _parent._currentVocab.Dimension); 939throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName, new VectorDataViewType(TextDataViewType.Instance).ToString(), col.GetTypeString());
Text\WordTokenizing.cs (2)
212_type = new VectorDataViewType(TextDataViewType.Instance); 420var reshapeOutput = ctx.AddIntermediateVariable(new VectorDataViewType(TextDataViewType.Instance, 1), column.Name);
Microsoft.ML.Vision (4)
ImageClassificationTrainer.cs (4)
1385_inputType = new VectorDataViewType(NumberDataViewType.Byte); 1386_outputType = new VectorDataViewType(NumberDataViewType.Single, classCount); 1423_inputType = new VectorDataViewType(NumberDataViewType.Byte); 1424_outputType = new VectorDataViewType(NumberDataViewType.Single, _classCount);
689 references to VectorDataViewType
Microsoft.Data.Analysis (3)
DataFrameColumns\VBufferDataFrameColumn.cs (1)
313private static VectorDataViewType GetDataViewType()
IDataView.Extension.cs (2)
119else if (type is VectorDataViewType vectorType) 151private static DataFrameColumn GetVectorDataFrame(VectorDataViewType vectorType, string name)
Microsoft.ML.AutoML (2)
API\AutoCatalog.cs (1)
824&& !(data.Schema[c.ColumnIndex].Type is VectorDataViewType vt && vt.ItemType == BooleanDataViewType.Instance)).ToArray();
Utils\ColumnTypeExtensions.cs (1)
28return columnType is VectorDataViewType;
Microsoft.ML.Core (11)
Data\AnnotationUtils.cs (4)
142public static VectorDataViewType GetNamesType(int size) 154public static VectorDataViewType GetCategoricalType(int rangeCount) 293&& metaColumn.Value.Type is VectorDataViewType vectorType 385if (!(schema[colIndex].Type is VectorDataViewType vecType && vecType.Size > 0))
Data\ColumnTypeExtensions.cs (5)
45public static DataViewType GetItemType(this DataViewType columnType) => (columnType as VectorDataViewType)?.ItemType ?? columnType; 50public static int GetVectorSize(this DataViewType columnType) => (columnType as VectorDataViewType)?.Size ?? 0; 56public static int GetValueCount(this DataViewType columnType) => (columnType as VectorDataViewType)?.Size ?? 1; 88if (!(columnType is VectorDataViewType vectorType) || !(other is VectorDataViewType otherVectorType))
Data\IEstimator.cs (2)
67Contracts.CheckParam(!(itemType is VectorDataViewType), nameof(itemType), "Item type cannot be a vector"); 150if (type is VectorDataViewType vectorType)
Microsoft.ML.Core.Tests (10)
UnitTests\ColumnTypes.cs (2)
25VectorDataViewType tmp1; 26VectorDataViewType tmp2;
UnitTests\CoreBaseTestClass.cs (1)
85if (type is VectorDataViewType vecType)
UnitTests\ScoreSchemaTest.cs (3)
66Assert.True(scoreMetadata.Schema[0].Type is VectorDataViewType); 67Assert.Equal(keyNames.Length, (scoreMetadata.Schema[0].Type as VectorDataViewType).Size); 68Assert.Equal(TextDataViewType.Instance, (scoreMetadata.Schema[0].Type as VectorDataViewType).ItemType);
UnitTests\TestEntryPoints.cs (2)
5407Assert.True(type is VectorDataViewType vecType && vecType.ItemType is TextDataViewType && vecType.Size == 10); 6576Assert.Equal(10, (schema[2].Type as VectorDataViewType)?.Size);
UnitTests\TestModelLoad.cs (2)
54Assert.Equal(9, (result.Schema[1].Type as VectorDataViewType)?.Size); 55Assert.Equal(18, (result.Schema[2].Type as VectorDataViewType)?.Size);
Microsoft.ML.Data (356)
Commands\ShowSchemaCommand.cs (7)
141var slotType = transposeDataView?.GetSlotType(col); 197if (!(type is VectorDataViewType vectorType)) 214Contracts.Assert(!(type is VectorDataViewType)); 234Contracts.Assert(!(type is VectorDataViewType)); 247private static void ShowMetadataValueVec(IndentedTextWriter itw, DataViewSchema schema, int col, string kind, VectorDataViewType type) 261Action<IndentedTextWriter, DataViewSchema, int, string, VectorDataViewType> del = ShowMetadataValueVec<int>; 266private static void ShowMetadataValueVec<T>(IndentedTextWriter itw, DataViewSchema schema, int col, string kind, VectorDataViewType type)
Data\Conversion.cs (3)
623Contracts.CheckParam(!(type is VectorDataViewType), nameof(type)); 662Contracts.CheckParam(!(type is VectorDataViewType), nameof(type)); 681public InPredicate<VBuffer<T>> GetHasMissingPredicate<T>(VectorDataViewType type)
Data\DataViewUtils.cs (3)
215=> type != null && (type is PrimitiveDataViewType || type is VectorDataViewType); 867if (type is VectorDataViewType vectorType) 1339if (colType is VectorDataViewType vectorType)
Data\ITransposeDataView.cs (3)
37/// <see cref="GetSlotType"/> with col=i may return a <see cref="VectorDataViewType"/> whose <see cref="VectorDataViewType.ItemType"/> 41VectorDataViewType GetSlotType(int col);
Data\RowCursorUtils.cs (9)
160var typeSrc = row.Schema[col].Type as VectorDataViewType; 163Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<VBuffer<int>>> del = GetVecGetterAsCore<int, int>; 180var typeSrc = row.Schema[col].Type as VectorDataViewType; 183Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<VBuffer<TDst>>> del = GetVecGetterAsCore<int, TDst>; 198var typeSrc = cursor.GetSlotType(); 200Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<VBuffer<TDst>>> del = GetVecGetterAsCore<int, TDst>; 255private static ValueGetter<VBuffer<TDst>> GetVecGetterAsCore<TSrc, TDst>(VectorDataViewType typeSrc, PrimitiveDataViewType typeDst, GetterFactory getterFact)
Data\SchemaAnnotationsExtensions.cs (11)
15/// Returns <see langword="true"/> if the input column is of <see cref="VectorDataViewType"/>, and that has 16/// <c>SlotNames</c> annotation of a <see cref="VectorDataViewType"/> whose <see cref="VectorDataViewType.ItemType"/> 17/// is of <see cref="TextDataViewType"/>, and further whose <see cref="VectorDataViewType.Size"/> matches 23=> column.Type is VectorDataViewType vectorType 38/// Returns <see langword="true"/> if the input column is of <see cref="VectorDataViewType"/>, and that has 39/// <c>SlotNames</c> annotation of a <see cref="VectorDataViewType"/> whose <see cref="VectorDataViewType.ItemType"/> 40/// is of <see cref="TextDataViewType"/>, and further whose <see cref="VectorDataViewType.Size"/> matches 60&& metaColumn.Value.Type is VectorDataViewType vectorType 67/// key values are of <see cref="VectorDataViewType.ItemType"/> whose <see cref="DataViewType.RawType"/> matches
Data\SchemaDefinition.cs (1)
54/// Allows a member to be marked as a <see cref="VectorDataViewType"/>, primarily allowing one to set
Data\SlotCursor.cs (1)
53public abstract VectorDataViewType GetSlotType();
DataLoadSave\Binary\BinaryLoader.cs (1)
507if (type is VectorDataViewType)
DataLoadSave\Binary\CodecFactory.cs (1)
105if (type is VectorDataViewType vectorType)
DataLoadSave\Binary\Codecs.cs (4)
776private readonly VectorDataViewType _type; 786public VBufferCodec(CodecFactory factory, VectorDataViewType type, IValueCodec<T> innerCodec) 1131VectorDataViewType type; 1156private bool GetVBufferCodec(VectorDataViewType type, out IValueCodec codec)
DataLoadSave\FakeSchema.cs (1)
36if (metaColumnType is VectorDataViewType vectorType)
DataLoadSave\LegacyCompositeDataLoader.cs (1)
601VectorDataViewType ITransposeDataView.GetSlotType(int col) => _tview?.GetSlotType(col);
DataLoadSave\Text\TextLoaderParser.cs (5)
705VectorDataViewType vectorType = info.ColType as VectorDataViewType; 1380if (!(info.ColType is VectorDataViewType)) 1390Contracts.Assert(info.ColType is VectorDataViewType); 1459Contracts.Assert(!(info.ColType is VectorDataViewType));
DataLoadSave\Text\TextSaver.cs (10)
66if (type is VectorDataViewType vectorType) 161public VecValueWriter(DataViewRowCursor cursor, VectorDataViewType type, int source, char sep) 165VectorDataViewType typeNames; 167&& (typeNames = cursor.Schema[source].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType) != null 415if (!(type is VectorDataViewType vectorType)) 422var typeNames = data.Schema[cols[i]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 487if (type is VectorDataViewType vectorType && !vectorType.IsKnownSize && i != pipes.Length - 1) 502VectorDataViewType vectorType = type as VectorDataViewType;
DataLoadSave\Transpose\TransposeLoader.cs (9)
298VectorDataViewType vectorType = ttype as VectorDataViewType; 611VectorDataViewType ITransposeDataView.GetSlotType(int col) 614return view.Schema[0].Type as VectorDataViewType; 683Ch.Assert(cursor.Schema[0].Type is VectorDataViewType); 689public override VectorDataViewType GetSlotType() 690=> (VectorDataViewType)_rowCursor.Schema[0].Type; 802if (type is VectorDataViewType vectorType) 834Ch.Assert(type is VectorDataViewType);
DataLoadSave\Transpose\TransposeSaver.cs (3)
69if (type is VectorDataViewType vectorType && !vectorType.IsKnownSize) 78var newVectorType = new VectorDataViewType(primitiveType, size: 2); 114var slotType = data.GetSlotType(cols[0]);
DataView\CacheDataView.cs (2)
1289if (type is VectorDataViewType vectorType) 1351Ctx.Assert(type is VectorDataViewType);
DataView\DataViewConstructionUtils.cs (7)
242VectorDataViewType vectorType = colType as VectorDataViewType; 260else if (colType is VectorDataViewType vectorType) 892VectorDataViewType annotationVectorType = annotationType as VectorDataViewType; 917Contracts.Assert(AnnotationType is VectorDataViewType); 936if (AnnotationType is VectorDataViewType annotationVectorType)
DataView\InternalSchemaDefinition.cs (3)
123Contracts.Assert(isVector == ColumnType is VectorDataViewType); 275VectorDataViewType columnVectorType = col.ColumnType as VectorDataViewType;
DataView\Transposer.cs (9)
142if (type is VectorDataViewType vectorType && !vectorType.IsKnownSize) 255if (_view.Schema[col].Type is VectorDataViewType) 260VectorDataViewType ITransposeDataView.GetSlotType(int col) 271else if (transposedColumn.Type is VectorDataViewType vectorDataViewType) 325public override VectorDataViewType GetSlotType() 1074private readonly VectorDataViewType[] _types; 1094var type = _view.Schema[SrcCol].Type as VectorDataViewType; 1104_types = new VectorDataViewType[_lims.Length];
DataView\TypedCursor.cs (5)
131if (_columns[i].ColumnType is VectorDataViewType) 145return colType is VectorDataViewType vectorType && vectorType.ItemType.RawType == itemType; 147return !(colType is VectorDataViewType) && colType.RawType == itemType; 364Ch.Assert(colType is VectorDataViewType); 380else if (colType is VectorDataViewType vectorType)
Deprecated\Instances\HeaderSchema.cs (2)
21private readonly VectorDataViewType _colType; 22private readonly VectorDataViewType _slotNamesType;
Evaluators\BinaryClassifierEvaluator.cs (1)
178labelCol.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type is VectorDataViewType vecType &&
Evaluators\ClusteringEvaluator.cs (6)
108if (!(type is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 118if (!(t is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 139var scoreType = score.Type as VectorDataViewType; 724var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _numClusters); 756if (!(type is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single)
Evaluators\EvaluatorUtils.cs (24)
309else if (type is VectorDataViewType vectorType 353var slotNamesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 547var typeDst = new VectorDataViewType(itemType, slotNames.Count); 570VectorDataViewType vectorType = type as VectorDataViewType; 574DataViewType keyValueItemType = (keyValueType as VectorDataViewType)?.ItemType ?? keyValueType; 734type, new VectorDataViewType(keyType, ((VectorDataViewType)type).Dimensions), mapper, keyValueGetter, slotNamesGetter); 836if (type is VectorDataViewType vectorType) 930var vectorType = idv.Schema[index].Type as VectorDataViewType; 955VectorDataViewType type, in VBuffer<ReadOnlyMemory<char>> firstDvSlotNames) 984private static IDataView AddVarLengthColumn<TSrc>(IHostEnvironment env, IDataView idv, string variableSizeVectorColumnName, VectorDataViewType typeSrc) 1017else if (type is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Double) 1027var slotNamesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 1236var keyValuesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 1280else if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Double) 1296AggregatedMetric[] agg, bool hasStdev, int numFolds, int iMetric, int i, VectorDataViewType type, string columnName) 1392var type = countColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 1478var type = cursor.Schema[countIndex].Type as VectorDataViewType;
Evaluators\MulticlassClassificationEvaluator.cs (6)
78var scoreType = score.Type as VectorDataViewType; 101var mdType = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 860var scoreType = schema[ScoreIndex].Type as VectorDataViewType;
Evaluators\MultiOutputRegressionEvaluator.cs (13)
61var t = score.Type as VectorDataViewType; 65t = schema.Label.Value.Type as VectorDataViewType; 398private readonly VectorDataViewType _labelType; 399private readonly VectorDataViewType _scoreType; 543private void CheckInputColumnTypes(DataViewSchema schema, out VectorDataViewType labelType, out VectorDataViewType scoreType, 549var t = schema[LabelIndex].Type as VectorDataViewType; 553var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, t.Size); 558t = schema[ScoreIndex].Type as VectorDataViewType; 707var type = fold.Schema[i].Type as VectorDataViewType;
Evaluators\QuantileRegressionEvaluator.cs (12)
47var type = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 59var t = score.Type as VectorDataViewType; 71var scoreType = scoreInfo.Type as VectorDataViewType; 74var slotNamesType = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 355var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _scoreSize); 451VectorDataViewType scoreType = schema[ScoreIndex].Type as VectorDataViewType; 517if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Double)
Model\Pfa\PfaUtils.cs (1)
161if (type is VectorDataViewType vectorType)
Scorers\BinaryClassifierScorer.cs (5)
67var keyType = trainSchema.Label.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 102return labelNameType is VectorDataViewType vectorType && vectorType.Size == 2; 115var type = labelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Scorers\ClusteringScorer.cs (1)
142return scoreType is VectorDataViewType vectorType
Scorers\FeatureContributionCalculation.cs (2)
344var featureContributionType = new VectorDataViewType(NumberDataViewType.Single, ((VectorDataViewType)FeatureColumn.Type).Dimensions);
Scorers\MulticlassClassificationScorer.cs (17)
76private readonly VectorDataViewType _type; 89public VectorDataViewType Type => _type; 107private LabelNameBindableMapper(IHostEnvironment env, ISchemaBoundMapper mapper, VectorDataViewType type, Delegate getter, 113private LabelNameBindableMapper(IHostEnvironment env, ISchemaBindableMapper bindable, VectorDataViewType type, Delegate getter, 142_type = type as VectorDataViewType; 238internal static ISchemaBoundMapper CreateBound<T>(IHostEnvironment env, ISchemaBoundRowMapper mapper, VectorDataViewType type, Delegate getter, 257private readonly VectorDataViewType _labelNameType; 282public Bound(IHostEnvironment env, ISchemaBoundRowMapper mapper, VectorDataViewType type, ValueGetter<VBuffer<T>> getter, 311private DataViewSchema DecorateOutputSchema(DataViewSchema partialSchema, int scoreColumnIndex, VectorDataViewType labelNameType, 417var keyType = trainSchema.Label.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 441return labelNameType is VectorDataViewType vectorType && vectorType.Size == scoreType.GetVectorSize(); 481return labelNameType is VectorDataViewType vectorType && vectorType.Size == scoreType.GetVectorSize() && vectorType.ItemType == TextDataViewType.Instance; 495env.Assert(type is VectorDataViewType); 505resultMapper = LabelNameBindableMapper.CreateBound<T>(env, (ISchemaBoundRowMapper)resultMapper, type as VectorDataViewType, getter, AnnotationUtils.Kinds.TrainingLabelValues, CanWrapTrainingLabels); 507resultMapper = LabelNameBindableMapper.CreateBound<T>(env, (ISchemaBoundRowMapper)resultMapper, type as VectorDataViewType, getter, AnnotationUtils.Kinds.SlotNames, CanWrapSlotNames); 606scoreType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Single;
Scorers\PredictedLabelScorerBase.cs (1)
69if (trainLabelColumn?.Type is VectorDataViewType trainLabelColVecType && (ulong)trainLabelColVecType.Size == predColKeyType.Count)
Scorers\SchemaBindablePredictorWrapper.cs (10)
133VectorDataViewType typeVectorType = type as VectorDataViewType; 134VectorDataViewType typeInVectorType = typeIn as VectorDataViewType; 486Contracts.Check(distMapper.InputType is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Single, 529Contracts.Check(typeSrc is VectorDataViewType vectorType 649Contracts.CheckParam(ValueMapper != null && ValueMapper.InputType is VectorDataViewType vectorType 668Contracts.CheckDecode(ValueMapper != null && ValueMapper.InputType is VectorDataViewType vectorType 704var typeSrc = column.Type as VectorDataViewType;
Training\TrainerUtils.cs (4)
57if (!(col.Type is VectorDataViewType vecType && vecType.Size > 0 && vecType.ItemType == NumberDataViewType.Single)) 73var colType = col.Type as VectorDataViewType; 193if (!(col.Type is VectorDataViewType vectorType
Transforms\ColumnConcatenatingTransformer.cs (16)
471VectorDataViewType curVectorType = curType as VectorDataViewType; 535public readonly VectorDataViewType OutputType; 543private readonly VectorDataViewType _slotNamesType; 548public BoundColumn(DataViewSchema inputSchema, ColumnOptions columnOptions, int[] sources, VectorDataViewType outputType, 559_isIdentity = SrcIndices.Length == 1 && _inputSchema[SrcIndices[0]].Type is VectorDataViewType; 639if (!(typeSrc is VectorDataViewType vectorTypeSrc)) 646VectorDataViewType typeNames = null; 650typeNames = inputMetadata.Schema[idx].Type as VectorDataViewType; 698if (_srcTypes[j] is VectorDataViewType) 713if (type is VectorDataViewType vectorType) 742if (_srcTypes[j] is VectorDataViewType) 789if (_srcTypes[j] is VectorDataViewType) 914var outColType = boundCol.OutputType; 938var vectorizerOutputType = new VectorDataViewType(NumberDataViewType.Single, outVectorSize); 945var dstVectorType = new VectorDataViewType(outColType.GetItemType() as PrimitiveDataViewType, outVectorSize);
Transforms\FeatureContributionCalculationTransformer.cs (2)
173private readonly VectorDataViewType _featureColumnType; 183_featureColumnType = schema[_featureColumnIndex].Type as VectorDataViewType;
Transforms\Hashing.cs (12)
145private readonly VectorDataViewType[] _kvTypes; 167if (srcType is VectorDataViewType vectorType && !column.Combine) 249_kvTypes = new VectorDataViewType[_columns.Length]; 268if (!(srcType is VectorDataViewType vectorType)) 402private ValueGetter<VBuffer<uint>> ComposeGetterVec(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType) 449private ValueGetter<VBuffer<uint>> ComposeGetterVecCore<T, THash>(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType) 464private ValueGetter<uint> ComposeGetterCombined(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType) 1412if (_srcTypes[iinfo] is VectorDataViewType) 1430var vectorShape = new VectorDataViewType(NumberDataViewType.Int64, _srcTypes[iinfo].GetValueCount()); 1496_includeSlot = _srcType is VectorDataViewType && _ex.UseOrderedHashing; 1512VectorDataViewType vectorTypeSrc = typeSrc as VectorDataViewType;
Transforms\InvertHashUtils.cs (6)
360if (!(codec.Type is VectorDataViewType vectorType)) 395VectorDataViewType vectorType = (VectorDataViewType)codec.Type; 444public static void LoadAll(IHost host, ModelLoadContext ctx, int infoLim, out VBuffer<ReadOnlyMemory<char>>[] keyValues, out VectorDataViewType[] kvTypes) 453VectorDataViewType[] kvTypesLocal = null; 465kvTypesLocal = new VectorDataViewType[infoLim];
Transforms\KeyToValue.cs (3)
235if (!(typeSrc is VectorDataViewType vectorType)) 367if (!(Parent._types[InfoIndex] is VectorDataViewType)) 489if (srcType is VectorDataViewType)
Transforms\KeyToVector.cs (19)
241private readonly VectorDataViewType[] _types; 248_types = new VectorDataViewType[_parent.ColumnPairs.Length]; 311VectorDataViewType typeNames = null; 315typeNames = keyValuesColumn.Value.Type as VectorDataViewType; 327var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 339var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 367var typeSrc = _infos[iinfo].TypeSrc as VectorDataViewType; 379var typeSlotSrc = inputMetadata.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 456if (!(info.TypeSrc is VectorDataViewType)) 504VectorDataViewType srcVectorType = info.TypeSrc as VectorDataViewType; 550VectorDataViewType srcVectorType = info.TypeSrc as VectorDataViewType; 673if (!(srcType is VectorDataViewType srcVectorType)) 719var typeShape = new VectorDataViewType(NumberDataViewType.Single, dim, categoryRange); 721var encodedVariableName = (isOutputCountVector && info.TypeSrc is VectorDataViewType) ? 727if (_parent._columns[iinfo].OutputCountVector && info.TypeSrc is VectorDataViewType)
Transforms\LabelConvertTransform.cs (6)
68private VectorDataViewType _slotType; 183protected override VectorDataViewType GetSlotTypeCore(int iinfo) 186var srcSlotType = Infos[iinfo].SlotTypeSrc; 208private readonly VectorDataViewType _type; 210public SlotCursorImpl(IChannelProvider provider, SlotCursor cursor, VectorDataViewType typeDst) 218public override VectorDataViewType GetSlotType()
Transforms\NAFilter.cs (5)
190var itemType = (type as VectorDataViewType)?.ItemType ?? type; 278if (info.Type is VectorDataViewType vecType) 296Contracts.Assert(!(info.Type is VectorDataViewType)); 308Contracts.Assert(info.Type is VectorDataViewType); 312var hasBad = Data.Conversion.Conversions.DefaultInstance.GetHasMissingPredicate<T>((VectorDataViewType)info.Type);
Transforms\NormalizeColumn.cs (12)
200if (type is VectorDataViewType vectorType) 440else if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 559else if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 695if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 990if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1029if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1070if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1110if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1169if (srcType is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 1221if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1224return Sng.RobustScalerVecFunctionBuilder.Create(column, host, srcType as VectorDataViewType, column.CenterData, column.QuantileMin, column.QuantileMax, cursor.GetGetter<VBuffer<float>>(srcColumn)); 1226return Dbl.RobustScalerVecFunctionBuilder.Create(column, host, srcType as VectorDataViewType, column.CenterData, column.QuantileMin, column.QuantileMax, cursor.GetGetter<VBuffer<double>>(srcColumn));
Transforms\NormalizeColumnDbl.cs (8)
729public static ImplVec Create(ModelLoadContext ctx, IHost host, VectorDataViewType typeSrc) 1055public static ImplVec Create(ModelLoadContext ctx, IHost host, VectorDataViewType typeSrc) 1258public static ImplVec Create(ModelLoadContext ctx, IHost host, VectorDataViewType typeSrc) 1601public static IColumnFunctionBuilder Create(NormalizingEstimator.MinMaxColumnOptions column, IHost host, VectorDataViewType srcType, 1746public static IColumnFunctionBuilder Create(NormalizingEstimator.MeanVarianceColumnOptions column, IHost host, VectorDataViewType srcType, 1754public static IColumnFunctionBuilder Create(NormalizingEstimator.LogMeanVarianceColumnOptions column, IHost host, VectorDataViewType srcType, 1916public static IColumnFunctionBuilder Create(NormalizingEstimator.BinningColumnOptions column, IHost host, VectorDataViewType srcType, 2153public static IColumnFunctionBuilder Create(NormalizingEstimator.RobustScalingColumnOptions column, IHost host, VectorDataViewType srcType,
Transforms\NormalizeColumnSng.cs (8)
886public static ImplVec Create(ModelLoadContext ctx, IHost host, VectorDataViewType typeSrc) 1215public static ImplVec Create(ModelLoadContext ctx, IHost host, VectorDataViewType typeSrc) 1419public static ImplVec Create(ModelLoadContext ctx, IHost host, VectorDataViewType typeSrc) 1764public static IColumnFunctionBuilder Create(NormalizingEstimator.MinMaxColumnOptions column, IHost host, VectorDataViewType srcType, 1909public static IColumnFunctionBuilder Create(NormalizingEstimator.MeanVarianceColumnOptions column, IHost host, VectorDataViewType srcType, 1917public static IColumnFunctionBuilder Create(NormalizingEstimator.LogMeanVarianceColumnOptions column, IHost host, VectorDataViewType srcType, 2079public static IColumnFunctionBuilder Create(NormalizingEstimator.BinningColumnOptions column, IHost host, VectorDataViewType srcType, 2315public static IColumnFunctionBuilder Create(NormalizingEstimator.RobustScalingColumnOptions column, IHost host, VectorDataViewType srcType,
Transforms\Normalizer.cs (5)
472VectorDataViewType vectorType = type as VectorDataViewType; 588env.Assert(!(srcTypes[i] is VectorDataViewType vectorType) || vectorType.IsKnownSize); 706VectorDataViewType vectorType = colType as VectorDataViewType;
Transforms\RowShufflingTransformer.cs (1)
379if (type is VectorDataViewType vectorType)
Transforms\SlotsDroppingTransformer.cs (12)
485VectorDataViewType srcVectorType = _srcTypes[i] as VectorDataViewType; 530if (!(typeSrc is VectorDataViewType vectorType)) 727if (!(typeSrc is VectorDataViewType)) 742Host.Assert(!(_srcTypes[iinfo] is VectorDataViewType)); 763VectorDataViewType vectorType = (VectorDataViewType)_srcTypes[iinfo]; 784VectorDataViewType vectorType = (VectorDataViewType)_srcTypes[iinfo]; 795if (typeDst is VectorDataViewType dstVector && dstVector.IsKnownSize && dstVector.Size == srcValueCount) 837if (_srcTypes[iinfo] is VectorDataViewType vectorType && vectorType.IsKnownSize) 841var type = new VectorDataViewType(vectorType.ItemType, Math.Max(dstLength, 1));
Transforms\TransformBase.cs (12)
278public readonly VectorDataViewType SlotTypeSrc; 280public ColInfo(string name, int colSrc, DataViewType typeSrc, VectorDataViewType slotTypeSrc) 307public VectorDataViewType GetSlotType(int col) 357var slotType = transposedInput?.GetSlotType(i); 358infos[i] = new ColInfo(names[i], colSrc, type, slotType as VectorDataViewType); 405var slotType = transposeInput?.GetSlotType(i); 406infos[i] = new ColInfo(dst, colSrc, type, slotType as VectorDataViewType); 655VectorDataViewType ITransposeDataView.GetSlotType(int col) => _bindings.GetSlotType(col); 668protected virtual VectorDataViewType GetSlotTypeCore(int iinfo) 941if (type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType) 955if (type is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Single) 963if (type is VectorDataViewType vectorType
Transforms\TypeConverting.cs (2)
428if (srcType is VectorDataViewType vectorType) 472if (!(_types[iinfo] is VectorDataViewType vectorType))
Transforms\ValueMapping.cs (9)
98if (Transformer.ValueColumnType is VectorDataViewType) 120if (Transformer.ValueColumnType is VectorDataViewType) 863if (!(ValueColumn.Type is VectorDataViewType)) 900if (ValueColumn.Type is VectorDataViewType vectorType) 912if (column.Type is VectorDataViewType) 1072if (type is VectorDataViewType vectorType) 1283if (_inputSchema[_columns[i].inputColumnName].Type is VectorDataViewType && _valueMap.ValueColumn.Type is VectorDataViewType) 1286if (_inputSchema[_columns[i].inputColumnName].Type is VectorDataViewType)
Transforms\ValueToKeyMappingTransformer.cs (5)
220VectorDataViewType vectorType = type as VectorDataViewType; 727if (type is VectorDataViewType vectorType) 961VectorDataViewType vectorType = info.TypeSrc as VectorDataViewType;
Transforms\ValueToKeyMappingTransformerImpl.cs (8)
45Contracts.Assert(type is VectorDataViewType || type is PrimitiveDataViewType); 296if (type is VectorDataViewType) 833_inputIsVector = info.TypeSrc is VectorDataViewType; 910Contracts.Assert(!(info.TypeSrc is VectorDataViewType)); 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;
Utilities\ColumnCursor.cs (1)
73if (!(colType is VectorDataViewType colVectorType))
Microsoft.ML.DataView (3)
DataViewType.cs (1)
59/// To take the most conspicuous example, <see cref="VectorDataViewType"/> is a structure type,
VBuffer.cs (1)
16/// <see cref="VectorDataViewType"/> instances. The explicitly defined values of this vector are exposed through
VectorType.cs (1)
125if (!(other is VectorDataViewType tmp))
Microsoft.ML.Ensemble (27)
OutputCombiners\BaseStacking.cs (1)
117if (!(ivm.InputType is VectorDataViewType vectorType) || vectorType.ItemType != NumberDataViewType.Single)
PipelineEnsemble.cs (4)
274private readonly VectorDataViewType _scoreType; 608var mdType = labelCol.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 645private static int CheckKeyLabelColumnCore<T>(IHostEnvironment env, PredictorModel[] models, KeyDataViewType labelType, DataViewSchema schema, int labelIndex, VectorDataViewType keyValuesType)
Trainer\EnsembleDistributionModelParameters.cs (6)
47private readonly VectorDataViewType _inputType; 82private VectorDataViewType InitializeMappers(out IValueMapperDist[] mappers) 87VectorDataViewType inputType = null; 91if (!IsValid(vmd, out VectorDataViewType vmdInputType)) 105private bool IsValid(IValueMapperDist mapper, out VectorDataViewType inputType) 108&& mapper.InputType is VectorDataViewType inVectorType && inVectorType.ItemType == NumberDataViewType.Single
Trainer\EnsembleModelParameters.cs (6)
44private readonly VectorDataViewType _inputType; 72private VectorDataViewType InitializeMappers(out IValueMapper[] mappers) 77VectorDataViewType inputType = null; 81if (!IsValid(vm, out VectorDataViewType vmInputType)) 96private bool IsValid(IValueMapper mapper, out VectorDataViewType inputType) 99&& mapper.InputType is VectorDataViewType inputVectorType && inputVectorType.ItemType == NumberDataViewType.Single
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (10)
36private readonly VectorDataViewType _inputType; 37private readonly VectorDataViewType _outputType; 63private void InitializeMappers(out IValueMapper[] mappers, out VectorDataViewType inputType, out VectorDataViewType outputType) 73if (!IsValid(vm, out VectorDataViewType vmInputType, out VectorDataViewType vmOutputType)) 155private bool IsValid(IValueMapper mapper, out VectorDataViewType inputType, out VectorDataViewType outputType) 158&& mapper.InputType is VectorDataViewType inVectorType && inVectorType.ItemType == NumberDataViewType.Single 159&& mapper.OutputType is VectorDataViewType outVectorType
Microsoft.ML.EntryPoints (4)
FeatureCombiner.cs (3)
123var type = col.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 168if (!(col.Type is VectorDataViewType vectorType) || vectorType.Size > 0)
PermutationFeatureImportance.cs (1)
324var type = ((VectorDataViewType)schema[metricName].ColumnType).ItemType;
Microsoft.ML.FastTree (4)
GamModelParameters.cs (1)
43private readonly VectorDataViewType _inputType;
TreeEnsembleFeaturizer.cs (3)
118var treeValueType = new VectorDataViewType(NumberDataViewType.Single, owner._ensemble.TrainedEnsemble.NumTrees); 121var leafIdType = new VectorDataViewType(NumberDataViewType.Single, owner._totalLeafCount); 129var pathIdType = new VectorDataViewType(NumberDataViewType.Single, owner._totalLeafCount - owner._ensemble.TrainedEnsemble.NumTrees);
Microsoft.ML.ImageAnalytics (7)
ExtensionsCatalog.cs (1)
80/// This column's data type will be <see cref="VectorDataViewType"/>.</param>
ImagePixelExtractor.cs (4)
282private readonly VectorDataViewType[] _types; 308var type = _types[iinfo]; 452private VectorDataViewType[] ConstructTypes() 454var types = new VectorDataViewType[_parent._columns.Length];
VectorToImageTransform.cs (2)
302var vectorType = inputSchema[srcCol].Type as VectorDataViewType;
Microsoft.ML.IntegrationTests (6)
IntrospectiveTraining.cs (2)
207var numFeatures = (transformedData.Schema["Features"].Type as VectorDataViewType).Size; 244var numFeatures = (transformedData.Schema["Features"].Type as VectorDataViewType).Size;
SchemaDefinitionTests.cs (4)
53Assert.Equal((engine1.OutputSchema["Features"].Type as VectorDataViewType).Size, prediction.Features.Length); 56Assert.Equal((engine2.OutputSchema["Features"].Type as VectorDataViewType).Size, prediction.Features.Length); 76outputSchemaDefinition["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, (schema["Features"].Type as VectorDataViewType).Size * 2); 91Assert.Equal(168, (schema["Features"].Type as VectorDataViewType).Size);
Microsoft.ML.KMeansClustering (1)
KMeansModelParameters.cs (1)
343var dataViewType = new VectorDataViewType(NumberDataViewType.Single, _centroids.Length);
Microsoft.ML.Mkl.Components (7)
OlsLinearRegression.cs (2)
166var typeFeat = examples.Schema.Feature.Value.Type as VectorDataViewType;
SymSgdClassificationTrainer.cs (1)
213ch.Check(examplesToFeedTrain.Schema.Feature.Value.Type is VectorDataViewType vecType && vecType.Size > 0, "Training set has no features, aborting training.");
VectorWhitening.cs (4)
222VectorDataViewType vectorType = type as VectorDataViewType; 310VectorDataViewType vectorType = srcTypes[i] as VectorDataViewType;
Microsoft.ML.OnnxConverter (4)
OnnxUtils.cs (3)
346if (type is VectorDataViewType vectorType) 373var vec = (VectorDataViewType)type;
SaveOnnxCommand.cs (1)
253metaColumn.Value.Type is VectorDataViewType vectorType &&
Microsoft.ML.OnnxTransformer (7)
OnnxTransform.cs (6)
538var vectorType = type as VectorDataViewType; 624if (_parent.Model.ModelInfo.OutputsInfo[_parent.MapDataViewColumnToOnnxOutputTensor(iinfo)].DataViewType is VectorDataViewType vectorType) 782var isVector = input.Schema[colIndex].Type is VectorDataViewType; 886var isKnownSize = (input.Schema[colIndex].Type as VectorDataViewType).IsKnownSize; 1078var expectedType = ((VectorDataViewType)inputNodeInfo.DataViewType).ItemType;
OnnxUtils.cs (1)
324if (dataViewType is VectorDataViewType vectorType)
Microsoft.ML.PCA (1)
PcaTransformer.cs (1)
511if (!(type is VectorDataViewType vectorType && vectorType.Size > 1 && vectorType.ItemType.Equals(NumberDataViewType.Single)))
Microsoft.ML.PerformanceTests (2)
HashBench.cs (2)
91if (type is VectorDataViewType) 108if (type is VectorDataViewType)
Microsoft.ML.Predictor.Tests (5)
TestTransposer.cs (5)
28var vecType = type as VectorDataViewType; 36if (type is VectorDataViewType) 71VectorDataViewType type = trans.GetSlotType(col); 80int valueCount = (colType as VectorDataViewType)?.Size ?? 1;
Microsoft.ML.Samples (9)
Dynamic\DataOperations\LoadFromEnumerable.cs (5)
40var featureColumn = data.Schema["Features"].Type as VectorDataViewType; 64.ColumnType as VectorDataViewType; 75var vectorItemType = ((VectorDataViewType)definedSchema[0].ColumnType) 84featureColumn = data2.Schema["Features"].Type as VectorDataViewType;
Dynamic\TensorFlow\TextClassification.cs (4)
66var featuresType = (VectorDataViewType)schema["Features"].Type; 70var predictionType = (VectorDataViewType)schema["Prediction/Softmax"]
Microsoft.ML.Samples.GPU (4)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (4)
66var featuresType = (VectorDataViewType)schema["Features"].Type; 70var predictionType = (VectorDataViewType)schema["Prediction/Softmax"]
Microsoft.ML.StandardTrainers (29)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
423if (!(col.Type is VectorDataViewType vectorType) ||
Standard\LinearModelParameters.cs (1)
380var colType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length);
Standard\LogisticRegression\LbfgsPredictorBase.cs (2)
487var typeFeat = data.Schema.Feature.Value.Type as VectorDataViewType;
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
183if (!(labelMetadataType is VectorDataViewType vecType && vecType.ItemType == TextDataViewType.Instance && vecType.Size == _numClasses))
Standard\ModelStatistics.cs (1)
581var colType = new VectorDataViewType(NumberDataViewType.Single, stdErr.Length);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (6)
248private readonly VectorDataViewType _inputType; 249private readonly VectorDataViewType _outputType; 450var typeOne = new VectorDataViewType(NumberDataViewType.Single, 1); 451var typeFea = new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length); 452var typeLabelByFea = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, _featureHistogram[0].Length); 453var typeLabelByOne = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, 1);
Standard\MulticlassClassification\OneVersusAllTrainer.cs (9)
513protected bool IsValid(IValueMapper mapper, ref VectorDataViewType inputType) 522if (!(mapper.InputType is VectorDataViewType mapperVectorType) || mapperVectorType.ItemType != NumberDataViewType.Single) 608VectorDataViewType inputType = null; 668var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length); 692VectorDataViewType inputType = null; 705private bool IsValid(IValueMapperDist mapper, ref VectorDataViewType inputType) 835var type = new VectorDataViewType(NumberDataViewType.Single, divOutputs.Length); 857VectorDataViewType inputType = null; 924var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length);
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (6)
257private readonly VectorDataViewType _inputType; 314private VectorDataViewType InitializeMappers(out IValueMapperDist[] mappers) 317VectorDataViewType inputType = null; 327private bool IsValid(IValueMapperDist mapper, ref VectorDataViewType inputType) 331VectorDataViewType vectorType = mapper.InputType as VectorDataViewType;
Standard\SdcaBinary.cs (1)
124ch.Check(examplesToFeedTrain.Schema.Feature.Value.Type is VectorDataViewType vecType && vecType.Size > 0, "Training set has no features, aborting training.");
Standard\StochasticTrainerBase.cs (1)
88ch.Check(examplesToFeedTrain.Schema.Feature.Value.Type is VectorDataViewType vecType && vecType.Size > 0, "Training set has no features, aborting training.");
Microsoft.ML.TensorFlow (4)
TensorflowTransform.cs (4)
556if (type is VectorDataViewType vecType && vecType.Size == 0) 559_isInputVector[i] = type is VectorDataViewType; 571vecType = (VectorDataViewType)type; 581vecType = (VectorDataViewType)type;
Microsoft.ML.TensorFlow.Tests (14)
TensorFlowEstimatorTests.cs (2)
242var type = (VectorDataViewType)schema[column].Type;
TensorflowTests.cs (12)
582var type = (VectorDataViewType)schema[col].Type; 596type = (VectorDataViewType)schema[col].Type; 611type = (VectorDataViewType)schema[col].Type; 626type = (VectorDataViewType)schema[col].Type; 645type = (VectorDataViewType)schema[i].Type; 1005var type = (VectorDataViewType)schema[column].Type; 1064var type = (VectorDataViewType)schema[column].Type; 1108var type = (VectorDataViewType)schema[column].Type;
Microsoft.ML.TestFramework (3)
BaseTestBaseline.cs (2)
748if (leftColumn.Type is VectorDataViewType) 767if (leftColumn.Type is VectorDataViewType)
DataPipe\TestDataPipeBase.cs (1)
883if (!(type is VectorDataViewType vectorType))
Microsoft.ML.TestFrameworkCommon (5)
TestCommon.cs (5)
116ulong vsize = type1 is VectorDataViewType vectorType ? (ulong)vectorType.Size : 0; 219if (!(columnType is VectorDataViewType vectorType) || !(other is VectorDataViewType otherVectorType)) 287private static DataViewType GetItemType(this DataViewType columnType) => (columnType as VectorDataViewType)?.ItemType ?? columnType; 289private static int GetVectorSize(this DataViewType columnType) => (columnType as VectorDataViewType)?.Size ?? 0;
Microsoft.ML.Tests (21)
Scenarios\Api\TestApi.cs (4)
211var coltypeStringArray = new VectorDataViewType(coltypeString, valueStringArray.Length); 214var coltypeFloatArray = new VectorDataViewType(coltypeFloat, valueFloatArray.Length); 217var coltypeVBuffer = new VectorDataViewType(coltypeFloat, valueVBuffer.Length); 239Assert.True(idv.Schema[1].Annotations.Schema[0].Type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType);
TermEstimatorTests.cs (1)
147var itemType1 = (type1 as VectorDataViewType)?.ItemType ?? type1;
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (6)
61VectorDataViewType treeValuesType = treeValuesColumn.Type as VectorDataViewType; 79VectorDataViewType treeLeafIdsType = treeLeafIdsColumn.Type as VectorDataViewType; 102VectorDataViewType treePathIdsType = treePathIdsColumn.Type as VectorDataViewType;
Transformers\ConcatTests.cs (6)
75Assert.True(t is VectorDataViewType vt1 && vt1.ItemType == NumberDataViewType.Single && vt1.Size == 1); 77Assert.True(t is VectorDataViewType vt2 && vt2.ItemType == NumberDataViewType.Single && vt2.Size == 2); 79Assert.True(t is VectorDataViewType vt3 && vt3.ItemType == NumberDataViewType.Single && vt3.Size == 5); 81Assert.True(t is VectorDataViewType vt4 && vt4.ItemType == NumberDataViewType.Single && vt4.Size == 0); 143Assert.True(t is VectorDataViewType vt2 && vt2.ItemType == NumberDataViewType.Single && vt2.Size == 2); 145Assert.True(t is VectorDataViewType vt3 && vt3.ItemType == NumberDataViewType.Single && vt3.Size == 5);
Transformers\CopyColumnEstimatorTests.cs (1)
148var itemType1 = (type1 as VectorDataViewType)?.ItemType ?? type1;
Transformers\NormalizerTests.cs (2)
1063var dimensions1 = (transformedData.Schema["output"].Type as VectorDataViewType).Dimensions; 1064var dimensions2 = (transformedData2.Schema["output"].Type as VectorDataViewType).Dimensions;
Transformers\TextFeaturizerTests.cs (1)
705Assert.Equal(10, (savedData.Schema[0].Type as VectorDataViewType)?.Size);
Microsoft.ML.TimeSeries (2)
SrCnnEntireAnomalyDetector.cs (2)
147private readonly VectorDataViewType _outputColumnType; 150public Bindings(DataViewSchema input, string inputColumnName, string outputColumnName, VectorDataViewType outputColumnType)
Microsoft.ML.TorchSharp (24)
AutoFormerV2\ObjectDetectionTrainer.cs (8)
625var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 642var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 698var vecType = type as VectorDataViewType; 755var keyType = _parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
NasBert\NasBertTrainer.cs (4)
520var keyType = Parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 542var keyType = Parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
NasBert\NerTrainer.cs (6)
281var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 293var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 344var vecType = type as VectorDataViewType;
NasBert\TextClassificationTrainer.cs (6)
217var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 229var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 280var vecType = type as VectorDataViewType;
Microsoft.ML.Transforms (106)
CountFeatureSelection.cs (6)
313if (colType is VectorDataViewType vectorType && !vectorType.IsKnownSize) 332if (colTypes[i] is VectorDataViewType vectorType) 364private static CountAggregator GetVecAggregator(DataViewRow row, VectorDataViewType colType, int colSrc) 366Func<DataViewRow, VectorDataViewType, int, CountAggregator> del = GetVecAggregator<int>; 371private static CountAggregator GetVecAggregator<T>(DataViewRow row, VectorDataViewType colType, int colSrc) 407public CountAggregator(VectorDataViewType type, ValueGetter<VBuffer<T>> getter)
Dracula\CountTableTransformer.cs (6)
189if (cols[i].Type is VectorDataViewType) 206if (cols[i].Type is VectorDataViewType) 617var type = new VectorDataViewType(NumberDataViewType.Single, valueCount, _parent.Featurizer.NumFeatures); 620if (!(inputCol.Type is VectorDataViewType) || inputCol.HasSlotNames()) 638if (inputCol.Type is VectorDataViewType) 675if (input.Schema[_parent.ColumnPairs[iinfo].inputColumnName].Type is VectorDataViewType)
ExpressionTransformer.cs (1)
143if (col.Value.Type is VectorDataViewType)
GcnTransform.cs (2)
368Host.Assert(_srcTypes[iinfo] is VectorDataViewType); 892if (!(type is VectorDataViewType vectorType && vectorType.IsKnownSize))
GroupTransform.cs (1)
298var aggregatedResultType = new VectorDataViewType(aggregatedValueType);
HashJoiningTransform.cs (8)
256Host.CheckDecode(Infos[i].TypeSrc is VectorDataViewType); 333if (colInfo.TypeSrc is VectorDataViewType vectorType) 479if (!(Infos[iinfo].TypeSrc is VectorDataViewType vectorType)) 505Host.Assert(!(Infos[iinfo].TypeSrc is VectorDataViewType)); 529VectorDataViewType srcType = Infos[iinfo].TypeSrc as VectorDataViewType; 577VectorDataViewType srcType = Infos[iinfo].TypeSrc as VectorDataViewType;
KeyToVectorMapping.cs (11)
164private readonly VectorDataViewType[] _types; 172_types = new VectorDataViewType[_parent.ColumnPairs.Length]; 225VectorDataViewType typeNames = null; 228typeNames = inputMetadata.Schema[metaKeyValuesCol].Type as VectorDataViewType; 244var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 262var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _types[iinfo].Dimensions); 293VectorDataViewType typeSlotSrc = null; 295typeSlotSrc = inputMetadata.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 343if (!(info.TypeSrc is VectorDataViewType vectorType)) 381private ValueGetter<VBuffer<float>> MakeGetterInd(DataViewRow input, int iinfo, VectorDataViewType typeSrc) 475if (!(col.ItemType is VectorDataViewType || col.ItemType is PrimitiveDataViewType))
MissingValueDroppingTransformer.cs (2)
134if (!(inType is VectorDataViewType)) 196if (!(srcCol.Type is VectorDataViewType))
MissingValueHandlingTransformer.cs (1)
194if (replaceType is VectorDataViewType)
MissingValueIndicatorTransform.cs (10)
70private readonly VectorDataViewType[] _types; 130private VectorDataViewType[] GetTypesAndMetadata() 133var types = new VectorDataViewType[Infos.Length]; 141if (!(type is VectorDataViewType vectorType)) 148VectorDataViewType typeNames; 150(typeNames = Source.Schema[Infos[iinfo].Source].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType) == null || 186if (!(type is VectorDataViewType srcVectorType)) 199var typeNames = Source.Schema[Infos[iinfo].Source].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 245if (Infos[iinfo].TypeSrc is VectorDataViewType)
MissingValueIndicatorTransformer.cs (4)
194if (!(inType is VectorDataViewType vectorType)) 241if (!(_infos[iinfo].InputType is VectorDataViewType)) 469Type rawType = (inputType is VectorDataViewType vectorType) ? vectorType.ItemType.RawType : inputType.RawType; 546DataViewType type = !(col.ItemType is VectorDataViewType vectorType) ?
MissingValueReplacing.cs (12)
236if (savedType is VectorDataViewType savedVectorType) 242Func<VBuffer<int>, VectorDataViewType, int, int[]> func = GetValuesArray<int>; 253private T[] GetValuesArray<T>(VBuffer<T> src, VectorDataViewType srcType, int iinfo) 294if (type is VectorDataViewType vectorType) 336if (types[iinfo] is VectorDataViewType vectorType && !vectorType.IsKnownSize && bySlot) 566VectorDataViewType vectorType = type as VectorDataViewType; 577if (repType is VectorDataViewType repVectorType) 628if (!(_infos[iinfo].TypeSrc is VectorDataViewType)) 877if (type is VectorDataViewType vectorType) 889if (!(_infos[iinfo].TypeSrc is VectorDataViewType)) 1050var type = !(col.ItemType is VectorDataViewType vectorType) ?
MissingValueReplacingUtils.cs (9)
20if (!(type is VectorDataViewType vectorType)) 234protected StatAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col) 335protected MinMaxAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col, bool returnMax) 577public MeanAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col) 656public MinMaxAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col, bool returnMax) 733public ModeAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col) 799public MeanAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col) 874public MinMaxAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col, bool returnMax) 957public ModeAggregatorBySlot(IChannel ch, VectorDataViewType type, DataViewRowCursor cursor, int col)
MutualInformationFeatureSelection.cs (1)
467if (colType is VectorDataViewType vectorType && !vectorType.IsKnownSize)
OptionalColumnTransform.cs (3)
412if (columnType is VectorDataViewType vectorType) 500if (columnType is VectorDataViewType vectorType) 549if (columnType is VectorDataViewType && columnType.IsKnownSizeVector())
RandomFourierFeaturizing.cs (3)
231if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Single) 303if (srcType is VectorDataViewType) 507if (_srcTypes[iinfo] is VectorDataViewType)
Text\LdaTransform.cs (4)
579var srcType = srcCol.Type as VectorDataViewType; 841var srcColType = inputSchema[srcCol].Type as VectorDataViewType;
Text\NgramHashingTransformer.cs (6)
173private readonly VectorDataViewType[] _slotNamesTypes; 377private readonly VectorDataViewType[] _types; 387_types = new VectorDataViewType[_parent._columns.Length]; 842public VBuffer<ReadOnlyMemory<char>>[] SlotNamesMetadata(out VectorDataViewType[] types) 845types = new VectorDataViewType[_iinfoToCollector.Length]; 1184if (!(type is VectorDataViewType vectorType))
Text\NgramTransform.cs (5)
245env.Assert(srcTypes[iinfo] is VectorDataViewType vectorType && vectorType.ItemType is KeyDataViewType); 519var slotNamesType = new VectorDataViewType(TextDataViewType.Instance, _parent._ngramMaps[iinfo].Count); 784var vectorType = _srcTypes[iinfo] as VectorDataViewType; 960if (!(type is VectorDataViewType vectorType))
Text\StopWordsRemovingTransformer.cs (1)
631type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType;
Text\TextNormalizing.cs (2)
212_types[i] = srcType is VectorDataViewType ? new VectorDataViewType(TextDataViewType.Instance) : srcType; 335if (srcType is VectorDataViewType vectorType)
Text\TokenizingByCharacters.cs (2)
209_isSourceVector[i] = type is VectorDataViewType; 470if (!(input.Schema[_parent.ColumnPairs[iinfo].inputColumnName].Type is VectorDataViewType))
Text\WordEmbeddingsExtractor.cs (3)
304if (!(colType is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType)) 311private readonly VectorDataViewType _outputType; 557Host.Assert(column.Type is VectorDataViewType);
Text\WordTokenizing.cs (2)
218_isSourceVector[i] = srcType is VectorDataViewType; 244if (!(srcType is VectorDataViewType))
UngroupTransform.cs (1)
336if (!(inputSchema[col].Type is VectorDataViewType colType))
Microsoft.ML.Vision (8)
DnnRetrainTransform.cs (6)
234var isInputVector = type is VectorDataViewType; 245var vecType = (VectorDataViewType)type; 780if (type is VectorDataViewType vecType && vecType.Size == 0) 783_isInputVector[i] = type is VectorDataViewType; 786vecType = (VectorDataViewType)type;
ImageClassificationTrainer.cs (2)
1365private readonly VectorDataViewType _inputType; 1366private readonly VectorDataViewType _outputType;