1 write to ColumnView
Microsoft.ML.Data (1)
DataDebuggerPreview.cs (1)
62
ColumnView
= Enumerable.Range(0, n).Select(c => new ColumnInfo(data.Schema[c], columns[c].ToArray())).ToImmutableArray();
165 references to ColumnView
Microsoft.Data.Analysis.Tests (152)
DataFrameIDataViewTests.cs (152)
25
Assert.Equal(17, preview.
ColumnView
.Length);
27
Assert.Equal("Byte", preview.
ColumnView
[0].Column.Name);
28
Assert.Equal((byte)0, preview.
ColumnView
[0].Values[0]);
29
Assert.Equal((byte)1, preview.
ColumnView
[0].Values[1]);
31
Assert.Equal("Decimal", preview.
ColumnView
[1].Column.Name);
32
Assert.Equal((double)0, preview.
ColumnView
[1].Values[0]);
33
Assert.Equal((double)1, preview.
ColumnView
[1].Values[1]);
35
Assert.Equal("Double", preview.
ColumnView
[2].Column.Name);
36
Assert.Equal((double)0, preview.
ColumnView
[2].Values[0]);
37
Assert.Equal((double)1, preview.
ColumnView
[2].Values[1]);
39
Assert.Equal("Float", preview.
ColumnView
[3].Column.Name);
40
Assert.Equal((float)0, preview.
ColumnView
[3].Values[0]);
41
Assert.Equal((float)1, preview.
ColumnView
[3].Values[1]);
43
Assert.Equal("Int", preview.
ColumnView
[4].Column.Name);
44
Assert.Equal((int)0, preview.
ColumnView
[4].Values[0]);
45
Assert.Equal((int)1, preview.
ColumnView
[4].Values[1]);
47
Assert.Equal("Long", preview.
ColumnView
[5].Column.Name);
48
Assert.Equal((long)0, preview.
ColumnView
[5].Values[0]);
49
Assert.Equal((long)1, preview.
ColumnView
[5].Values[1]);
51
Assert.Equal("Sbyte", preview.
ColumnView
[6].Column.Name);
52
Assert.Equal((sbyte)0, preview.
ColumnView
[6].Values[0]);
53
Assert.Equal((sbyte)1, preview.
ColumnView
[6].Values[1]);
55
Assert.Equal("Short", preview.
ColumnView
[7].Column.Name);
56
Assert.Equal((short)0, preview.
ColumnView
[7].Values[0]);
57
Assert.Equal((short)1, preview.
ColumnView
[7].Values[1]);
59
Assert.Equal("Uint", preview.
ColumnView
[8].Column.Name);
60
Assert.Equal((uint)0, preview.
ColumnView
[8].Values[0]);
61
Assert.Equal((uint)1, preview.
ColumnView
[8].Values[1]);
63
Assert.Equal("Ulong", preview.
ColumnView
[9].Column.Name);
64
Assert.Equal((ulong)0, preview.
ColumnView
[9].Values[0]);
65
Assert.Equal((ulong)1, preview.
ColumnView
[9].Values[1]);
67
Assert.Equal("Ushort", preview.
ColumnView
[10].Column.Name);
68
Assert.Equal((ushort)0, preview.
ColumnView
[10].Values[0]);
69
Assert.Equal((ushort)1, preview.
ColumnView
[10].Values[1]);
71
Assert.Equal("String", preview.
ColumnView
[11].Column.Name);
72
Assert.Equal("0".ToString(), preview.
ColumnView
[11].Values[0].ToString());
73
Assert.Equal("1".ToString(), preview.
ColumnView
[11].Values[1].ToString());
75
Assert.Equal("Char", preview.
ColumnView
[12].Column.Name);
76
Assert.Equal((ushort)65, preview.
ColumnView
[12].Values[0]);
77
Assert.Equal((ushort)66, preview.
ColumnView
[12].Values[1]);
79
Assert.Equal("DateTime", preview.
ColumnView
[13].Column.Name);
80
Assert.Equal(new DateTime(2021, 06, 04), preview.
ColumnView
[13].Values[0]);
81
Assert.Equal(new DateTime(2021, 06, 05), preview.
ColumnView
[13].Values[1]);
83
Assert.Equal("Bool", preview.
ColumnView
[14].Column.Name);
84
Assert.Equal(true, preview.
ColumnView
[14].Values[0]);
85
Assert.Equal(false, preview.
ColumnView
[14].Values[1]);
87
Assert.Equal("ArrowString", preview.
ColumnView
[15].Column.Name);
88
Assert.Equal("foo".ToString(), preview.
ColumnView
[15].Values[0].ToString());
89
Assert.Equal("foo".ToString(), preview.
ColumnView
[15].Values[1].ToString());
91
Assert.Equal("VBuffer", preview.
ColumnView
[16].Column.Name);
92
Assert.Equal("Dense vector of size 5", preview.
ColumnView
[16].Values[0].ToString());
93
Assert.Equal("Dense vector of size 5", preview.
ColumnView
[16].Values[1].ToString());
131
Assert.Equal(17, preview.
ColumnView
.Length);
133
Assert.Equal("Byte", preview.
ColumnView
[0].Column.Name);
134
Assert.Equal((byte)0, preview.
ColumnView
[0].Values[0]);
135
Assert.Equal((byte)1, preview.
ColumnView
[0].Values[1]);
136
Assert.Equal((byte)4, preview.
ColumnView
[0].Values[4]);
137
Assert.Equal((byte)0, preview.
ColumnView
[0].Values[5]); // null row
138
Assert.Equal((byte)6, preview.
ColumnView
[0].Values[6]);
140
Assert.Equal("Decimal", preview.
ColumnView
[1].Column.Name);
141
Assert.Equal((double)0, preview.
ColumnView
[1].Values[0]);
142
Assert.Equal((double)1, preview.
ColumnView
[1].Values[1]);
143
Assert.Equal((double)4, preview.
ColumnView
[1].Values[4]);
144
Assert.Equal(double.NaN, preview.
ColumnView
[1].Values[5]); // null row
145
Assert.Equal((double)6, preview.
ColumnView
[1].Values[6]);
147
Assert.Equal("Double", preview.
ColumnView
[2].Column.Name);
148
Assert.Equal((double)0, preview.
ColumnView
[2].Values[0]);
149
Assert.Equal((double)1, preview.
ColumnView
[2].Values[1]);
150
Assert.Equal((double)4, preview.
ColumnView
[2].Values[4]);
151
Assert.Equal(double.NaN, preview.
ColumnView
[2].Values[5]); // null row
152
Assert.Equal((double)6, preview.
ColumnView
[2].Values[6]);
154
Assert.Equal("Float", preview.
ColumnView
[3].Column.Name);
155
Assert.Equal((float)0, preview.
ColumnView
[3].Values[0]);
156
Assert.Equal((float)1, preview.
ColumnView
[3].Values[1]);
157
Assert.Equal((float)4, preview.
ColumnView
[3].Values[4]);
158
Assert.Equal(float.NaN, preview.
ColumnView
[3].Values[5]); // null row
159
Assert.Equal((float)6, preview.
ColumnView
[3].Values[6]);
161
Assert.Equal("Int", preview.
ColumnView
[4].Column.Name);
162
Assert.Equal((int)0, preview.
ColumnView
[4].Values[0]);
163
Assert.Equal((int)1, preview.
ColumnView
[4].Values[1]);
164
Assert.Equal((int)4, preview.
ColumnView
[4].Values[4]);
165
Assert.Equal((int)0, preview.
ColumnView
[4].Values[5]); // null row
166
Assert.Equal((int)6, preview.
ColumnView
[4].Values[6]);
168
Assert.Equal("Long", preview.
ColumnView
[5].Column.Name);
169
Assert.Equal((long)0, preview.
ColumnView
[5].Values[0]);
170
Assert.Equal((long)1, preview.
ColumnView
[5].Values[1]);
171
Assert.Equal((long)4, preview.
ColumnView
[5].Values[4]);
172
Assert.Equal((long)0, preview.
ColumnView
[5].Values[5]); // null row
173
Assert.Equal((long)6, preview.
ColumnView
[5].Values[6]);
175
Assert.Equal("Sbyte", preview.
ColumnView
[6].Column.Name);
176
Assert.Equal((sbyte)0, preview.
ColumnView
[6].Values[0]);
177
Assert.Equal((sbyte)1, preview.
ColumnView
[6].Values[1]);
178
Assert.Equal((sbyte)4, preview.
ColumnView
[6].Values[4]);
179
Assert.Equal((sbyte)0, preview.
ColumnView
[6].Values[5]); // null row
180
Assert.Equal((sbyte)6, preview.
ColumnView
[6].Values[6]);
182
Assert.Equal("Short", preview.
ColumnView
[7].Column.Name);
183
Assert.Equal((short)0, preview.
ColumnView
[7].Values[0]);
184
Assert.Equal((short)1, preview.
ColumnView
[7].Values[1]);
185
Assert.Equal((short)4, preview.
ColumnView
[7].Values[4]);
186
Assert.Equal((short)0, preview.
ColumnView
[7].Values[5]); // null row
187
Assert.Equal((short)6, preview.
ColumnView
[7].Values[6]);
189
Assert.Equal("Uint", preview.
ColumnView
[8].Column.Name);
190
Assert.Equal((uint)0, preview.
ColumnView
[8].Values[0]);
191
Assert.Equal((uint)1, preview.
ColumnView
[8].Values[1]);
192
Assert.Equal((uint)4, preview.
ColumnView
[8].Values[4]);
193
Assert.Equal((uint)0, preview.
ColumnView
[8].Values[5]); // null row
194
Assert.Equal((uint)6, preview.
ColumnView
[8].Values[6]);
196
Assert.Equal("Ulong", preview.
ColumnView
[9].Column.Name);
197
Assert.Equal((ulong)0, preview.
ColumnView
[9].Values[0]);
198
Assert.Equal((ulong)1, preview.
ColumnView
[9].Values[1]);
199
Assert.Equal((ulong)4, preview.
ColumnView
[9].Values[4]);
200
Assert.Equal((ulong)0, preview.
ColumnView
[9].Values[5]); // null row
201
Assert.Equal((ulong)6, preview.
ColumnView
[9].Values[6]);
203
Assert.Equal("Ushort", preview.
ColumnView
[10].Column.Name);
204
Assert.Equal((ushort)0, preview.
ColumnView
[10].Values[0]);
205
Assert.Equal((ushort)1, preview.
ColumnView
[10].Values[1]);
206
Assert.Equal((ushort)4, preview.
ColumnView
[10].Values[4]);
207
Assert.Equal((ushort)0, preview.
ColumnView
[10].Values[5]); // null row
208
Assert.Equal((ushort)6, preview.
ColumnView
[10].Values[6]);
210
Assert.Equal("String", preview.
ColumnView
[11].Column.Name);
211
Assert.Equal("0", preview.
ColumnView
[11].Values[0].ToString());
212
Assert.Equal("1", preview.
ColumnView
[11].Values[1].ToString());
213
Assert.Equal("4", preview.
ColumnView
[11].Values[4].ToString());
214
Assert.Equal("", preview.
ColumnView
[11].Values[5].ToString()); // null row
215
Assert.Equal("6", preview.
ColumnView
[11].Values[6].ToString());
217
Assert.Equal("Char", preview.
ColumnView
[12].Column.Name);
218
Assert.Equal((ushort)65, preview.
ColumnView
[12].Values[0]);
219
Assert.Equal((ushort)66, preview.
ColumnView
[12].Values[1]);
220
Assert.Equal((ushort)69, preview.
ColumnView
[12].Values[4]);
221
Assert.Equal((ushort)0, preview.
ColumnView
[12].Values[5]); // null row
222
Assert.Equal((ushort)71, preview.
ColumnView
[12].Values[6]);
224
Assert.Equal("DateTime", preview.
ColumnView
[13].Column.Name);
225
Assert.Equal(new DateTime(2021, 06, 04), preview.
ColumnView
[13].Values[0]);
226
Assert.Equal(new DateTime(2021, 06, 05), preview.
ColumnView
[13].Values[1]);
227
Assert.Equal(new DateTime(2021, 06, 08), preview.
ColumnView
[13].Values[4]);
228
Assert.Equal(new DateTime(), preview.
ColumnView
[13].Values[5]); // null row
229
Assert.Equal(new DateTime(2021, 06, 10), preview.
ColumnView
[13].Values[6]);
231
Assert.Equal("Bool", preview.
ColumnView
[14].Column.Name);
232
Assert.Equal(true, preview.
ColumnView
[14].Values[0]);
233
Assert.Equal(false, preview.
ColumnView
[14].Values[1]);
234
Assert.Equal(true, preview.
ColumnView
[14].Values[4]);
235
Assert.Equal(false, preview.
ColumnView
[14].Values[5]); // null row
236
Assert.Equal(true, preview.
ColumnView
[14].Values[6]);
238
Assert.Equal("ArrowString", preview.
ColumnView
[15].Column.Name);
239
Assert.Equal("foo", preview.
ColumnView
[15].Values[0].ToString());
240
Assert.Equal("foo", preview.
ColumnView
[15].Values[1].ToString());
241
Assert.Equal("foo", preview.
ColumnView
[15].Values[4].ToString());
242
Assert.Equal("", preview.
ColumnView
[15].Values[5].ToString()); // null row
243
Assert.Equal("foo", preview.
ColumnView
[15].Values[6].ToString());
245
Assert.Equal("VBuffer", preview.
ColumnView
[16].Column.Name);
246
Assert.True(preview.
ColumnView
[16].Values[0] is VBuffer<int>);
247
Assert.True(preview.
ColumnView
[16].Values[6] is VBuffer<int>);
Microsoft.ML.Tests (13)
OnnxConversionTest.cs (1)
1748
Assert.Equal((Single)140.66, loadedData.
ColumnView
[1].Values[0]);
TextLoaderTests.cs (4)
752
Assert.Equal(5, previewIris.
ColumnView
.Length);
773
Assert.Equal(2, previewIrisStartEnd.
ColumnView
.Length);
795
Assert.Equal(2, previewIrisColumnIndices.
ColumnView
.Length);
850
Assert.Equal(5, previewIris.
ColumnView
.Length);
TrainerEstimators\CalibratorEstimators.cs (4)
107
Assert.True(scoredDataPreview.
ColumnView
.Length == 6);
133
Assert.True(calibratedData.
ColumnView
.Length == 7);
271
Assert.True(oldCalibratedData.
ColumnView
.Length == newCalibratedData.
ColumnView
.Length);
Transformers\WordBagTransformerTests.cs (4)
48
Assert.Equal(expected, ((VBuffer<float>)pred.
ColumnView
[4].Values[0]).DenseValues().ToArray());
76
Assert.Equal(expected, ((VBuffer<float>)pred.
ColumnView
[4].Values[0]).DenseValues().ToArray());
116
Assert.Equal(((VBuffer<float>)predDefault.
ColumnView
[4].Values[0]).DenseValues().ToArray(), ((VBuffer<float>)predNonDefault.
ColumnView
[4].Values[0]).DenseValues().ToArray());