10 instantiations of NumberDataViewType
Microsoft.ML.DataView (10)
DataViewType.cs (10)
141Interlocked.CompareExchange(ref _instSByte, new NumberDataViewType(typeof(sbyte)), null) ?? 155Interlocked.CompareExchange(ref _instByte, new NumberDataViewType(typeof(byte)), null) ?? 169Interlocked.CompareExchange(ref _instInt16, new NumberDataViewType(typeof(short)), null) ?? 183Interlocked.CompareExchange(ref _instUInt16, new NumberDataViewType(typeof(ushort)), null) ?? 197Interlocked.CompareExchange(ref _instInt32, new NumberDataViewType(typeof(int)), null) ?? 211Interlocked.CompareExchange(ref _instUInt32, new NumberDataViewType(typeof(uint)), null) ?? 225Interlocked.CompareExchange(ref _instInt64, new NumberDataViewType(typeof(long)), null) ?? 239Interlocked.CompareExchange(ref _instUInt64, new NumberDataViewType(typeof(ulong)), null) ?? 253Interlocked.CompareExchange(ref _instSingle, new NumberDataViewType(typeof(float)), null) ?? 267Interlocked.CompareExchange(ref _instDouble, new NumberDataViewType(typeof(double)), null) ??
1206 references to NumberDataViewType
Microsoft.Data.Analysis (34)
DataFrameColumns\VBufferDataFrameColumn.cs (12)
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);
IDataView.Extension.cs (10)
75else if (type == NumberDataViewType.Byte) 79else if (type == NumberDataViewType.Double) 83else if (type == NumberDataViewType.Single) 87else if (type == NumberDataViewType.Int32) 91else if (type == NumberDataViewType.Int64) 95else if (type == NumberDataViewType.SByte) 99else if (type == NumberDataViewType.Int16) 103else if (type == NumberDataViewType.UInt32) 107else if (type == NumberDataViewType.UInt64) 111else if (type == NumberDataViewType.UInt16)
PrimitiveDataFrameColumn.cs (12)
803return NumberDataViewType.Byte; 807return NumberDataViewType.Double; 815return NumberDataViewType.Single; 819return NumberDataViewType.Int32; 823return NumberDataViewType.Int64; 827return NumberDataViewType.SByte; 831return NumberDataViewType.Int16; 835return NumberDataViewType.UInt32; 839return NumberDataViewType.UInt64; 843return NumberDataViewType.UInt16; 849return NumberDataViewType.UInt16; 853return NumberDataViewType.Double;
Microsoft.ML.AutoML (23)
AutoMLExperiment\ITrialResultManager.cs (6)
45schemaBuilder.AddColumn("id", NumberDataViewType.Int32); 46schemaBuilder.AddColumn("loss", NumberDataViewType.Single); 47schemaBuilder.AddColumn("durationInMilliseconds", NumberDataViewType.Single); 48schemaBuilder.AddColumn("peakCpu", NumberDataViewType.Single); 49schemaBuilder.AddColumn("peakMemoryInMegaByte", NumberDataViewType.Single); 50schemaBuilder.AddColumn("parameter", new VectorDataViewType(NumberDataViewType.Double));
ColumnInference\ColumnTypeInference.cs (1)
189col.SuggestedType = NumberDataViewType.Single;
DatasetDimensions\DatasetDimensionsApi.cs (1)
37if (itemType == NumberDataViewType.Single)
Sweepers\SmacSweeper.cs (2)
121dvBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, targets); 122dvBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single, features);
TransformInference\TransformInference.cs (2)
353if (column.Type.GetItemType() == NumberDataViewType.Single 438intermediateCol.Type.GetItemType() == NumberDataViewType.Single)
Tuner\SmacTuner.cs (2)
134dvBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, losses); 135dvBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single, features);
Utils\ColumnTypeExtensions.cs (1)
13return columnType is NumberDataViewType;
Utils\UserInputValidationUtil.cs (8)
83if (column.Name == DefaultColumnNames.Features && column.Type.GetItemType() != NumberDataViewType.Single) 85throw new ArgumentException($"{DefaultColumnNames.Features} column must be of data type {NumberDataViewType.Single}", nameof(trainData)); 94column.Type.GetItemType() != NumberDataViewType.Single && 98$"{BooleanDataViewType.Instance}, {NumberDataViewType.Single}, and {TextDataViewType.Instance}. " + 115new DataViewType[] { NumberDataViewType.Single, TextDataViewType.Instance }); 117new DataViewType[] { NumberDataViewType.Single, BooleanDataViewType.Instance }); 319return new DataViewType[] { NumberDataViewType.Single }; 321return new DataViewType[] { NumberDataViewType.Single };
Microsoft.ML.AutoML.Tests (96)
AutoFitTests.cs (2)
290Assert.Equal(NumberDataViewType.Single, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 322Assert.Equal(NumberDataViewType.Single, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type);
ColumnInferenceValidationUtilTests.cs (2)
24schemaBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single); 25schemaBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single);
DatasetDimensionsTests.cs (4)
46dataBuilder.AddColumn("NoNan", NumberDataViewType.Single, new float[] { 0, 1, 0, 1, 0 }); 47dataBuilder.AddColumn("Nan", NumberDataViewType.Single, new float[] { 0, 1, 0, 1, float.NaN }); 72dataBuilder.AddColumn("NoNan", Util.GetKeyValueGetter(slotNames), NumberDataViewType.Single, colValues); 78dataBuilder.AddColumn("Nan", Util.GetKeyValueGetter(slotNames), NumberDataViewType.Single, colValues);
PurposeInferenceTests.cs (1)
27schemaBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single);
SplitUtilTests.cs (6)
31dataViewBuilder.AddColumn("Number", NumberDataViewType.Single, 0f); 32dataViewBuilder.AddColumn("Label", NumberDataViewType.Single, 0f); 47dataViewBuilder.AddColumn("Number", NumberDataViewType.Single, new float[9]); 48dataViewBuilder.AddColumn("Label", NumberDataViewType.Single, new float[9]); 66dataViewBuilder.AddColumn("Number", NumberDataViewType.Single, new float[10000]); 67dataViewBuilder.AddColumn("Label", NumberDataViewType.Single, new float[10000]);
TransformInferenceTests.cs (33)
26new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 81new DatasetColumnInfo(DefaultColumnNames.Features, NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 82new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 138new DatasetColumnInfo(DefaultColumnNames.Features, NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 185new DatasetColumnInfo("Numeric", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 207new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 208new DatasetColumnInfo("Numeric2", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 230new DatasetColumnInfo(DefaultColumnNames.Features, NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 251new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 260new DatasetColumnInfo(DefaultColumnNames.Features, NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 261new DatasetColumnInfo("Numeric", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 283new DatasetColumnInfo("Numeric", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 304new DatasetColumnInfo("Numeric", new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 357new DatasetColumnInfo(DefaultColumnNames.Features, NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 424new DatasetColumnInfo("Numeric", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 458new DatasetColumnInfo(DefaultColumnNames.Features, NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 492new DatasetColumnInfo("Missing", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, true)), 493new DatasetColumnInfo("Numeric", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, false)), 549new DatasetColumnInfo("Missing1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, true)), 550new DatasetColumnInfo("Missing2", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, true)), 551new DatasetColumnInfo("Numeric", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, false)), 615new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.Ignore, new ColumnDimensions(null, null)), 616new DatasetColumnInfo("Numeric2", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 637new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 638new DatasetColumnInfo(DefaultColumnNames.Label, NumberDataViewType.Single, ColumnPurpose.Label, new ColumnDimensions(null, null)), 647new DatasetColumnInfo(DefaultColumnNames.Features, new VectorDataViewType(NumberDataViewType.Single), ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 648new DatasetColumnInfo("CustomLabel", NumberDataViewType.Single, ColumnPurpose.Label, 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)), 706new DatasetColumnInfo("Missing", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, true)), 707new DatasetColumnInfo("Missing_MissingIndicator", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, false)), 708new DatasetColumnInfo("Missing_MissingIndicator0", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, false)), 787Assert.Equal(NumberDataViewType.Single, featuresCol.Value.Type.GetItemType());
TransformPostTrainerInferenceTests.cs (5)
27new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 28new DatasetColumnInfo("Label", NumberDataViewType.Single, ColumnPurpose.Label, new ColumnDimensions(null, null)), 50new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)), 51new DatasetColumnInfo("Label", NumberDataViewType.Single, ColumnPurpose.Label, new ColumnDimensions(null, null)), 61new DatasetColumnInfo("Numeric1", NumberDataViewType.Single, ColumnPurpose.NumericFeature, new ColumnDimensions(null, null)),
UserInputValidationTests.cs (35)
108trainDataBuilder.AddColumn("0", NumberDataViewType.Single, new float[] { 1 }); 113validDataBuilder.AddColumn("0", NumberDataViewType.Single, new float[] { 1 }); 130trainDataBuilder.AddColumn("0", NumberDataViewType.Single, new float[] { 1 }); 135validDataBuilder.AddColumn("0", NumberDataViewType.Single, new float[] { 1 }); 153trainDataBuilder.AddColumn("0", NumberDataViewType.Single, new float[] { 1 }); 158validDataBuilder.AddColumn("0", NumberDataViewType.Single, new float[] { 1 }); 159validDataBuilder.AddColumn("1", NumberDataViewType.Single, new float[] { 1 }); 203schemaBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Double); 204schemaBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single); 217schemaBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single); 218schemaBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single); 219schemaBuilder.AddColumn(textPurposeColName, NumberDataViewType.Single); 236ValidateLabelTypeTestCore<float>(TaskKind.Regression, NumberDataViewType.Single, true); 238ValidateLabelTypeTestCore<double>(TaskKind.Regression, NumberDataViewType.Double, false); 245ValidateLabelTypeTestCore<float>(TaskKind.Recommendation, NumberDataViewType.Single, true); 247ValidateLabelTypeTestCore<double>(TaskKind.Recommendation, NumberDataViewType.Double, false); 254ValidateLabelTypeTestCore<float>(TaskKind.BinaryClassification, NumberDataViewType.Single, false); 261ValidateLabelTypeTestCore<float>(TaskKind.MulticlassClassification, NumberDataViewType.Single, true); 263ValidateLabelTypeTestCore<double>(TaskKind.MulticlassClassification, NumberDataViewType.Double, true); 270ValidateLabelTypeTestCore<float>(TaskKind.Ranking, NumberDataViewType.Single, true); 272ValidateLabelTypeTestCore<double>(TaskKind.Ranking, NumberDataViewType.Double, false); 281dataViewBuilder.AddColumn("Number", NumberDataViewType.Single, 0f); 283dataViewBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, 0f); 297schemaBuilder.AddColumn("UInt64", NumberDataViewType.UInt64); 298schemaBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single); 311schemaBuilder.AddColumn("Number", NumberDataViewType.Single); 312schemaBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single); 325dataViewBuilder.AddColumn("Number", NumberDataViewType.Single, 0f); 326dataViewBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, 0f); 331schemaBuilder.AddColumn("Number", NumberDataViewType.Single); 332schemaBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single); 352trainDataBuilder.AddColumn("Number", NumberDataViewType.Single, 0f); 353trainDataBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, 0f); 364validationDataBuilder.AddColumn("Number", NumberDataViewType.Single, 0f); 375dataViewBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single, 0f);
Utils\MLNetUtils\DataViewTestFixture.cs (8)
29if (column.type == NumberDataViewType.Single) 31dataBuilder.AddColumn(column.name, NumberDataViewType.Single, createDummyRow ? new float[] { 0 } : new float[] { }); 33if (column.type == NumberDataViewType.Double) 35dataBuilder.AddColumn(column.name, NumberDataViewType.Double, createDummyRow ? new double[] { 0 } : new double[] { }); 37if (column.type == NumberDataViewType.UInt64) 39dataBuilder.AddColumn(column.name, NumberDataViewType.UInt64, createDummyRow ? new System.UInt64[] { 0 } : new System.UInt64[] { }); 49else if (column.type.IsVector() && column.type.GetItemType() == NumberDataViewType.Single) 54NumberDataViewType.Single,
Microsoft.ML.Core (15)
Data\AnnotationUtils.cs (2)
157return new VectorDataViewType(NumberDataViewType.Int32, rangeCount, 2); 428cols.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true));
Data\ColumnTypeExtensions.cs (13)
21(columnType is NumberDataViewType) || (columnType is TextDataViewType) || (columnType is BooleanDataViewType) || 129public static NumberDataViewType NumberTypeFromType(Type type) 139private static NumberDataViewType NumberTypeFromKind(InternalDataKind kind) 144return NumberDataViewType.SByte; 146return NumberDataViewType.Byte; 148return NumberDataViewType.Int16; 150return NumberDataViewType.UInt16; 152return NumberDataViewType.Int32; 154return NumberDataViewType.UInt32; 156return NumberDataViewType.Int64; 158return NumberDataViewType.UInt64; 160return NumberDataViewType.Single; 162return NumberDataViewType.Double;
Microsoft.ML.Core.Tests (16)
UnitTests\ColumnTypes.cs (8)
27var types = new PrimitiveDataViewType[] { NumberDataViewType.SByte, NumberDataViewType.Int16, NumberDataViewType.Int32, NumberDataViewType.Int64, 28NumberDataViewType.Byte, NumberDataViewType.UInt16, NumberDataViewType.UInt32, NumberDataViewType.UInt64, RowIdDataViewType.Instance,
UnitTests\DataTypes.cs (8)
26var r4ToSB = Conversions.DefaultInstance.GetStringConversion<float>(NumberDataViewType.Single); 29TextDataViewType.Instance, NumberDataViewType.Single, out bool identity2); 50var r8ToSB = Conversions.DefaultInstance.GetStringConversion<double>(NumberDataViewType.Double); 53TextDataViewType.Instance, NumberDataViewType.Double, out bool identity2); 74var mapper = GetMapper<ReadOnlyMemory<char>, sbyte>(NumberDataViewType.SByte); 114var mapper = GetMapper<ReadOnlyMemory<char>, short>(NumberDataViewType.Int16); 154var mapper = GetMapper<ReadOnlyMemory<char>, int>(NumberDataViewType.Int32); 194var mapper = GetMapper<ReadOnlyMemory<char>, long>(NumberDataViewType.Int64);
Microsoft.ML.Data (404)
Commands\DataCommand.cs (2)
167if (type is NumberDataViewType) 169var getter = RowCursorUtils.GetGetterAs<double>(NumberDataViewType.Double, cursor, currentIndex);
Data\Conversion.cs (2)
521var convSrc = GetStandardConversion<TSrc, U8>(key, NumberDataViewType.UInt64, out identity); 522var convU8 = GetStringConversion<U8>(NumberDataViewType.UInt64);
Data\ITransposeDataView.cs (1)
38/// field is <see cref="NumberDataViewType.Single"/>. If the i-th column can't be iterated column-wisely, this function may
Data\RowCursorUtils.cs (11)
343if (type == NumberDataViewType.Single || type == NumberDataViewType.Double || type is BooleanDataViewType) 356if (type == NumberDataViewType.Single) 359if (type == NumberDataViewType.Double) 378Contracts.Assert(type != NumberDataViewType.Single && type != NumberDataViewType.Double); 400var getSrc = RowCursorUtils.GetGetterAs<ulong>(NumberDataViewType.UInt64, cursor, labelIndex); 417if (type == NumberDataViewType.Single) 419if (type == NumberDataViewType.Double || type is BooleanDataViewType) 420return GetVecGetterAs<Single>(NumberDataViewType.Single, cursor); 429var getSrc = RowCursorUtils.GetVecGetterAs<ulong>(NumberDataViewType.UInt64, cursor);
DataLoadSave\DataOperationsCatalog.cs (3)
231if (!(type is NumberDataViewType)) 578if (type != NumberDataViewType.Single && type != NumberDataViewType.Double)
Deprecated\Instances\HeaderSchema.cs (1)
33_colType = new VectorDataViewType(NumberDataViewType.Single, collection.Count);
Evaluators\AnomalyDetectionEvaluator.cs (12)
99if (t != NumberDataViewType.Single) 103if (t != NumberDataViewType.Single && t.GetKeyCount() != 2) 185overallDvBldr.AddColumn(BinaryClassifierEvaluator.Auc, NumberDataViewType.Double, auc.ToArray()); 186overallDvBldr.AddColumn(OverallMetrics.DrAtK, NumberDataViewType.Double, drAtK.ToArray()); 187overallDvBldr.AddColumn(OverallMetrics.DrAtPFpr, NumberDataViewType.Double, drAtP.ToArray()); 188overallDvBldr.AddColumn(OverallMetrics.DrAtNumPos, NumberDataViewType.Double, drAtNumAnomalies.ToArray()); 189overallDvBldr.AddColumn(OverallMetrics.ThreshAtK, NumberDataViewType.Single, thresholdAtK.ToArray()); 190overallDvBldr.AddColumn(OverallMetrics.ThreshAtP, NumberDataViewType.Single, thresholdAtP.ToArray()); 191overallDvBldr.AddColumn(OverallMetrics.ThreshAtNumPos, NumberDataViewType.Single, thresholdAtNumAnomalies.ToArray()); 192overallDvBldr.AddColumn(OverallMetrics.NumAnomalies, NumberDataViewType.Int64, numAnoms.ToArray()); 201topKdvBldr.AddColumn(TopKResultsColumns.AnomalyScore, NumberDataViewType.Single, scores.ToArray()); 202topKdvBldr.AddColumn(TopKResultsColumns.Label, NumberDataViewType.Single, labels.ToArray());
Evaluators\BinaryClassifierEvaluator.cs (34)
131if (t != NumberDataViewType.Single) 135if (t != NumberDataViewType.Single && t != NumberDataViewType.Double && t != BooleanDataViewType.Instance && t.GetKeyCount() != 2) 147if (probType != NumberDataViewType.Single) 342overallDvBldr.AddColumn(Auc, NumberDataViewType.Double, auc.ToArray()); 343overallDvBldr.AddColumn(Accuracy, NumberDataViewType.Double, accuracy.ToArray()); 344overallDvBldr.AddColumn(PosPrecName, NumberDataViewType.Double, posPrec.ToArray()); 345overallDvBldr.AddColumn(PosRecallName, NumberDataViewType.Double, posRecall.ToArray()); 346overallDvBldr.AddColumn(NegPrecName, NumberDataViewType.Double, negPrec.ToArray()); 347overallDvBldr.AddColumn(NegRecallName, NumberDataViewType.Double, negRecall.ToArray()); 348overallDvBldr.AddColumn(LogLoss, NumberDataViewType.Double, logLoss.ToArray()); 349overallDvBldr.AddColumn(LogLossReduction, NumberDataViewType.Double, logLossRed.ToArray()); 350overallDvBldr.AddColumn(Entropy, NumberDataViewType.Double, entropy.ToArray()); 351overallDvBldr.AddColumn(F1, NumberDataViewType.Double, f1.ToArray()); 353overallDvBldr.AddColumn(AuPrc, NumberDataViewType.Double, auprc.ToArray()); 364confDvBldr.AddColumn(MetricKinds.ColumnNames.Count, getSlotNames, NumberDataViewType.Double, counts.ToArray()); 367confDvBldr.AddColumn(MetricKinds.ColumnNames.Weight, getSlotNames, NumberDataViewType.Double, weights.ToArray()); 381dvBldr.AddColumn(Threshold, NumberDataViewType.Single, scores.ToArray()); 382dvBldr.AddColumn(Precision, NumberDataViewType.Double, precision.ToArray()); 383dvBldr.AddColumn(Recall, NumberDataViewType.Double, recall.ToArray()); 384dvBldr.AddColumn(FalsePositiveRate, NumberDataViewType.Double, fpr.ToArray()); 387dvBldr.AddColumn("Weighted " + Precision, NumberDataViewType.Double, weightedPrecision.ToArray()); 388dvBldr.AddColumn("Weighted " + Recall, NumberDataViewType.Double, weightedRecall.ToArray()); 389dvBldr.AddColumn("Weighted " + FalsePositiveRate, NumberDataViewType.Double, weightedFpr.ToArray()); 1076_types[LogLossCol] = NumberDataViewType.Double; 1102_types[LogLossCol] = NumberDataViewType.Double; 1265if (t != NumberDataViewType.Single && t != NumberDataViewType.Double && t != BooleanDataViewType.Instance && t.GetKeyCount() != 2) 1269if (t != NumberDataViewType.Single) 1276if (t != NumberDataViewType.Single) 1349scoreCol.Index, AnnotationUtils.Const.ScoreValueKind.Probability, NumberDataViewType.Single.Equals); 1483scoreCol.Index, AnnotationUtils.Const.ScoreValueKind.Probability, NumberDataViewType.Single.Equals); 1566schemaBuilder.AddColumn(mc.LoadName, NumberDataViewType.Double); 1580schemaBuilder.AddColumn(MetricKinds.ColumnNames.Count, NumberDataViewType.Double);
Evaluators\ClusteringEvaluator.cs (9)
100if (type != null && type != NumberDataViewType.Single && !(type is KeyDataViewType keyType && keyType.Count > 0)) 108if (!(type is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 118if (!(t is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 209overallDvBldr.AddColumn(Nmi, NumberDataViewType.Double, nmi.ToArray()); 210overallDvBldr.AddColumn(AvgMinScore, NumberDataViewType.Double, avgMinScores.ToArray()); 212overallDvBldr.AddColumn(Dbi, NumberDataViewType.Double, dbi.ToArray()); 599_types[SortedClusterScoreCol] = new VectorDataViewType(NumberDataViewType.Single, _numClusters); 618_types[SortedClusterScoreCol] = new VectorDataViewType(NumberDataViewType.Single, _numClusters); 756if (!(type is VectorDataViewType vectorType) || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single)
Evaluators\EvaluatorUtils.cs (16)
247if (type != NumberDataViewType.Single) 248throw ectx.ExceptUserArg(nameof(EvaluateCommand.Arguments.WeightColumn), "Incompatible Weight column. Weight column type must be {0}.", NumberDataViewType.Single); 307if (type == NumberDataViewType.Double || type == NumberDataViewType.Single) 308getters[i] = RowCursorUtils.GetGetterAs<double>(NumberDataViewType.Double, cursor, i); 311&& vectorType.ItemType == NumberDataViewType.Double 1011if (type is NumberDataViewType) 1013getters[i] = RowCursorUtils.GetGetterAs<double>(NumberDataViewType.Double, row, i); 1017else if (type is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Double) 1274else if (type is NumberDataViewType) 1280else if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Double) 1317dvBldr.AddColumn(columnName, getSlotNames, NumberDataViewType.Double, new[] { vectorMetrics, vectorStdevMetrics }); 1320dvBldr.AddColumn(columnName, getSlotNames, NumberDataViewType.Double, new[] { vectorMetrics }); 1329dvBldr.AddColumn(agg[iMetric].Name, NumberDataViewType.Double, avg, Math.Sqrt(agg[iMetric].SumSq / numFolds - avg * avg)); 1331dvBldr.AddColumn(agg[iMetric].Name, NumberDataViewType.Double, avg); 1479Contracts.Check(type != null && type.IsKnownSize && type.ItemType == NumberDataViewType.Double);
Evaluators\MulticlassClassificationEvaluator.cs (19)
79if (scoreType == null || scoreType.Size < 2 || scoreType.ItemType != NumberDataViewType.Single) 83if (labelType != NumberDataViewType.Single && labelType.GetKeyCount() <= 0) 216overallDvBldr.AddColumn(AccuracyMicro, NumberDataViewType.Double, microAcc.ToArray()); 217overallDvBldr.AddColumn(AccuracyMacro, NumberDataViewType.Double, macroAcc.ToArray()); 218overallDvBldr.AddColumn(LogLoss, NumberDataViewType.Double, logLoss.ToArray()); 219overallDvBldr.AddColumn(LogLossReduction, NumberDataViewType.Double, logLossRed.ToArray()); 222overallDvBldr.AddColumn(TopKAccuracy, NumberDataViewType.Double, topKAcc.ToArray()); 227overallDvBldr.AddColumn(AllTopKAccuracy, getKSlotNames, NumberDataViewType.Double, allTopK.ToArray()); 230overallDvBldr.AddColumn(PerClassLogLoss, aggregator.GetSlotNames, NumberDataViewType.Double, perClassLogLoss.ToArray()); 241confDvBldr.AddColumn(MetricKinds.ColumnNames.Count, getSlotNames, NumberDataViewType.Double, counts.ToArray()); 244confDvBldr.AddColumn(MetricKinds.ColumnNames.Weight, getSlotNames, NumberDataViewType.Double, weights.ToArray()); 634_types[LogLossCol] = NumberDataViewType.Double; 635_types[SortedScoresCol] = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 663_types[LogLossCol] = NumberDataViewType.Double; 664_types[SortedScoresCol] = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 861if (scoreType == null || scoreType.Size < 2 || scoreType.ItemType != NumberDataViewType.Single) 864if (labelType != NumberDataViewType.Single && labelType.GetKeyCount() <= 0) 976EvaluateUtils.ReconcileSlotNames<double>(Host, views, MulticlassClassificationEvaluator.PerClassLogLoss, NumberDataViewType.Double, 1064labelName, labelCol.Type, NumberDataViewType.Double,
Evaluators\MultiOutputRegressionEvaluator.cs (19)
62if (t == null || !t.IsKnownSize || t.ItemType != NumberDataViewType.Single) 66if (t == null || !t.IsKnownSize || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) 153overallDvBldr.AddColumn(PerLabelL1, aggregator.GetSlotNames, NumberDataViewType.Double, perLabelL1.ToArray()); 154overallDvBldr.AddColumn(PerLabelL2, aggregator.GetSlotNames, NumberDataViewType.Double, perLabelL2.ToArray()); 155overallDvBldr.AddColumn(PerLabelRms, aggregator.GetSlotNames, NumberDataViewType.Double, perLabelRms.ToArray()); 156overallDvBldr.AddColumn(PerLabelLoss, aggregator.GetSlotNames, NumberDataViewType.Double, perLabelLoss.ToArray()); 157overallDvBldr.AddColumn(L1, NumberDataViewType.Double, l1.ToArray()); 158overallDvBldr.AddColumn(L2, NumberDataViewType.Double, l2.ToArray()); 159overallDvBldr.AddColumn(Dist, NumberDataViewType.Double, dist.ToArray()); 309_labelGetter = RowCursorUtils.GetVecGetterAs<float>(NumberDataViewType.Single, row, schema.Label.Value.Index); 454infos[L1Output] = new DataViewSchema.DetachedColumn(L1, NumberDataViewType.Double, null); 455infos[L2Output] = new DataViewSchema.DetachedColumn(L2, NumberDataViewType.Double, null); 456infos[DistCol] = new DataViewSchema.DetachedColumn(Dist, NumberDataViewType.Double, null); 473? RowCursorUtils.GetVecGetterAs<float>(NumberDataViewType.Single, input, LabelIndex) 550if (t == null || !t.IsKnownSize || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) 559if (t == null || !t.IsKnownSize || t.ItemType != NumberDataViewType.Single) 708if (type != null && type.IsKnownSize && type.ItemType == NumberDataViewType.Double)
Evaluators\QuantileRegressionEvaluator.cs (14)
60if (t == null || t.Size == 0 || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) 64if (labelType != NumberDataViewType.Single) 72Host.Assert(scoreType != null && scoreType.Size > 0 && (scoreType.ItemType == NumberDataViewType.Single || scoreType.ItemType == NumberDataViewType.Double)); 252dvBldr.AddColumn(metricName, getSlotNames, NumberDataViewType.Double, metric); 255dvBldr.AddColumn(metricName, NumberDataViewType.Double, metric); 295_outputType = new VectorDataViewType(NumberDataViewType.Double, _scoreSize); 314_outputType = new VectorDataViewType(NumberDataViewType.Double, _scoreSize); 448if (t != NumberDataViewType.Single) 452if (scoreType == null || scoreType.Size == 0 || (scoreType.ItemType != NumberDataViewType.Single && scoreType.ItemType != NumberDataViewType.Double)) 517if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Double) 521output = LambdaColumnMapper.Create(Host, "Quantile Regression", output, name, name, type, NumberDataViewType.Double,
Evaluators\RankingEvaluator.cs (8)
99if (t != NumberDataViewType.Single && !(t is KeyDataViewType)) 105if (scoreCol.Type != NumberDataViewType.Single) 221overallDvBldr.AddColumn(Ndcg, aggregator.GetSlotNames, NumberDataViewType.Double, ndcg.ToArray()); 222overallDvBldr.AddColumn(Dcg, aggregator.GetSlotNames, NumberDataViewType.Double, dcg.ToArray()); 233groupDvBldr.AddColumn(Ndcg, aggregator.GetGroupSummarySlotNames("NDCG"), NumberDataViewType.Double, groupNdcg.ToArray()); 234groupDvBldr.AddColumn(Dcg, aggregator.GetGroupSummarySlotNames("DCG"), NumberDataViewType.Double, groupDcg.ToArray()); 235groupDvBldr.AddColumn(MaxDcg, aggregator.GetGroupSummarySlotNames("MaxDCG"), NumberDataViewType.Double, groupMaxDcg.ToArray()); 642_outputType = new VectorDataViewType(NumberDataViewType.Double, _truncationLevel);
Evaluators\RegressionEvaluator.cs (7)
59if (t != NumberDataViewType.Single) 63if (t != NumberDataViewType.Single) 163dvBldr.AddColumn(metricName, NumberDataViewType.Double, metric); 264infos[L1Col] = new DataViewSchema.DetachedColumn(L1, NumberDataViewType.Double, null); 265infos[L2Col] = new DataViewSchema.DetachedColumn(L2, NumberDataViewType.Double, null); 329if (t != NumberDataViewType.Single) 333if (t != NumberDataViewType.Single)
Prediction\Calibrator.cs (12)
300DataViewType IValueMapperDist.DistType => NumberDataViewType.Single; 314Host.Check(_mapper.OutputType == NumberDataViewType.Single, "The output type of the predictor is expected to be float"); 669env.Check(scoreType is NumberDataViewType); 716var scoreGetter = RowCursorUtils.GetGetterAs<Single>(NumberDataViewType.Single, input, _scoreCol); 887if (type != NumberDataViewType.Single) 889ch.Info("Not training a calibrator because the predictor output is {0}, but expected to be {1}.", type, NumberDataViewType.Single); 969var scoreGetter = RowCursorUtils.GetGetterAs<Single>(NumberDataViewType.Single, cursor, scoreCol.Index); 971RowCursorUtils.GetGetterAs<Single>(NumberDataViewType.Single, cursor, weightCol.Value.Index); 1307var subNodeOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "subNodeOutput"); 1312var divNodeOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "binIndexOutput"); 1316var castOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "castOutput"); 1324var binIndexOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "binIndexOutput");
Prediction\CalibratorCatalog.cs (5)
112setIdCol.Kind == scalar && setIdCol.IsKey && setIdCol.ItemType == NumberDataViewType.UInt32 && 127NumberDataViewType.Single, 206DataViewType ISingleFeaturePredictionTransformer<TICalibrator>.FeatureColumnType => NumberDataViewType.Single; 275probabilityName = ctx.AddIntermediateVariable(NumberDataViewType.Single, probabilityName); 309new DataViewSchema.DetachedColumn(DefaultColumnNames.Probability, NumberDataViewType.Single, builder.ToAnnotations())
Scorers\BinaryClassifierScorer.cs (3)
203var binarizerOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "BinarizerOutput", false); 211var addOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "Add", false); 310=> scoreType == NumberDataViewType.Single;
Scorers\ClusteringScorer.cs (1)
144&& vectorType.ItemType == NumberDataViewType.Single;
Scorers\FeatureContributionCalculation.cs (1)
344var featureContributionType = new VectorDataViewType(NumberDataViewType.Single, ((VectorDataViewType)FeatureColumn.Type).Dimensions);
Scorers\MulticlassClassificationScorer.cs (1)
606scoreType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Single;
Scorers\SchemaBindablePredictorWrapper.cs (10)
130var typeIn = ValueMapper != null ? ValueMapper.InputType : new VectorDataViewType(NumberDataViewType.Single); 477Contracts.Check(ScoreType == NumberDataViewType.Single, "Expected predictor result type to be float"); 486Contracts.Check(distMapper.InputType is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Single, 488Contracts.Check(distMapper.DistType == NumberDataViewType.Single, 531&& vectorType.ItemType == NumberDataViewType.Single, 648Contracts.CheckParam(ScoreType == NumberDataViewType.Single, nameof(predictor), "Unexpected predictor output type"); 650&& vectorType.ItemType == NumberDataViewType.Single, 667Contracts.CheckDecode(ScoreType == NumberDataViewType.Single); 669&& vectorType.ItemType == NumberDataViewType.Single); 705Contracts.Assert(typeSrc != null && typeSrc.ItemType == NumberDataViewType.Single);
Scorers\ScoreSchemaFactory.cs (2)
54var partialSchema = Create(NumberDataViewType.Single, AnnotationUtils.Const.ScoreColumnKind.BinaryClassification, scoreColumnName); 69schemaBuilder.AddColumn(probabilityColumnName, NumberDataViewType.Single, probabilityMetadataBuilder.ToAnnotations());
Training\TrainerUtils.cs (17)
57if (!(col.Type is VectorDataViewType vecType && vecType.Size > 0 && vecType.ItemType == NumberDataViewType.Single)) 75Contracts.Assert(colType.ItemType == NumberDataViewType.Single); 90if (col.Type != BooleanDataViewType.Instance && col.Type != NumberDataViewType.Single && col.Type != NumberDataViewType.Double && !(col.Type is KeyDataViewType keyType && keyType.Count == 2)) 125if (col.Type != NumberDataViewType.Single && col.Type != NumberDataViewType.Double) 154if (col.Type != NumberDataViewType.Single && col.Type != NumberDataViewType.Double) 195&& vectorType.ItemType == NumberDataViewType.Single)) 207if (col.Type != NumberDataViewType.Single && col.Type != NumberDataViewType.Double) 317return RowCursorUtils.GetGetterAs<float>(NumberDataViewType.Single, row, col.Value.Index); 338return RowCursorUtils.GetGetterAs<ulong>(NumberDataViewType.UInt64, row, col.Value.Index); 359=> new SchemaShape.Column(columnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false); 370return new SchemaShape.Column(columnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true); 378=> new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 388return new SchemaShape.Column(weightColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
Transforms\ColumnConcatenatingEstimator.cs (2)
83&& mcol.ItemType == NumberDataViewType.Int32; 134meta.Add(new SchemaShape.Column(AnnotationUtils.Kinds.CategoricalSlotRanges, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Int32, false));
Transforms\ColumnConcatenatingTransformer.cs (3)
507if (!(itemType is NumberDataViewType)) 915if ((!outColType.IsKnownSize) || (!(outColType.GetItemType() is NumberDataViewType))) 938var vectorizerOutputType = new VectorDataViewType(NumberDataViewType.Single, outVectorSize);
Transforms\FeatureContributionCalculationTransformer.cs (3)
184if (_featureColumnType == null || _featureColumnType.ItemType != NumberDataViewType.Single) 200return new[] { new DataViewSchema.DetachedColumn(DefaultColumnNames.FeatureContributions, new VectorDataViewType(NumberDataViewType.Single, _featureColumnType.Size), builder.ToAnnotations()) }; 345if (col.ItemType != NumberDataViewType.Single || col.Kind != SchemaShape.Column.VectorKind.Vector)
Transforms\GenerateNumberTransform.cs (2)
193return UseCounter[iinfo] ? NumberDataViewType.Int64 : NumberDataViewType.Single;
Transforms\Hashing.cs (10)
1378castOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "CastOutput", true); 1380isZeroNode.AddAttribute("to", NumberDataViewType.Int64.RawType); 1387isGreaterThanZeroOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "isGreaterThanZeroOutput"); 1390isZeroNode.AddAttribute("to", NumberDataViewType.Int64.RawType); 1398castOutput = ctx.AddIntermediateVariable(NumberDataViewType.UInt32, "CastOutput", true); 1400castNode.AddAttribute("to", NumberDataViewType.UInt32.RawType); 1430var vectorShape = new VectorDataViewType(NumberDataViewType.Int64, _srcTypes[iinfo].GetValueCount()); 1434var t = NumberDataViewType.Int64.RawType; 1894return itemType is TextDataViewType || itemType is KeyDataViewType || itemType is NumberDataViewType || 1969NumberDataViewType.UInt32, true, new SchemaShape(metadata));
Transforms\InvertHashUtils.cs (1)
58var keyMapper = conv.GetStandardConversion<T, uint>(type, NumberDataViewType.UInt32, out identity);
Transforms\KeyToValue.cs (18)
335_convertToUInt = Data.Conversion.Conversions.DefaultInstance.GetStandardConversion<TKey, UInt32>(typeKey, NumberDataViewType.UInt32, out identity); 512var castNodeOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Int64, srcShape), "CastNodeOutput"); 519if (TypeOutput == NumberDataViewType.Double || TypeOutput == BooleanDataViewType.Instance) 520labelEncoderOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, srcShape), "CastNodeOutput"); 521else if (TypeOutput == NumberDataViewType.Int64 || TypeOutput == NumberDataViewType.UInt16 || 522TypeOutput == NumberDataViewType.Int32 || TypeOutput == NumberDataViewType.Int16 || 523TypeOutput == NumberDataViewType.UInt64 || TypeOutput == NumberDataViewType.UInt32) 531if (TypeOutput == NumberDataViewType.Int64 || TypeOutput == NumberDataViewType.Int32 || 532TypeOutput == NumberDataViewType.Int16 || TypeOutput == NumberDataViewType.UInt64 || 533TypeOutput == NumberDataViewType.UInt32 || TypeOutput == NumberDataViewType.UInt16) 542else if (TypeOutput == NumberDataViewType.Single) 547else if (TypeOutput == NumberDataViewType.Double)
Transforms\KeyToVector.cs (9)
260_types[i] = new VectorDataViewType(NumberDataViewType.Single, keyCount); 262_types[i] = new VectorDataViewType(NumberDataViewType.Single, valueCount, keyCount); 477var getSrc = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, input, srcCol); 518var getSrc = RowCursorUtils.GetVecGetterAs<uint>(NumberDataViewType.UInt32, input, srcCol); 564var getSrc = RowCursorUtils.GetVecGetterAs<uint>(NumberDataViewType.UInt32, input, srcCol); 712var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Int64, dim), opType); 719var typeShape = new VectorDataViewType(NumberDataViewType.Single, dim, categoryRange); 834metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.CategoricalSlotRanges, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Int32, false)); 840NumberDataViewType.Single, false, new SchemaShape(metadata));
Transforms\LabelConvertTransform.cs (2)
140return NumberDataViewType.Single; 191Interlocked.CompareExchange(ref _slotType, new VectorDataViewType(NumberDataViewType.Single, srcSlotType.Dimensions), null);
Transforms\LabelIndicatorTransform.cs (4)
111if (type.GetKeyCount() > 0 || type == NumberDataViewType.Single || type == NumberDataViewType.Double) 202if (info.TypeSrc == NumberDataViewType.Single) 214if (info.TypeSrc == NumberDataViewType.Double)
Transforms\NAFilter.cs (2)
191if (itemType == NumberDataViewType.Single) 193if (itemType == NumberDataViewType.Double)
Transforms\NormalizeColumn.cs (60)
209if (itemType != NumberDataViewType.Single && itemType != NumberDataViewType.Double) 433if (typeSrc is NumberDataViewType) 435if (typeSrc == NumberDataViewType.Single) 437if (typeSrc == NumberDataViewType.Double) 440else if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 442if (vectorType.ItemType == NumberDataViewType.Single) 444if (vectorType.ItemType == NumberDataViewType.Double) 552if (typeSrc is NumberDataViewType) 554if (typeSrc == NumberDataViewType.Single) 556if (typeSrc == NumberDataViewType.Double) 559else if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 561if (vectorType.ItemType == NumberDataViewType.Single) 563if (vectorType.ItemType == NumberDataViewType.Double) 688if (typeSrc is NumberDataViewType) 690if (typeSrc == NumberDataViewType.Single) 692if (typeSrc == NumberDataViewType.Double) 695if (typeSrc is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 697if (vectorType.ItemType == NumberDataViewType.Single) 699if (vectorType.ItemType == NumberDataViewType.Double) 813Host.Assert(type is KeyDataViewType || type is NumberDataViewType); 822var getSrc = RowCursorUtils.GetGetterAs<ulong>(NumberDataViewType.UInt64, row, col); 842var getSrc = RowCursorUtils.GetGetterAs<Double>(NumberDataViewType.Double, row, col); 983if (srcType is NumberDataViewType) 985if (srcType == NumberDataViewType.Single) 987if (srcType == NumberDataViewType.Double) 990if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 992if (vectorType.ItemType == NumberDataViewType.Single) 994if (vectorType.ItemType == NumberDataViewType.Double) 1022if (srcType is NumberDataViewType) 1024if (srcType == NumberDataViewType.Single) 1026if (srcType == NumberDataViewType.Double) 1029if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1031if (vectorType.ItemType == NumberDataViewType.Single) 1033if (vectorType.ItemType == NumberDataViewType.Double) 1063if (srcType is NumberDataViewType) 1065if (srcType == NumberDataViewType.Single) 1067if (srcType == NumberDataViewType.Double) 1070if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1072if (vectorType.ItemType == NumberDataViewType.Single) 1074if (vectorType.ItemType == NumberDataViewType.Double) 1103if (srcType is NumberDataViewType) 1105if (srcType == NumberDataViewType.Single) 1107if (srcType == NumberDataViewType.Double) 1110if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1112if (vectorType.ItemType == NumberDataViewType.Single) 1114if (vectorType.ItemType == NumberDataViewType.Double) 1136host.CheckUserArg(labelColumnType is NumberDataViewType, nameof(args.LabelColumn), "Label column must be a number or a key type"); 1162if (srcType is NumberDataViewType) 1164if (srcType == NumberDataViewType.Single) 1166if (srcType == NumberDataViewType.Double) 1169if (srcType is VectorDataViewType vectorType && vectorType.ItemType is NumberDataViewType) 1171if (vectorType.ItemType == NumberDataViewType.Single) 1173if (vectorType.ItemType == NumberDataViewType.Double) 1214if (srcType is NumberDataViewType) 1216if (srcType == NumberDataViewType.Single) 1218if (srcType == NumberDataViewType.Double) 1221if (srcType is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType is NumberDataViewType) 1223if (vectorType.ItemType == NumberDataViewType.Single) 1225if (vectorType.ItemType == NumberDataViewType.Double)
Transforms\Normalizer.cs (4)
356if (!col.ItemType.Equals(NumberDataViewType.Single) && !col.ItemType.Equals(NumberDataViewType.Double)) 710if (!itemType.Equals(NumberDataViewType.Single) && !itemType.Equals(NumberDataViewType.Double))
Transforms\RangeFilter.cs (13)
155if (_type != NumberDataViewType.Single && _type != NumberDataViewType.Double && _type.GetKeyCount() == 0) 241if (_type == NumberDataViewType.Single) 243if (_type == NumberDataViewType.Double) 264return type == NumberDataViewType.Single || type == NumberDataViewType.Double || type.GetKeyCount() > 0; 357Ch.Assert(Parent._type == NumberDataViewType.Single); 369Ch.Assert(Parent._type == NumberDataViewType.Single); 375Ch.Assert(Parent._type == NumberDataViewType.Single); 390Ch.Assert(Parent._type == NumberDataViewType.Double); 402Ch.Assert(Parent._type == NumberDataViewType.Double); 408Ch.Assert(Parent._type == NumberDataViewType.Double); 435_conv = Data.Conversion.Conversions.DefaultInstance.GetStandardConversion<T, ulong>(Parent._type, NumberDataViewType.UInt64, out identity);
Transforms\SlotsDroppingTransformer.cs (3)
503|| type == NumberDataViewType.Single || type == NumberDataViewType.Double || type is TextDataViewType; 918else if (type == NumberDataViewType.Single)
Transforms\TransformBase.cs (3)
948if (type.GetItemType() == NumberDataViewType.Single) 955if (type is VectorDataViewType vectorType && vectorType.ItemType == NumberDataViewType.Single) 965&& vectorType.ItemType == NumberDataViewType.Single)
Transforms\TypeConverting.cs (6)
455if (srcItemType is NumberDataViewType && currentItemType is NumberDataViewType) 457if (srcType is BooleanDataViewType && currentItemType is NumberDataViewType) 635if (col.ItemType is BooleanDataViewType && newType is NumberDataViewType) 644if (col.ItemType is NumberDataViewType && newType is NumberDataViewType)
Transforms\ValueMapping.cs (38)
109var columnType = (isKey) ? NumberDataViewType.UInt32 : 1094else if (itemType == NumberDataViewType.Single) 1096else if (itemType == NumberDataViewType.Int64) 1113var labelEncoderOutput = (typeValue == NumberDataViewType.Single || typeValue == TextDataViewType.Instance || typeValue == NumberDataViewType.Int64) ? dstVariableName : 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"); 1121if (typeKey == NumberDataViewType.Int64) 1124if (typeValue is NumberDataViewType) 1134else if (typeKey == NumberDataViewType.Int32) 1138CastInputTo<Int32>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Int64); 1142else if (typeKey == NumberDataViewType.Int16) 1145CastInputTo<Int16>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Int64); 1149else if (typeKey == NumberDataViewType.UInt64) 1152CastInputTo<UInt64>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Int64); 1156else if (typeKey == NumberDataViewType.UInt32) 1159CastInputTo<UInt32>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Int64); 1163else if (typeKey == NumberDataViewType.UInt16) 1166CastInputTo<UInt16>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Int64); 1170else if (typeKey == NumberDataViewType.Single) 1172if (typeValue == NumberDataViewType.Single || typeValue == NumberDataViewType.Double || typeValue == BooleanDataViewType.Instance) 1182else if (typeKey == NumberDataViewType.Double) 1184if (typeValue == NumberDataViewType.Single || typeValue == NumberDataViewType.Double || typeValue == BooleanDataViewType.Instance) 1187CastInputTo<double>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Single); 1198if (typeValue == NumberDataViewType.Single || typeValue == NumberDataViewType.Double || typeValue == BooleanDataViewType.Instance) 1209CastInputTo<bool>(ctx, out node, srcVariableName, opType, labelEncoderOutput, NumberDataViewType.Single); 1214if (typeValue == NumberDataViewType.Int64) 1218else if (typeValue == NumberDataViewType.Int32) 1224else if (typeValue == NumberDataViewType.Int16) 1230else if (typeValue == NumberDataViewType.UInt64 || kind == InternalDataKind.U8) 1236else if (typeValue == NumberDataViewType.UInt32 || kind == InternalDataKind.U4) 1242else if (typeValue == NumberDataViewType.UInt16) 1248else if (typeValue == NumberDataViewType.Single) 1252else if (typeValue == NumberDataViewType.Double)
Transforms\ValueToKeyMappingEstimator.cs (1)
204result[colInfo.OutputColumnName] = new SchemaShape.Column(colInfo.OutputColumnName, col.Kind, NumberDataViewType.UInt32, true, metadata);
Transforms\ValueToKeyMappingTransformer.cs (10)
804var castOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, (int)srcShape[1]), "castOutput"); 822var labelEncoderOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Int64, _types[iinfo].GetValueCount()), "LabelEncoderOutput"); 836else if (type.Equals(NumberDataViewType.Single)) 842else if (type.Equals(NumberDataViewType.Double)) 847else if (type.Equals(NumberDataViewType.Int64)) 851else if (type.Equals(NumberDataViewType.Int32)) 855else if (type.Equals(NumberDataViewType.Int16)) 859else if (type.Equals(NumberDataViewType.UInt64)) 863else if (type.Equals(NumberDataViewType.UInt32)) 867else if (type.Equals(NumberDataViewType.UInt16))
Microsoft.ML.DataView (36)
DataViewType.cs (32)
35/// For example, most practical instances of ML.NET's KeyType and <see cref="NumberDataViewType.UInt32"/> will have a 132private static volatile NumberDataViewType _instSByte; 134/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="sbyte"/>. 136public static NumberDataViewType SByte 146private static volatile NumberDataViewType _instByte; 148/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="byte"/>. 150public static NumberDataViewType Byte 160private static volatile NumberDataViewType _instInt16; 162/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="short"/>. 164public static NumberDataViewType Int16 174private static volatile NumberDataViewType _instUInt16; 176/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="ushort"/>. 178public static NumberDataViewType UInt16 188private static volatile NumberDataViewType _instInt32; 190/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="int"/>. 192public static NumberDataViewType Int32 202private static volatile NumberDataViewType _instUInt32; 204/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="uint"/>. 206public static NumberDataViewType UInt32 216private static volatile NumberDataViewType _instInt64; 218/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="long"/>. 220public static NumberDataViewType Int64 230private static volatile NumberDataViewType _instUInt64; 232/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="ulong"/>. 234public static NumberDataViewType UInt64 244private static volatile NumberDataViewType _instSingle; 246/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="float"/>. 248public static NumberDataViewType Single 258private static volatile NumberDataViewType _instDouble; 260/// The singleton instance of the <see cref="NumberDataViewType"/> with representation type of <see cref="double"/>. 262public static NumberDataViewType Double 276Debug.Assert(other == null || !(other is NumberDataViewType) || other.RawType != RawType);
KeyDataViewType.cs (4)
106return NumberDataViewType.UInt32.ToString(); 108return NumberDataViewType.UInt64.ToString(); 110return NumberDataViewType.UInt16.ToString(); 112return NumberDataViewType.Byte.ToString();
Microsoft.ML.Ensemble (20)
OutputCombiners\BaseStacking.cs (2)
117if (!(ivm.InputType is VectorDataViewType vectorType) || vectorType.ItemType != NumberDataViewType.Single) 209bldr.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single, features);
PipelineEnsemble.cs (4)
234protected override DataViewType ScoreType => NumberDataViewType.Single; 280_scoreType = new VectorDataViewType(NumberDataViewType.Single, classCount); 287_scoreType = new VectorDataViewType(NumberDataViewType.Single, classCount); 294protected override DataViewType ScoreType { get { return NumberDataViewType.Single; } }
Selector\SubModelSelector\BaseSubModelSelector.cs (1)
114scoreCol.Index, AnnotationUtils.Const.ScoreValueKind.Probability, NumberDataViewType.Single.Equals);
Trainer\EnsembleDistributionModelParameters.cs (6)
50DataViewType IValueMapper.OutputType => NumberDataViewType.Single; 51DataViewType IValueMapperDist.DistType => NumberDataViewType.Single; 102return inputType ?? new VectorDataViewType(NumberDataViewType.Single); 108&& mapper.InputType is VectorDataViewType inVectorType && inVectorType.ItemType == NumberDataViewType.Single 109&& mapper.OutputType == NumberDataViewType.Single 110&& mapper.DistType == NumberDataViewType.Single)
Trainer\EnsembleModelParameters.cs (4)
46DataViewType IValueMapper.OutputType => NumberDataViewType.Single; 93return inputType ?? new VectorDataViewType(NumberDataViewType.Single); 99&& mapper.InputType is VectorDataViewType inputVectorType && inputVectorType.ItemType == NumberDataViewType.Single 100&& mapper.OutputType == NumberDataViewType.Single)
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (3)
91inputType = new VectorDataViewType(NumberDataViewType.Single); 158&& mapper.InputType is VectorDataViewType inVectorType && inVectorType.ItemType == NumberDataViewType.Single 160&& outVectorType.Size > 0 && outVectorType.ItemType == NumberDataViewType.Single)
Microsoft.ML.EntryPoints (5)
CrossValidationMacro.cs (1)
390EvaluateUtils.ReconcileSlotNames<double>(env, input.ConfusionMatrix, MetricKinds.ColumnNames.Count, NumberDataViewType.Double);
FeatureCombiner.cs (4)
181if (type is NumberDataViewType || type is BooleanDataViewType) 275if (predictedLabelType is NumberDataViewType || predictedLabelType is BooleanDataViewType) 297if (labelType == NumberDataViewType.Single || !(labelType is NumberDataViewType))
Microsoft.ML.FastTree (47)
FastTree.cs (8)
1403var copier = GetCopier<float, double>(NumberDataViewType.Single, NumberDataViewType.Double); 1473var copier = GetCopier<float, double>(NumberDataViewType.Single, NumberDataViewType.Double); 2853InputType = new VectorDataViewType(NumberDataViewType.Single, NumFeatures); 2854OutputType = NumberDataViewType.Single; 2891InputType = new VectorDataViewType(NumberDataViewType.Single, NumFeatures); 2892OutputType = NumberDataViewType.Single;
FastTreeClassification.cs (2)
316new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 317new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
FastTreeRanking.cs (2)
129if (!labelCol.IsKey && labelCol.ItemType != NumberDataViewType.Single) 489new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
FastTreeRegression.cs (2)
143return new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false); 205new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
FastTreeTweedie.cs (2)
211new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) 364new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamClassification.cs (2)
187new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 188new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
GamModelParameters.cs (6)
112_inputType = new VectorDataViewType(NumberDataViewType.Single, _numInputFeatures); 113_outputType = NumberDataViewType.Single; 162_inputType = new VectorDataViewType(NumberDataViewType.Single, _numInputFeatures); 163_outputType = NumberDataViewType.Single; 680builder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, _labels); 681builder.AddColumn(DefaultColumnNames.Score, NumberDataViewType.Single, _scores);
GamRegression.cs (1)
139new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
RandomForestClassification.cs (1)
379new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
RandomForestRegression.cs (1)
508new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
TreeEnsembleFeaturizationEstimator.cs (3)
138SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 142SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 146SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
TreeEnsembleFeaturizer.cs (4)
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); 789return LambdaColumnMapper.Create(env, "Key to Float Mapper", input, col, col, type, NumberDataViewType.Single, mapper);
Utils\RegressionTreeBaseUtils.cs (13)
99builder.AddColumn("Bias", NumberDataViewType.Double, Enumerable.Repeat(bias, numberOfRows).ToArray()); 100builder.AddColumn("TreeWeights", NumberDataViewType.Double, treeWeightsList.ToArray()); 101builder.AddColumn("TreeID", NumberDataViewType.Int32, treeId.ToArray()); 103builder.AddColumn(nameof(RegressionTreeBase.LeftChild), NumberDataViewType.Int32, leftChild.ToArray()); 104builder.AddColumn(nameof(RegressionTreeBase.RightChild), NumberDataViewType.Int32, rightChild.ToArray()); 105builder.AddColumn(nameof(RegressionTreeBase.NumericalSplitFeatureIndexes), NumberDataViewType.Int32, numericalSplitFeatureIndexes.ToArray()); 106builder.AddColumn(nameof(RegressionTreeBase.NumericalSplitThresholds), NumberDataViewType.Single, numericalSplitThresholds.ToArray()); 108builder.AddColumn(nameof(RegressionTreeBase.LeafValues), NumberDataViewType.Double, leafValues.ToArray()); 109builder.AddColumn(nameof(RegressionTreeBase.SplitGains), NumberDataViewType.Double, splitGains.ToArray()); 110builder.AddColumn("CategoricalSplitFeatures", NumberDataViewType.Int32, categoricalSplitFeatures.ToArray()); 111builder.AddColumn("CategoricalCategoricalSplitFeatureRange", NumberDataViewType.Int32, categoricalCategoricalSplitFeatureRange.ToArray()); 138builder.AddColumn("LeafSamples", NumberDataViewType.Double, leafSamples.ToArray()); 139builder.AddColumn("LeafSampleWeights", NumberDataViewType.Double, leafSampleWeights.ToArray());
Microsoft.ML.ImageAnalytics (17)
ImageLoader.cs (2)
365return new VectorDataViewType(NumberDataViewType.Byte); 451result[outputColumnName] = new SchemaShape.Column(outputColumnName, SchemaShape.Column.VectorKind.VariableVector, NumberDataViewType.Byte, false);
ImagePixelExtractor.cs (7)
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); 820var itemType = colInfo.OutputAsFloatArray ? NumberDataViewType.Single : NumberDataViewType.Byte;
VectorToImageTransform.cs (8)
336if (sourceItemType == NumberDataViewType.Single || sourceItemType == NumberDataViewType.Double) 337return GetterFromType<float>(NumberDataViewType.Single, input, iinfo, ex, needScale); 338else if (sourceItemType == NumberDataViewType.Byte) 339return GetterFromType<byte>(NumberDataViewType.Byte, input, iinfo, ex, false); 751if (col.Kind != SchemaShape.Column.VectorKind.Vector || (col.ItemType != NumberDataViewType.Single && col.ItemType != NumberDataViewType.Double && col.ItemType != NumberDataViewType.Byte))
Microsoft.ML.IntegrationTests (2)
ModelFiles.cs (1)
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 (10)
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);
KMeansPlusPlusTrainer.cs (4)
309NumberDataViewType.Single, 315NumberDataViewType.UInt32, 974arrDv.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single, clusters); 975arrDv.AddColumn(DefaultColumnNames.Weight, NumberDataViewType.Single, totalWeights);
Microsoft.ML.LightGbm (12)
LightGbmBinaryTrainer.cs (3)
271if (!(labelType is BooleanDataViewType || labelType is KeyDataViewType || labelType == NumberDataViewType.Single)) 286new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 287new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
LightGbmMulticlassTrainer.cs (3)
241if (!(labelType is BooleanDataViewType || labelType is KeyDataViewType || labelType == NumberDataViewType.Single)) 370new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 371new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata)
LightGbmRankingTrainer.cs (4)
250if (!(labelType is KeyDataViewType || labelType == NumberDataViewType.Single)) 260if (!(groupType == NumberDataViewType.UInt32 || groupType is KeyDataViewType)) 277if (!labelCol.IsKey && labelCol.ItemType != NumberDataViewType.Single) 302new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LightGbmRegressionTrainer.cs (2)
233if (!(labelType is BooleanDataViewType || labelType is KeyDataViewType || labelType == NumberDataViewType.Single)) 250new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.Mkl.Components (11)
OlsLinearRegression.cs (6)
138new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())) 162if (typeLab != NumberDataViewType.Single) 163throw ch.Except("Incompatible labelColumn column type {0}, must be {1}", typeLab, NumberDataViewType.Single); 168throw ch.Except("Incompatible feature column type {0}, must be known sized vector of {1}", typeFeat, NumberDataViewType.Single); 169if (typeFeat.ItemType != NumberDataViewType.Single) 170throw ch.Except("Incompatible feature column type {0}, must be vector of {1}", typeFeat, NumberDataViewType.Single);
SymSgdClassificationTrainer.cs (3)
257Conversions.DefaultInstance.GetIsDefaultPredicate<float>(NumberDataViewType.Single)); 276new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 277new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
VectorWhitening.cs (2)
225|| itemType != NumberDataViewType.Single) 591DataViewType outType = (info.Kind == WhiteningKind.PrincipalComponentAnalysis && info.Rank > 0) ? new VectorDataViewType(NumberDataViewType.Single, info.Rank) : _srcTypes[iinfo];
Microsoft.ML.OnnxConverter (2)
SaveOnnxCommand.cs (2)
237var labelEncoderOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, labelEncoderOutputName, true); 242ctx.AddOutputVariable(NumberDataViewType.Int64, labelEncoderOutput);
Microsoft.ML.OnnxTransformer (10)
OnnxTypeParser.cs (10)
124scalarType = NumberDataViewType.SByte; 127scalarType = NumberDataViewType.Byte; 130scalarType = NumberDataViewType.Int16; 133scalarType = NumberDataViewType.UInt16; 136scalarType = NumberDataViewType.Int32; 139scalarType = NumberDataViewType.UInt32; 142scalarType = NumberDataViewType.Int64; 145scalarType = NumberDataViewType.UInt64; 148scalarType = NumberDataViewType.Single; 151scalarType = NumberDataViewType.Double;
Microsoft.ML.Parquet (13)
ParquetLoader.cs (13)
333return NumberDataViewType.Byte; 335return NumberDataViewType.SByte; 337return NumberDataViewType.Byte; 339return NumberDataViewType.Int16; 341return NumberDataViewType.UInt16; 343return NumberDataViewType.Int16; 345return NumberDataViewType.UInt16; 347return NumberDataViewType.Int32; 349return NumberDataViewType.Int64; 353return new VectorDataViewType(NumberDataViewType.Byte); 357return NumberDataViewType.Single; 359return NumberDataViewType.Double; 361return NumberDataViewType.Double;
Microsoft.ML.PCA (14)
PcaTrainer.cs (7)
202return new SchemaShape.Column(weightColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false); 207return new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 378NumberDataViewType.Single, 472_inputType = new VectorDataViewType(NumberDataViewType.Single, _dimension); 516_inputType = new VectorDataViewType(NumberDataViewType.Single, _dimension); 602bldr.AddColumn("VectorData", NumberDataViewType.Single, cols); 614get { return NumberDataViewType.Single; }
PcaTransformer.cs (7)
106public DataViewType OutputType => new VectorDataViewType(NumberDataViewType.Single, Rank); 511if (!(type is VectorDataViewType vectorType && vectorType.Size > 1 && vectorType.ItemType.Equals(NumberDataViewType.Single))) 534Contracts.CheckParam(schema[weightIndex].Type == NumberDataViewType.Single, nameof(weightColumn)); 556new VectorDataViewType(NumberDataViewType.Single, _parent._transformInfos[i].Dimension).ToString(), colSchemaInfo.InputType.ToString()); 638new VectorDataViewType(NumberDataViewType.Single, transformInfo.Dimension); 824if (col.Kind != SchemaShape.Column.VectorKind.Vector || !col.ItemType.Equals(NumberDataViewType.Single)) 828SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Microsoft.ML.PerformanceTests (6)
CacheDataViewBench.cs (1)
35builder.AddColumn("A", NumberDataViewType.Int32, values);
HashBench.cs (5)
161InitMapMurmurHashV2(5.0f, NumberDataViewType.Single); 173InitMapMurmurHashV2(5.0, NumberDataViewType.Double); 212InitDenseVecMap(new[] { 1f, 2f, 3f, 4f, 5f }, NumberDataViewType.Single); 224InitDenseVecMap(new[] { 1d, 2d, 3d, 4d, 5d }, NumberDataViewType.Double); 273InitMapMurmurHashV1(5.0f, NumberDataViewType.Single);
Microsoft.ML.Predictor.Tests (12)
TestTransposer.cs (12)
161builder.AddColumn("A", NumberDataViewType.Int32, dataA); 163builder.AddColumn("B", NumberDataViewType.Double, GenerateHelper(rowCount, 0.8, rgen, rgen.NextDouble, 50, 0, 25, 49)); 165builder.AddColumn("C", NumberDataViewType.Int16, GenerateHelper(rowCount, 0.1, rgen, () => (short)1, 30, 3, 10, 24)); 167builder.AddColumn("D", NumberDataViewType.Double, GenerateHelper(rowCount, 0.1, rgen, rgen.NextDouble, 3, 1)); 169builder.AddColumn("E", NumberDataViewType.UInt32, GenerateHelper(rowCount, 0.1, rgen, () => (uint)rgen.Next(int.MinValue, int.MaxValue))); 171builder.AddColumn("F", NumberDataViewType.Int32, GenerateHelper(rowCount, 0.8, rgen, () => rgen.Next())); 227builder.AddColumn("A", NumberDataViewType.Int32, dataA); 229builder.AddColumn("B", NumberDataViewType.Double, GenerateHelper(rowCount, 0.8, rgen, rgen.NextDouble, 50, 0, 25, 49)); 231builder.AddColumn("C", NumberDataViewType.Int16, GenerateHelper(rowCount, 0.1, rgen, () => (short)1, 30, 3, 10, 24)); 233builder.AddColumn("D", NumberDataViewType.Double, GenerateHelper(rowCount, 0.1, rgen, rgen.NextDouble, 3, 1)); 235builder.AddColumn("E", NumberDataViewType.UInt32, GenerateHelper(rowCount, 0.1, rgen, () => (uint)rgen.Next(int.MinValue, int.MaxValue))); 237builder.AddColumn("F", NumberDataViewType.Int32, GenerateHelper(rowCount, 0.8, rgen, () => (int)rgen.Next()));
Microsoft.ML.Recommender (17)
MatrixFactorizationPredictor.cs (3)
87private DataViewType OutputType => NumberDataViewType.Single; 402var matrixColumnIndexGetter = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, input, _matrixColumnIndexColumnIndex); 403var matrixRowIndexGetter = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, input, _matrixRowIndexCololumnIndex);
MatrixFactorizationTrainer.cs (14)
444if (labelCol.Type != NumberDataViewType.Single && labelCol.Type != NumberDataViewType.Double) 453if (validLabelCol.Type != NumberDataViewType.Single && validLabelCol.Type != NumberDataViewType.Double) 477var labGetter = RowCursorUtils.GetGetterAs<float>(NumberDataViewType.Single, cursor, data.Schema.Label.Value.Index); 478var matrixColumnIndexGetter = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, cursor, matrixColumnIndexColInfo.Index); 479var matrixRowIndexGetter = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, cursor, matrixRowIndexColInfo.Index); 495ValueGetter<float> validLabelGetter = RowCursorUtils.GetGetterAs<float>(NumberDataViewType.Single, validCursor, validData.Schema.Label.Value.Index); 496var validMatrixColumnIndexGetter = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, validCursor, validMatrixColumnIndexColInfo.Index); 497var validMatrixRowIndexGetter = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, validCursor, validMatrixRowIndexColInfo.Index); 569var labelColumn = new SchemaShape.Column(LabelName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false); 573var matrixColumnIndexColumn = new SchemaShape.Column(MatrixColumnIndexName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true); 574var matrixRowIndexColumn = new SchemaShape.Column(MatrixRowIndexName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true); 595new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Microsoft.ML.StandardTrainers (127)
FactorizationMachine\FactorizationMachineTrainer.cs (9)
233FeatureColumns[0] = new SchemaShape.Column(options.FeatureColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 237FeatureColumns[i + 1] = new SchemaShape.Column(options.ExtraFeatureColumns[i], SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 240WeightColumn = options.ExampleWeightColumnName != null ? new SchemaShape.Column(options.ExampleWeightColumnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) : default; 266FeatureColumns[i] = new SchemaShape.Column(featureColumnNames[i], SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 269WeightColumn = exampleWeightColumnName != null ? new SchemaShape.Column(exampleWeightColumnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) : default; 425vectorType.ItemType != NumberDataViewType.Single) 492var weightGetter = data.Schema.Weight?.Index is int weightIdx ? RowCursorUtils.GetGetterAs<float>(NumberDataViewType.Single, cursor, weightIdx) : null; 661new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 662new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (2)
79Contracts.CheckParam(outputSchema[0].Type is NumberDataViewType, nameof(outputSchema)); 80Contracts.CheckParam(outputSchema[1].Type is NumberDataViewType, nameof(outputSchema));
LdSvm\LdSvmModelParameters.cs (3)
84InputType = new VectorDataViewType(NumberDataViewType.Single, _w[0].Length); 121InputType = new VectorDataViewType(NumberDataViewType.Single, numFeatures); 266public DataViewType OutputType => NumberDataViewType.Single;
LdSvm\LdSvmTrainer.cs (1)
184new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Standard\LinearModelParameters.cs (5)
128_inputType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 202_inputType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 306get { return NumberDataViewType.Single; } 380var colType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 382builder.AddPrimitiveValue("Bias", NumberDataViewType.Single, Bias);
Standard\LogisticRegression\LogisticRegression.cs (2)
173new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 174new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
Standard\LogisticRegression\MulticlassLogisticRegression.cs (12)
378new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 379new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata) 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); 988string classifierLabelOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "ClassifierLabelOutput", true); 999var unsqueezeOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "CastNodeOutput"); 1103bldr.AddColumn("Bias", NumberDataViewType.Single, Biases); 1104bldr.AddColumn("Weights", getSlotNames, NumberDataViewType.Single, Weights);
Standard\ModelStatistics.cs (9)
185builder.AddPrimitiveValue("Count of training examples", NumberDataViewType.Int64, TrainingExampleCount); 186builder.AddPrimitiveValue("Residual Deviance", NumberDataViewType.Single, Deviance); 187builder.AddPrimitiveValue("Null Deviance", NumberDataViewType.Single, NullDeviance); 188builder.AddPrimitiveValue("AIC", NumberDataViewType.Single, 2 * ParametersCount + Deviance); 566builder.AddPrimitiveValue("BiasEstimate", NumberDataViewType.Single, biasStats.Estimate); 567builder.AddPrimitiveValue("BiasStandardError", NumberDataViewType.Single, biasStats.StandardError); 568builder.AddPrimitiveValue("BiasZScore", NumberDataViewType.Single, biasStats.ZScore); 569builder.AddPrimitiveValue("BiasPValue", NumberDataViewType.Single, biasStats.PValue); 581var colType = new VectorDataViewType(NumberDataViewType.Single, stdErr.Length);
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (3)
71LabelColumn = new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true); 177new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, 179new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32,
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (15)
124new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 125new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, predLabelMetadata) 138Host.Check(labelCol.Type == NumberDataViewType.Single || labelCol.Type is KeyDataViewType, 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); 466var isFeaturePresent = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, 1, _featureHistogram[0].Length), "isFeaturePresent"); 531castOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "CastOutput"); 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 (24)
195Host.Assert(label.Type.GetKeyCount() > 0 || label.Type == NumberDataViewType.Single || label.Type == NumberDataViewType.Double); 201return MapLabelsCore(NumberDataViewType.UInt32, (in uint val) => key == val, data); 315ivmd.OutputType != NumberDataViewType.Single || 316ivmd.DistType != NumberDataViewType.Single)) 363DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length); 395DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length); 520if (mapper.OutputType != NumberDataViewType.Single) 522if (!(mapper.InputType is VectorDataViewType mapperVectorType) || mapperVectorType.ItemType != NumberDataViewType.Single) 546predictorOutputNames[0] = ctx.AddIntermediateVariable(NumberDataViewType.UInt32, $"{DefaultColumnNames.PredictedLabel}_{i}", true); 547predictorOutputNames[1] = ctx.AddIntermediateVariable(NumberDataViewType.Single, $"{DefaultColumnNames.Score}_{i}", true); 548predictorOutputNames[2] = ctx.AddIntermediateVariable(NumberDataViewType.Single, $"{DefaultColumnNames.Probability}_{i}", true); 558var clipOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, $"ClipOutput_{i}", true); 577var argMaxOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "ArgMaxOutput"); 584var addOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "AddOutput"); 668var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length); 707return base.IsValid(mapper, ref inputType) && mapper.DistType == NumberDataViewType.Single; 802var sumOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "SumOfScores"); 816var castIsZeroSumToFloat = ctx.AddIntermediateVariable(NumberDataViewType.Single, "IsSumZeroAsFloat"); 822var sumOutputNonZero = ctx.AddIntermediateVariable(NumberDataViewType.Single, "SumOfScoresNonZero"); 830divOutputs[i] = ctx.AddIntermediateVariable(NumberDataViewType.Single, $"DivOutput_{i}"); 835var type = new VectorDataViewType(NumberDataViewType.Single, divOutputs.Length); 924var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length); 934var sumOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "SumOutput");
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (8)
168Host.Assert(label.Type.GetKeyCount() > 0 || label.Type == NumberDataViewType.Single || label.Type == NumberDataViewType.Double); 175return MapLabelsCore(NumberDataViewType.UInt32, (in uint val) => val == key1 || val == key2, data); 283_outputType = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 311_outputType = new VectorDataViewType(NumberDataViewType.Single, _numClasses); 332if (vectorType == null || !vectorType.IsKnownSize || vectorType.ItemType != NumberDataViewType.Single) 338if (mapper.OutputType != NumberDataViewType.Single) 340if (mapper.DistType != NumberDataViewType.Single)
Standard\Online\AveragedPerceptron.cs (1)
201new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Standard\Online\LinearSvm.cs (1)
309new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Standard\Online\OnlineGradientDescent.cs (1)
172new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\PoissonRegression\PoissonRegression.cs (1)
123new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\SdcaBinary.cs (13)
1534Conversions.DefaultInstance.GetIsDefaultPredicate<float>(NumberDataViewType.Single)); 1627NumberDataViewType.Single, 1633NumberDataViewType.Single, 1726NumberDataViewType.Single, 1784NumberDataViewType.Single, 1802NumberDataViewType.Single, 1822Conversions.DefaultInstance.GetIsDefaultPredicate<float>(NumberDataViewType.Single)); 2223Conversions.DefaultInstance.GetIsDefaultPredicate<float>(NumberDataViewType.Single)); 2303new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 2304new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))), 2392new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 2446new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 2447new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
Standard\SdcaMulticlass.cs (2)
168new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 169new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata)
Standard\SdcaRegression.cs (2)
153Conversions.DefaultInstance.GetIsDefaultPredicate<float>(NumberDataViewType.Single)); 197new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Simple\SimpleTrainers.cs (13)
65DataViewType IValueMapper.OutputType => NumberDataViewType.Single; 66DataViewType IValueMapperDist.DistType => NumberDataViewType.Single; 81_inputType = new VectorDataViewType(NumberDataViewType.Single); 98_inputType = new VectorDataViewType(NumberDataViewType.Single); 263if (data.Schema.Weight?.Type == NumberDataViewType.Single) 301=> new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 304=> new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false); 318new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 319new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))), 366_inputType = new VectorDataViewType(NumberDataViewType.Single); 380_inputType = new VectorDataViewType(NumberDataViewType.Single); 442DataViewType IValueMapper.OutputType => NumberDataViewType.Single; 443DataViewType IValueMapperDist.DistType => NumberDataViewType.Single;
Microsoft.ML.Sweeper (2)
Algorithms\SmacSweeper.cs (2)
126dvBuilder.AddColumn(DefaultColumnNames.Label, NumberDataViewType.Single, targets); 127dvBuilder.AddColumn(DefaultColumnNames.Features, NumberDataViewType.Single, features);
Microsoft.ML.TensorFlow (11)
TensorflowUtils.cs (11)
161return NumberDataViewType.Single; 163return NumberDataViewType.Single; 165return NumberDataViewType.Double; 167return NumberDataViewType.Byte; 169return NumberDataViewType.UInt16; 171return NumberDataViewType.UInt32; 173return NumberDataViewType.UInt64; 175return NumberDataViewType.SByte; 177return NumberDataViewType.Int16; 179return NumberDataViewType.Int32; 181return NumberDataViewType.Int64;
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.TestFramework (25)
BaseTestBaseline.cs (10)
701if (leftType == NumberDataViewType.SByte) 703else if (leftType == NumberDataViewType.Byte) 705else if (leftType == NumberDataViewType.Int16) 707else if (leftType == NumberDataViewType.UInt16) 709else if (leftType == NumberDataViewType.Int32) 711else if (leftType == NumberDataViewType.UInt32) 713else if (leftType == NumberDataViewType.Int64) 715else if (leftType == NumberDataViewType.UInt64) 717else if (leftType == NumberDataViewType.Single) 719else if (leftType == NumberDataViewType.Double)
DataPipe\TestDataPipe.cs (15)
1070TestHashTransformHelper(_dataFloat, _resultsFloat, NumberDataViewType.Single); 1078TestHashTransformVectorHelper(data, results, NumberDataViewType.Single); 1085TestHashTransformVectorHelper(_dataFloatSparse, results, NumberDataViewType.Single); 1092TestHashTransformVectorHelper(_dataDoubleSparse, results, NumberDataViewType.Double); 1098TestHashTransformHelper(_dataDouble, _resultsDouble, NumberDataViewType.Double); 1106TestHashTransformVectorHelper(data, results, NumberDataViewType.Double); 1109private void TestHashTransformHelper<T>(T[] data, uint[] results, NumberDataViewType type) 1130private void TestHashTransformVectorHelper<T>(T[][] data, uint[][] results, NumberDataViewType type) 1137private void TestHashTransformVectorHelper<T>(VBuffer<T> data, uint[][] results, NumberDataViewType type) 1173builder.AddColumn("Foo", NumberDataViewType.Single, values); 1183builder.AddColumn("Bar", NumberDataViewType.Int32, barValues); 1260builder.AddColumn("Foo", NumberDataViewType.Int32, new int[0]); 1261builder.AddColumn("Bar", NumberDataViewType.UInt16, new ushort[0]); 1544builder.AddColumn("F1V", NumberDataViewType.Single, data); 1601builder.AddColumn(colName, NumberDataViewType.Single, data);
Microsoft.ML.Tests (70)
CalibratedModelParametersTests.cs (5)
126bldr.AddColumn("X1", NumberDataViewType.Single, x1Array); 127bldr.AddColumn("X2Important", NumberDataViewType.Single, x2Array); 128bldr.AddColumn("X3", NumberDataViewType.Single, x3Array); 129bldr.AddColumn("X4Rand", NumberDataViewType.Single, x4RandArray); 130bldr.AddColumn("Label", NumberDataViewType.Single, yArray);
FakeSchemaTest.cs (5)
24metadataBuilder.Add("M", NumberDataViewType.Single, (ref float v) => v = 484f); 26schemaBuilder.AddColumn("A", new VectorDataViewType(NumberDataViewType.Single, 94)); 28schemaBuilder.AddColumn("C", NumberDataViewType.Int32, metadataBuilder.ToAnnotations()); 39Assert.Equal(NumberDataViewType.Single, columnA.Type.GetItemType()); 47Assert.Equal(NumberDataViewType.Int32, columnC.Type);
FeatureContributionTests.cs (5)
306bldr.AddColumn("X1", NumberDataViewType.Single, x1Array); 307bldr.AddColumn("X2VBuffer", NumberDataViewType.Single, vbArray); 308bldr.AddColumn("X3Important", NumberDataViewType.Single, x3Array); 309bldr.AddColumn("Label", NumberDataViewType.Single, yArray); 311bldr.AddColumn("GroupId", NumberDataViewType.UInt32, CreateGroupIds(yArray.Length));
PermutationFeatureImportanceTests.cs (11)
849bldr.AddColumn("X1", NumberDataViewType.Single, x1Array); 850bldr.AddColumn("X2Important", NumberDataViewType.Single, x2Array); 851bldr.AddColumn("X3", NumberDataViewType.Single, x3Array); 852bldr.AddColumn("X4Rand", NumberDataViewType.Single, x4RandArray); 853bldr.AddColumn("Label", NumberDataViewType.Single, yArray); 855bldr.AddColumn("GroupId", NumberDataViewType.UInt32, CreateGroupIds(yArray.Length)); 930bldr.AddColumn("X1", NumberDataViewType.Single, x1Array); 931bldr.AddColumn("X2VBuffer", NumberDataViewType.Single, vbArray); 932bldr.AddColumn("X3Important", NumberDataViewType.Single, x3Array); 933bldr.AddColumn("Label", NumberDataViewType.Single, yArray); 935bldr.AddColumn("GroupId", NumberDataViewType.UInt32, CreateGroupIds(yArray.Length));
RangeFilterTests.cs (1)
24builder.AddColumn("Floats", NumberDataViewType.Single, new float[] { 1, 2, 3 });
Scenarios\Api\TestApi.cs (2)
205var coltypeFloat = NumberDataViewType.Single;
SvmLightTests.cs (8)
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); 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);
TextLoaderTests.cs (2)
754Assert.Equal(NumberDataViewType.Single, previewIris.Schema[0].Type); 852Assert.Equal(NumberDataViewType.Single, previewIris.Schema[0].Type);
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (3)
63Assert.Equal(NumberDataViewType.Single, treeValuesType.ItemType); 81Assert.Equal(NumberDataViewType.Single, treeLeafIdsType.ItemType); 104Assert.Equal(NumberDataViewType.Single, treePathIdsType.ItemType);
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\ExpressionTransformerTests.cs (5)
50Assert.True(transformed.Schema["Expr1"].Type == NumberDataViewType.Double); 52Assert.True(transformed.Schema["Expr2"].Type.GetItemType() == NumberDataViewType.Single); 53Assert.True(transformed.Schema["Expr3"].Type == NumberDataViewType.Single); 54Assert.True(transformed.Schema["Expr4"].Type.GetItemType() == NumberDataViewType.Double); 56Assert.True(transformed.Schema["Expr5"].Type == NumberDataViewType.Int32);
Transformers\HashTests.cs (16)
232HashTestCore((byte)value, NumberDataViewType.Byte, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 237HashTestCore((ushort)value, NumberDataViewType.UInt16, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 242HashTestCore((uint)value, NumberDataViewType.UInt32, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 248HashTestCore((sbyte)value, NumberDataViewType.SByte, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 250HashTestCore((short)value, NumberDataViewType.Int16, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 252HashTestCore((int)value, NumberDataViewType.Int32, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 262HashTestCore(value, NumberDataViewType.UInt64, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 266HashTestCore((long)value, NumberDataViewType.Int64, expected, expectedOrdered, expectedOrdered3, expectedCombined, expectedCombinedSparse); 302HashTestCore(1f, NumberDataViewType.Single, 463, 855, 732, 56, 557); 303HashTestCore(-1f, NumberDataViewType.Single, 252, 612, 780, 116, 515); 304HashTestCore(0f, NumberDataViewType.Single, 842, 358, 20, 429, 333); 305HashTestCore(float.NaN, NumberDataViewType.Single, 0, 0, 0, 0, 0); 307HashTestCore(1d, NumberDataViewType.Double, 188, 57, 690, 655, 896); 308HashTestCore(-1d, NumberDataViewType.Double, 885, 804, 22, 461, 309); 309HashTestCore(0d, NumberDataViewType.Double, 512, 851, 795, 333, 113); 310HashTestCore(double.NaN, NumberDataViewType.Double, 0, 0, 0, 0, 0);
Transformers\TextFeaturizerTests.cs (1)
728builder.AddColumn("F1V", NumberDataViewType.Single, data);
Microsoft.ML.TimeSeries (35)
AdaptiveSingularSpectrumSequenceModeler.cs (2)
1212if (featureCol.Type != NumberDataViewType.Single) 1557if (data.Schema.Feature.Value.Type != NumberDataViewType.Single)
IidAnomalyDetectionBase.cs (2)
127if (colType != NumberDataViewType.Single) 128throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName, NumberDataViewType.Single.ToString(), colType.ToString());
IidChangePointDetector.cs (2)
267if (col.ItemType != NumberDataViewType.Single) 276Transformer.InternalTransform.OutputColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
IidSpikeDetector.cs (2)
243if (col.ItemType != NumberDataViewType.Single) 251Transformer.InternalTransform.OutputColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
SequentialAnomalyDetectionTransformBase.cs (3)
171: base(Contracts.CheckRef(env, nameof(env)).Register(name), windowSize, initialWindowSize, outputColumnName, inputColumnName, new VectorDataViewType(NumberDataViewType.Double, GetOutputLength(alertingScore, env))) 320if (colType != NumberDataViewType.Single) 336info[0] = new DataViewSchema.DetachedColumn(_parent.OutputColumnName, new VectorDataViewType(NumberDataViewType.Double, _parent.OutputLength), meta.ToAnnotations());
SequentialForecastingTransformBase.cs (6)
64confidenceUpperBoundColumn, inputColumnName, new VectorDataViewType(NumberDataViewType.Single, outputLength)) 117if (colType != NumberDataViewType.Single) 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));
SrCnnAnomalyDetectionBase.cs (2)
118if (colType != NumberDataViewType.Single) 119throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName, NumberDataViewType.Single.ToString(), colType.ToString());
SRCNNAnomalyDetector.cs (2)
275if (col.ItemType != NumberDataViewType.Single) 283Transformer.InternalTransform.OutputColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
SrCnnEntireAnomalyDetector.cs (1)
200_bindings = new Bindings(input.Schema, inputColumnName, outputColumnName, new VectorDataViewType(NumberDataViewType.Double, _outputLength));
SrCnnTransformBase.cs (3)
71: base(Contracts.CheckRef(env, nameof(env)).Register(name), windowSize, initialWindowSize, outputColumnName, inputColumnName, new VectorDataViewType(NumberDataViewType.Double, 3)) 163if (colType != NumberDataViewType.Single) 179info[0] = new DataViewSchema.DetachedColumn(_parent.OutputColumnName, new VectorDataViewType(NumberDataViewType.Double, _parent.OutputLength), meta.ToAnnotations());
SsaAnomalyDetectionBase.cs (1)
253if (colType != NumberDataViewType.Single)
SsaChangePointDetector.cs (2)
303if (col.ItemType != NumberDataViewType.Single) 311_options.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
SSaForecasting.cs (4)
336if (col.ItemType != NumberDataViewType.Single) 341_options.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 347NumberDataViewType.Single, false); 351NumberDataViewType.Single, false);
SsaForecastingBase.cs (1)
177if (colType != NumberDataViewType.Single)
SsaSpikeDetector.cs (2)
282if (col.ItemType != NumberDataViewType.Single) 290_options.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
Microsoft.ML.TorchSharp (36)
AutoFormerV2\ObjectDetectionTrainer.cs (14)
457NumberDataViewType.UInt32, true)); 465NumberDataViewType.UInt32, true, new SchemaShape(metadata.ToArray())); 468NumberDataViewType.Single, false); 471NumberDataViewType.Single, false, new SchemaShape(scoreMetadata.ToArray())); 490new VectorDataViewType(NumberDataViewType.Single).ToString(), boundingBoxCol.GetTypeString()); 528PredictedLabelColumnName = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.UInt32, false); 529PredictedBoundingBoxColumn = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 530ConfidenceColumn = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 558NumberDataViewType.UInt32, true)); 563NumberDataViewType.UInt32, true, predLabelMetadata); 566NumberDataViewType.Single, false); 569NumberDataViewType.Single, false, new SchemaShape(scoreMetadata.ToArray())); 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 (15)
336NumberDataViewType.UInt32, true, new SchemaShape(metadata.ToArray())); 339NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))); 351NumberDataViewType.UInt32, true, new SchemaShape(metadata.ToArray())); 356NumberDataViewType.Single, false); 376if (labelCol.ItemType != NumberDataViewType.UInt32) 378NumberDataViewType.UInt32.ToString(), labelCol.GetTypeString()); 392if (labelCol.ItemType != NumberDataViewType.UInt32) 394NumberDataViewType.UInt32.ToString(), labelCol.GetTypeString()); 398if (labelCol.ItemType != NumberDataViewType.Single) 400NumberDataViewType.Single.ToString(), labelCol.GetTypeString()); 441NumberDataViewType.UInt32, true, predLabelMetadata); 444NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelAnnotationsColumn))); 449NumberDataViewType.Single, false); 536info[1] = new DataViewSchema.DetachedColumn(Parent.Options.ScoreColumnName, new VectorDataViewType(NumberDataViewType.Single, Parent.Options.NumberOfClasses), meta.ToAnnotations()); 556info[0] = new DataViewSchema.DetachedColumn(Parent.Options.ScoreColumnName, NumberDataViewType.Single);
NasBert\SentenceSimilarityTrainer.cs (1)
252var labelCol = new DataViewSchema.DetachedColumn(options.LabelColumnName, NumberDataViewType.Single);
Roberta\QATrainer.cs (6)
517NumberDataViewType.UInt32, true)); 523NumberDataViewType.Single, false, new SchemaShape(scoreMetadata.ToArray())); 553NumberDataViewType.Int32.ToString(), answerIndexCol.GetTypeString()); 603NumberDataViewType.UInt32, true) 610NumberDataViewType.Single, false, new SchemaShape(scoreMetadata.ToArray())); 748info[1] = new DataViewSchema.DetachedColumn(_parent.Options.ScoreColumnName, new VectorDataViewType(NumberDataViewType.Single), meta.ToAnnotations());
Microsoft.ML.TorchSharp.Tests (4)
QATests.cs (2)
50Assert.Equal(NumberDataViewType.Single, estimatorSchema[5].ItemType); 59Assert.Equal(new VectorDataViewType(NumberDataViewType.Single), transformerSchema[5].Type);
TextClassificationTests.cs (2)
394Assert.Equal(NumberDataViewType.Single, estimatorSchema[3].ItemType); 401Assert.Equal(NumberDataViewType.Single, estimatorSchema[3].ItemType);
Microsoft.ML.Transforms (65)
CountFeatureSelection.cs (2)
350=> type == NumberDataViewType.Single || type == NumberDataViewType.Double || type is TextDataViewType;
Dracula\CountTableTransformer.cs (6)
226_host.Assert(type is KeyDataViewType || type is NumberDataViewType || type is BooleanDataViewType); 248var getSrc = RowCursorUtils.GetGetterAs<ulong>(NumberDataViewType.UInt64, row, col.Index); 265var getSrc = RowCursorUtils.GetGetterAs<double>(NumberDataViewType.Double, row, col.Index); 335if (!col.IsKey || !col.ItemType.Equals(NumberDataViewType.UInt32)) 345result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, meta); 617var type = new VectorDataViewType(NumberDataViewType.Single, valueCount, _parent.Featurizer.NumFeatures);
Expression\LambdaBinder.cs (4)
70node.ResultType = NumberDataViewType.Int32; 73node.ResultType = NumberDataViewType.Int64; 76node.ResultType = NumberDataViewType.Single; 79node.ResultType = NumberDataViewType.Double;
Expression\Node.cs (4)
666else if (type == NumberDataViewType.Int32) 668else if (type == NumberDataViewType.Int64) 670else if (type == NumberDataViewType.Single) 672else if (type == NumberDataViewType.Double)
GcnTransform.cs (2)
894return vectorType.ItemType == NumberDataViewType.Single; 901return col.ItemType == NumberDataViewType.Single;
KeyToVectorMapping.cs (5)
182_types[i] = new VectorDataViewType(NumberDataViewType.Single, _bitsPerKey[i]); 185_types[i] = new VectorDataViewType(NumberDataViewType.Single, srcValueCount, _bitsPerKey[i]); 363var getSrc = RowCursorUtils.GetGetterAs<uint>(NumberDataViewType.UInt32, input, srcCol); 391var getSrc = RowCursorUtils.GetVecGetterAs<uint>(NumberDataViewType.UInt32, input, srcCol); 486NumberDataViewType.Single, false, new SchemaShape(metadata));
MissingValueIndicatorTransform.cs (2)
142types[iinfo] = new VectorDataViewType(NumberDataViewType.Single, 2); 145types[iinfo] = new VectorDataViewType(NumberDataViewType.Single, vectorType.Dimensions.Add(2));
MissingValueReplacing.cs (1)
311if (!(type.GetItemType() is NumberDataViewType))
MissingValueReplacingUtils.cs (1)
19ch.Assert(type.GetItemType() is NumberDataViewType);
MutualInformationFeatureSelection.cs (10)
407type == NumberDataViewType.Single || type == NumberDataViewType.Double || type == NumberDataViewType.Int32; 521if (labelType == NumberDataViewType.Int32) 528else if (labelType == NumberDataViewType.Single) 535else if (labelType == NumberDataViewType.Double) 597if (itemType == NumberDataViewType.Int32) 605if (itemType == NumberDataViewType.Single) 613if (itemType == NumberDataViewType.Double) 769var conv = Data.Conversion.Conversions.DefaultInstance.GetStandardConversion<T, uint>(colType, NumberDataViewType.UInt32, out bool identity);
RandomFourierFeaturizing.cs (4)
231if (type is VectorDataViewType vectorType && vectorType.IsKnownSize && vectorType.ItemType == NumberDataViewType.Single) 250new VectorDataViewType(NumberDataViewType.Single, _transformInfos[col].SrcDim).ToString(), type.ToString()); 489_types[i] = new VectorDataViewType(NumberDataViewType.Single, _parent._transformInfos[i].RotationTerms == null ? 733result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
SvmLight\SvmLightLoader.cs (4)
145_tryFloatParse = Conversions.DefaultInstance.GetTryParseConversion<float>(NumberDataViewType.Single); 146_tryLongParse = Conversions.DefaultInstance.GetTryParseConversion<long>(NumberDataViewType.Int64); 676var parser = Conversions.DefaultInstance.GetTryParseConversion<ulong>(NumberDataViewType.UInt64); 722schemaDef[0].ColumnType = new VectorDataViewType(NumberDataViewType.Single, keyCount);
Text\LdaTransform.cs (7)
580if (srcType == null || !srcType.IsKnownSize || !(srcType.ItemType is NumberDataViewType)) 591result[i] = new DataViewSchema.DetachedColumn(_parent.ColumnPairs[i].outputColumnName, new VectorDataViewType(NumberDataViewType.Single, info.NumberOfTopics), null); 607var getSrc = RowCursorUtils.GetVecGetterAs<Double>(NumberDataViewType.Double, input, _srcCols[iinfo]); 842if (srcColType == null || !srcColType.IsKnownSize || !(srcColType.ItemType is NumberDataViewType)) 870getters[i] = RowCursorUtils.GetVecGetterAs<Double>(NumberDataViewType.Double, cursor, srcCols[i]); 949getters[i] = RowCursorUtils.GetVecGetterAs<Double>(NumberDataViewType.Double, cursor, srcCols[i]); 1331result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Text\NgramHashingTransformer.cs (3)
407_types[i] = new VectorDataViewType(NumberDataViewType.Single, 1 << _parent._columns[i].NumberOfBits); 564getSrc[isrc] = RowCursorUtils.GetVecGetterAs<uint>(NumberDataViewType.UInt32, input, _srcIndices[iinfo][isrc]); 1229result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(metadata));
Text\NgramTransform.cs (5)
249getters[iinfo] = RowCursorUtils.GetVecGetterAs<uint>(NumberDataViewType.UInt32, cursor, srcCols[iinfo]); 491_types[i] = new VectorDataViewType(NumberDataViewType.Single, _parent._ngramMaps[i].Count); 676var getSrc = RowCursorUtils.GetVecGetterAs<uint>(NumberDataViewType.UInt32, input, _srcCols[iinfo]); 790var dataKind = _srcTypes[iinfo] == NumberDataViewType.UInt32 ? DataKind.Int32 : DataKind.Int64; 1090result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(metadata));
Text\TextFeaturizingEstimator.cs (1)
648result[OutputColumn] = new SchemaShape.Column(OutputColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false,
Text\TokenizingByCharacters.cs (2)
257var labelEncoderOutput = ctx.AddIntermediateVariable(NumberDataViewType.Int64, "LabelEncoderOutput"); 696result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, SchemaShape.Column.VectorKind.VariableVector, NumberDataViewType.UInt16, true, new SchemaShape(metadata.ToArray()));
Text\WordEmbeddingsExtractor.cs (2)
324_outputType = new VectorDataViewType(NumberDataViewType.Single, 3 * _parent._currentVocab.Dimension); 941result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Microsoft.ML.Vision (7)
ImageClassificationTrainer.cs (7)
528NumberDataViewType.Byte, false), 643NumberDataViewType.Single, false), 645NumberDataViewType.UInt32, true, new SchemaShape(metadata.ToArray())) 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);