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