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