117 references to Items
Microsoft.ML.Core.Tests (24)
UnitTests\TestVBuffer.cs (24)
96float sum = a.Items().Sum(iv => iv.Value); 97float l1 = a.Items().Sum(iv => Math.Abs(iv.Value)); 98float l2Squared = a.Items().Sum(iv => iv.Value * iv.Value); 101float infNorm = a.GetValues().Length == 0 ? 0 : a.Items().Max(iv => Math.Abs(iv.Value)); 326var aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 327int[] indices = aIndices.Union(b.Items().Select(iv => iv.Key)).OrderBy(i => i).ToArray(); 372int[] indices = a.Items().Select(iv => iv.Key).Union(b.Items().Select(iv => iv.Key)).OrderBy(i => i).ToArray(); 417var aIndices = a.Items().Select(iv => iv.Key); 418var bIndices = b.Items().Select(iv => iv.Key); 473foreach (var iv in a.Items()) 503int[] indices = a.Items().Select(iv => iv.Key) 504.Union(b.Items().Select(iv => iv.Key)).Distinct().OrderBy(x => x).ToArray(); 740foreach (var iv in dst.Items(all: true)) 768foreach (var iv in b.Items(all: false)) 799HashSet<int> aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 800HashSet<int> bIndices = new HashSet<int>(b.Items().Select(iv => iv.Key)); 802foreach (var iv in b.Items(all: false)) 830var l1Dist = a.Items(all: true).Zip(b.Items(all: true), (av, bv) => Math.Abs(av.Value - bv.Value)).Sum(); 831var l2Dist2 = a.Items(all: true).Zip(b.Items(all: true), (av, bv) => MathUtils.Pow(av.Value - bv.Value, 2)).Sum(); 833var dot = a.Items(all: true).Zip(b.Items(all: true), (av, bv) => av.Value * bv.Value).Sum();
Microsoft.ML.Data (25)
Commands\ShowSchemaCommand.cs (2)
173foreach (var kvp in names.Items(all: verbose)) 286foreach (var item in value.Items())
Data\DataViewUtils.cs (1)
1401var stringRep = string.Join(",", vbuf.Items(true).Take(previewValues)
Data\RowCursorUtils.cs (1)
438foreach (var kv in src.Items(all: true))
DataView\TypedCursor.cs (2)
439foreach (var pair in value.Items(true)) 475foreach (var pair in value.Items(true))
Evaluators\EvaluatorUtils.cs (8)
364foreach (var metric in metricVals.Items(all: true)) 484foreach (var kvp in slotNamesCur.Items(true)) 515foreach (var kvp in src.Items()) 539foreach (var kvp in src.Items(true)) 584foreach (var kvp in keyNamesCur.Items(true)) 1037foreach (var name in names.Items(all: true)) 1201foreach (var metric in metricVals.Items(all: true)) 1506foreach (var val in count.Items())
Evaluators\MultiOutputRegressionEvaluator.cs (1)
757foreach (var metric in metricVals.Items(all: true))
Evaluators\QuantileRegressionEvaluator.cs (3)
102foreach (var i in TotalL2Loss.Items()) 116foreach (var i in TotalL2Loss.Items()) 408foreach (var s in score.Items(all: true))
Transforms\ColumnConcatenatingTransformer.cs (1)
659foreach (var kvp in names.Items())
Transforms\InvertHashUtils.cs (1)
420foreach (var pair in v.Items())
Transforms\KeyToVector.cs (1)
403foreach (var kvpSlot in namesSlotSrc.Items(all: true))
Transforms\ValueToKeyMappingTransformer.cs (1)
969foreach (var kv in terms.Items())
Transforms\ValueToKeyMappingTransformerImpl.cs (2)
1134foreach (var pair in keyVals.Items(all: true)) 1218foreach (var pair in keyVals.Items(all: true))
Utilities\ColumnCursor.cs (1)
172foreach (var kvp in curValue.Items(all: false))
Microsoft.ML.FastTree (1)
FastTree.cs (1)
1681foreach (var kv in temp.Items())
Microsoft.ML.KMeansClustering (2)
KMeansModelParameters.cs (1)
200foreach (var pair in _centroids[i].Items())
KMeansPlusPlusTrainer.cs (1)
1840Contracts.Check(centroid.Items().Select(x => x.Value).All(FloatUtils.IsFinite), "Model training failed: non-finite coordinates are generated");
Microsoft.ML.PCA (1)
PcaTrainer.cs (1)
568foreach (var value in _mean.Items(all: true))
Microsoft.ML.Samples (5)
Dynamic\NgramExtraction.cs (1)
77foreach (var item in featureRow.Items())
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (1)
84foreach (var item in featureRow.Items())
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
85foreach (var item in featureRow.Items())
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
91foreach (var item in featureRow.Items())
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
91foreach (var item in featureRow.Items())
Microsoft.ML.StandardTrainers (5)
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
36foreach (var pair in featureBuffer.Items())
Standard\LinearModelParameters.cs (1)
88return _pred.Weight.Items(all: true).Select(iv => iv.Value).GetEnumerator();
Standard\LinearPredictorUtils.cs (1)
210var orderedWeights = weights.Items()
Standard\LogisticRegression\MulticlassLogisticRegression.cs (2)
850var orderedWeights = Weights[classNumber].Items().OrderByDescending(kv => Math.Abs(kv.Value)); 1053foreach (var weight in Weights[i].Items(all: true))
Microsoft.ML.Tests (47)
Scenarios\Api\TestApi.cs (4)
257Assert.True(retrievedFloatVBuffer.Items().SequenceEqual(valueFloatVBuffer.Items())); 261Assert.True(retrievedVBuffer.Items().SequenceEqual(valueVBuffer.Items()));
Transformers\CategoricalHashTests.cs (12)
146Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "0:A", "1:B" }); 152Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 159Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "1:2", "0:5", "1:4", "1:6", "0:3", "0:1" }); 165Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "-1", "1" }); 172System.Diagnostics.Trace.WriteLine(slots.Items().Select(x => x.Value.ToString()).Distinct()); 173var temp = slots.Items().Select(x => x.Value.ToString()).Distinct(); 174Assert.Equal(slots.Items().Select(x => x.Value.ToString()).Distinct(), new string[14] { "[0].", "[0].0:A", "[0].0:E", "[0].0:D", "[0].1:A", "[0].1:E", "[0].1:D", "[1].", "[1].0:A", "[1].0:E", "[1].0:D", "[1].1:A", "[1].1:E", "[1].1:D" }); 177Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[4] { "0", "65535", "65536", "131071" }); 184Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "E", "D" }); 187Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[2] { "0", "65535" }); 194Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "0:A", "1:B" }); 200Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" });
Transformers\CategoricalTests.cs (14)
224Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "A", "B" }); 230Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 237Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "3", "5" }); 243Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "6", "1" }); 250Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[12] { "[0].1", "[0].2", "[0].3", "[0].4", "[0].5", "[0].6", "[1].1", "[1].2", "[1].3", "[1].4", "[1].5", "[1].6" }); 253Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[4] { "0", "5", "6", "11" }); 260Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "1", "-1" }); 263Assert.Equal(slotRanges.Items().Select(x => x.Value.ToString()), new string[2] { "0", "1" }); 270Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[3] { "A", "D", "E" }); 276Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "D", "E" }); 282Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "[0].Bit2", "[0].Bit1", "[0].Bit0", "[1].Bit2", "[1].Bit1", "[1].Bit0" }); 288Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "Bit1", "Bit0" }); 295Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "[0].Bit2", "[0].Bit1", "[0].Bit0", "[1].Bit2", "[1].Bit1", "[1].Bit0" }); 301Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[3] { "Bit2", "Bit1", "Bit0" });
Transformers\ConvertTests.cs (2)
356Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "1", "2" }); 362Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "A", "B" });
Transformers\HashTests.cs (3)
89Assert.Equal(keys.Items().Select(x => x.Value.ToString()), new string[2] { "2.5", "3.5" }); 94Assert.Equal(keys.Items().Select(x => x.Value.ToString()), new string[2] { "2.5", "3.5" }); 99Assert.Equal(keys.Items().Select(x => x.Value.ToString()), new string[2] { "0:3.5", "1:2.5" });
Transformers\KeyToBinaryVectorEstimatorTest.cs (2)
120Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[6] { "[0].Bit2", "[0].Bit1", "[0].Bit0", "[1].Bit2", "[1].Bit1", "[1].Bit0" }); 126Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "Bit1", "Bit0" });
Transformers\KeyToVectorEstimatorTests.cs (10)
139Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "A", "B" }); 145Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[1] { "C" }); 148Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[2] { 0, 0 }); 155Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[4] { "[0].3", "[0].5", "[1].3", "[1].5" }); 158Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[4] { 0, 1, 2, 3 }); 165Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "6", "1" }); 172Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[4] { 0, 5, 6, 11 }); 183Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[3] { "A", "D", "E" }); 189Assert.Equal(slots.Items().Select(x => x.Value.ToString()), new string[2] { "D", "E" }); 192Assert.Equal(slotRanges.Items().Select(x => x.Value), new int[2] { 0, 1 });
Microsoft.ML.Transforms (7)
CountFeatureSelection.cs (1)
434foreach (var kvp in value.Items())
Dracula\CountTableTransformer.cs (1)
657foreach (var pair in inputSlotNames.Items(true))
KeyToVectorMapping.cs (1)
313foreach (var kvpSlot in namesSlotSrc.Items(all: true))
MissingValueIndicatorTransform.cs (1)
213foreach (var kvp in names.Items(all: true))
PermutationFeatureImportance.cs (1)
78foreach (var k in weights.Items(all: true))
SvmLight\SvmLightSaver.cs (1)
162foreach (var pair in features.Items().Where(p => p.Value != 0))
Text\NgramTransform.cs (1)
290foreach (var pair in buffers[iinfo].Items())