74 references to GetItemOrDefault
Microsoft.ML.Data (5)
Evaluators\ClusteringEvaluator.cs (1)
697editor.Values[i] = scores.GetItemOrDefault(sortedIndices[i]);
Evaluators\EvaluatorUtils.cs (1)
367string.Format("{0} {1}", colName, names.GetItemOrDefault(metric.Key)), metric.Value);
Evaluators\MulticlassClassificationEvaluator.cs (1)
761editor.Values[i] = scores.GetItemOrDefault(sortedIndices[i]);
Evaluators\QuantileRegressionEvaluator.cs (1)
522(in VBuffer<Double> src, ref Double dst) => dst = src.GetItemOrDefault(index));
Scorers\FeatureContributionCalculation.cs (1)
217var slotName = slotNames.GetItemOrDefault(index);
Microsoft.ML.Ensemble (1)
OutputCombiners\MultiMedian.cs (1)
92raw[j] = i < src[j].Length ? src[j].GetItemOrDefault(i) : 0;
Microsoft.ML.FastTree (8)
FastTree.cs (2)
3157var name = names.GetItemOrDefault(pair.Key).ToString(); 3217var name = names.GetItemOrDefault(tree.SplitFeature(node)).ToString();
GamModelParameters.cs (2)
378var name = names.GetItemOrDefault(featureIndex); 817var name = context._featNames.GetItemOrDefault(index).ToString();
TreeEnsemble\InternalRegressionTree.cs (2)
1554float fv = GetFeatureValue(src.GetItemOrDefault(index), node); 1601var val = src.GetItemOrDefault(ifeat);
TreeEnsemble\InternalTreeEnsemble.cs (2)
457ReadOnlyMemory<char> name = _names.GetItemOrDefault(ifeat); 464ReadOnlyMemory<char> content = _content.GetItemOrDefault(ifeat);
Microsoft.ML.Mkl.Components (2)
OlsLinearRegression.cs (2)
918var name = names.GetItemOrDefault(i); 933var name = names.GetItemOrDefault(i);
Microsoft.ML.Predictor.Tests (2)
TestPredictors.cs (2)
954sum += vectorScores[j].GetItemOrDefault(i); 956Assert.Equal((double)vectorScore.GetItemOrDefault(i), (double)sum / predCount, 0.001);
Microsoft.ML.Samples (1)
Dynamic\ModelOperations\OnnxConversion.cs (1)
31Console.WriteLine("{0, -10} {1, -10}", "Score", value.Score.GetItemOrDefault(0));
Microsoft.ML.StandardTrainers (7)
Standard\LinearPredictorUtils.cs (1)
218var name = names.GetItemOrDefault(index);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
857var name = names.GetItemOrDefault(index);
Standard\ModelStatistics.cs (5)
344Contracts.Assert(stdError == _coeffStdError.GetItemOrDefault(0)); 378var weight = estimateEditor.Values[i - 1] = _weights.GetItemOrDefault(wi); 398editor.Values[i - 1] = slotNames.GetItemOrDefault(wi); 421var weight = _weights.GetItemOrDefault(wi); 446var name = names.GetItemOrDefault(wi).ToString();
Microsoft.ML.TestFramework (13)
BaseTestBaseline.cs (3)
774CompareScalarValues<T>(expectedVector.GetItemOrDefault(i), actualVector.GetItemOrDefault(i), precision); 784actualScalar = actualVector.GetItemOrDefault(0);
DataPipe\TestDataPipe.cs (10)
1159Assert.True(resultRow.GetItemOrDefault(i) == r[i]); 1571Assert.True(resultFirstRow.GetItemOrDefault(0) == 0); 1572Assert.True(resultFirstRow.GetItemOrDefault(2) == 0); 1573Assert.True(resultFirstRow.GetItemOrDefault(1) == 1.0); 1575Assert.True(resultSecondRow.GetItemOrDefault(0) == 0); 1576Assert.True(resultSecondRow.GetItemOrDefault(2) == 0); 1577Assert.True(resultSecondRow.GetItemOrDefault(1) == 1.0); 1579Assert.True(resultThirdRow.GetItemOrDefault(0) == 0); 1580Assert.True(resultThirdRow.GetItemOrDefault(1) == 0); 1581Assert.True(resultThirdRow.GetItemOrDefault(2) == 1.0);
Microsoft.ML.Tests (23)
Scenarios\Api\Estimators\PredictAndMetadata.cs (4)
54Assert.Equal("Iris-setosa", originalLabels.GetItemOrDefault(0).ToString()); 55Assert.Equal("Iris-versicolor", originalLabels.GetItemOrDefault(1).ToString()); 56Assert.Equal("Iris-virginica", originalLabels.GetItemOrDefault(2).ToString()); 67var deciphieredLabel = keys.GetItemOrDefault((int)prediction.PredictedLabel - 1).ToString();
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (6)
71Assert.Equal("Tree000", slotNames.GetItemOrDefault(0).ToString()); 72Assert.Equal("Tree009", slotNames.GetItemOrDefault(9).ToString()); 94Assert.Equal("Tree000Leaf000", leafIdsSlotNames.GetItemOrDefault(0).ToString()); 95Assert.Equal("Tree009Leaf004", leafIdsSlotNames.GetItemOrDefault(49).ToString()); 117Assert.Equal("Tree000Node000", pathIdsSlotNames.GetItemOrDefault(0).ToString()); 118Assert.Equal("Tree009Node003", pathIdsSlotNames.GetItemOrDefault(39).ToString());
Transformers\CategoricalTests.cs (3)
146Assert.Equal("hello", slotNames.GetItemOrDefault(0).ToString()); 147Assert.Equal("my", slotNames.GetItemOrDefault(1).ToString()); 148Assert.Equal("friend", slotNames.GetItemOrDefault(2).ToString());
Transformers\ConvertTests.cs (3)
299Assert.Equal("hello", slotNames.GetItemOrDefault(0).ToString()); 300Assert.Equal("my", slotNames.GetItemOrDefault(1).ToString()); 301Assert.Equal("friend", slotNames.GetItemOrDefault(2).ToString());
Transformers\HashTests.cs (7)
184Assert.Equal(expectedOrdered, vecResult.GetItemOrDefault(0)); 185Assert.Equal(expectedOrdered3, vecResult.GetItemOrDefault(3)); 205Assert.Equal(expected, vecResult.GetItemOrDefault(0)); 206Assert.Equal(expected, vecResult.GetItemOrDefault(3)); 207Assert.Equal(expected, vecResult.GetItemOrDefault(7)); 214Assert.Equal(expectedOrdered, vecResult.GetItemOrDefault(0)); 215Assert.Equal(expectedOrdered3, vecResult.GetItemOrDefault(3));
Microsoft.ML.TorchSharp (2)
NasBert\NerTrainer.cs (2)
181newValues[i] = target.GetItemOrDefault(++targetIndex); 185newValues[i] = target.GetItemOrDefault(targetIndex);
Microsoft.ML.TorchSharp.Tests (4)
NerTests.cs (4)
256if (labelData.GetItemOrDefault(i) == predictedLabelData.GetItemOrDefault(i) || (labelData.GetItemOrDefault(i) == default && predictedLabelData.GetItemOrDefault(i) == 0))
Microsoft.ML.Transforms (6)
HashJoiningTransform.cs (2)
558hash = hashFunction(denseSource.GetItemOrDefault(srcSlot), hash); 602hash = hashFunction(denseSource.GetItemOrDefault(srcSlot), hash);
PermutationFeatureImportance.cs (3)
151initialfeatureValuesList.Add(featuresBuffer.GetItemOrDefault(workingFeatureIndices[0])); 215nextValues[nextValuesIndex] = src.Features.GetItemOrDefault(nextFeatureIndex); 253var slotName = slotNames.GetItemOrDefault(index);
Text\NgramTransform.cs (1)
650term = terms.GetItemOrDefault((int)unigram - 1);