Data\RowCursorUtils.cs (36)
26/// Returns an appropriate <see cref="ValueGetter{T}"/> for a row given an active column
64Func<DataViewType, DataViewType, DataViewRow, int, ValueGetter<int>> del = GetGetterAsCore<int, int>;
73public static ValueGetter<TDst> GetGetterAs<TDst>(DataViewType typeDst, DataViewRow row, int col)
85Func<DataViewType, DataViewType, DataViewRow, int, ValueGetter<TDst>> del = GetGetterAsCore<int, TDst>;
87return (ValueGetter<TDst>)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, row, col });
90private static ValueGetter<TDst> GetGetterAsCore<TSrc, TDst>(DataViewType typeSrc, DataViewType typeDst, DataViewRow row, int col)
95var getter = row.GetGetter<TSrc>(row.Schema[col]);
101return (ValueGetter<TDst>)(Delegate)getter;
121public static ValueGetter<StringBuilder> GetGetterAsStringBuilder(DataViewRow row, int col)
132private static ValueGetter<StringBuilder> GetGetterAsStringBuilderCore<TSrc>(DataViewType typeSrc, DataViewRow row, int col)
136var getter = row.GetGetter<TSrc>(row.Schema[col]);
163Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<VBuffer<int>>> del = GetVecGetterAsCore<int, int>;
172public static ValueGetter<VBuffer<TDst>> GetVecGetterAs<TDst>(PrimitiveDataViewType typeDst, DataViewRow row, int col)
183Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<VBuffer<TDst>>> del = GetVecGetterAsCore<int, TDst>;
185return (ValueGetter<VBuffer<TDst>>)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, GetterFactory.Create(row, col) });
193internal static ValueGetter<VBuffer<TDst>> GetVecGetterAs<TDst>(PrimitiveDataViewType typeDst, SlotCursor cursor)
200Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<VBuffer<TDst>>> del = GetVecGetterAsCore<int, TDst>;
202return (ValueGetter<VBuffer<TDst>>)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, GetterFactory.Create(cursor) });
206/// A convenience wrapper to generalize the operation of fetching a <see cref="ValueGetter{TValue}"/>.
220public abstract ValueGetter<TValue> GetGetter<TValue>();
233public override ValueGetter<TValue> GetGetter<TValue>()
248public override ValueGetter<TValue> GetGetter<TValue>()
255private static ValueGetter<VBuffer<TDst>> GetVecGetterAsCore<TSrc, TDst>(VectorDataViewType typeSrc, PrimitiveDataViewType typeDst, GetterFactory getterFact)
261var getter = getterFact.GetGetter<VBuffer<TSrc>>();
267return (ValueGetter<VBuffer<TDst>>)(Delegate)getter;
315var getter = cursor.GetGetter<T>(cursor.Schema[col]);
352public static ValueGetter<Single> GetLabelGetter(DataViewRow cursor, int labelIndex)
361var getSingleSrc = cursor.GetGetter<Double>(cursor.Schema[labelIndex]);
374private static ValueGetter<Single> GetLabelGetterNotFloat(DataViewRow cursor, int labelIndex)
383var getBoolSrc = cursor.GetGetter<bool>(cursor.Schema[labelIndex]);
400var getSrc = RowCursorUtils.GetGetterAs<ulong>(NumberDataViewType.UInt64, cursor, labelIndex);
414internal static ValueGetter<VBuffer<Single>> GetLabelGetter(SlotCursor cursor)
429var getSrc = RowCursorUtils.GetVecGetterAs<ulong>(NumberDataViewType.UInt64, cursor);
570public override ValueGetter<TValue> GetGetter<TValue>(DataViewSchema.Column column)
575var getter = _parent._row.GetGetter<TValue>(column);
596public override ValueGetter<DataViewRowId> GetIdGetter()
DataView\ArrayDataViewBuilder.cs (12)
23private readonly Dictionary<string, ValueGetter<VBuffer<ReadOnlyMemory<char>>>> _getSlotNames;
24private readonly Dictionary<string, ValueGetter<VBuffer<ReadOnlyMemory<char>>>> _getKeyValues;
43_getSlotNames = new Dictionary<string, ValueGetter<VBuffer<ReadOnlyMemory<char>>>>();
44_getKeyValues = new Dictionary<string, ValueGetter<VBuffer<ReadOnlyMemory<char>>>>();
83public void AddColumn<T1>(string name, ValueGetter<VBuffer<ReadOnlyMemory<char>>> getKeyValues, ulong keyCount, params T1[] values)
97public void AddColumn<T>(string name, ValueGetter<VBuffer<ReadOnlyMemory<char>>> getNames, PrimitiveDataViewType itemType, params T[][] values)
122public void AddColumn<T>(string name, ValueGetter<VBuffer<ReadOnlyMemory<char>>> getNames, PrimitiveDataViewType itemType, Combiner<T> combiner, params T[][] values)
158public void AddColumn<T>(string name, ValueGetter<VBuffer<ReadOnlyMemory<char>>> getNames, PrimitiveDataViewType itemType, params VBuffer<T>[] values)
223if (builder._getSlotNames.TryGetValue(builder._names[i], out var slotNamesGetter))
226if (builder._getKeyValues.TryGetValue(builder._names[i], out var keyValueGetter))
285public override ValueGetter<DataViewRowId> GetIdGetter()
323public override ValueGetter<TValue> GetGetter<TValue>(DataViewSchema.Column column)
Evaluators\EvaluatorUtils.cs (23)
279ValueGetter<bool> isWeightedGetter;
285ValueGetter<uint> stratColGetter;
296var getters = new ValueGetter<double>[colCount];
297var vBufferGetters = getVectorMetrics ? new ValueGetter<VBuffer<double>>[colCount] : null;
410DataViewType typeSrc, int keyCount, int value, string registrationName, ValueGetter<VBuffer<ReadOnlyMemory<char>>> keyValueGetter)
449inputColType, numFolds, curFold + 1, "FoldIndex", default(ValueGetter<VBuffer<ReadOnlyMemory<char>>>));
495ValueGetter<VBuffer<ReadOnlyMemory<char>>> slotNamesGetter =
616ValueGetter<VBuffer<ReadOnlyMemory<char>>> keyValueGetter =
684ValueGetter<VBuffer<ReadOnlyMemory<char>>> keyValueGetter =
724ValueGetter<VBuffer<ReadOnlyMemory<char>>> slotNamesGetter = null;
992ValueGetter<double>[] getters, ValueGetter<VBuffer<double>>[] vBufferGetters)
1098var getters = new ValueGetter<double>[colCount];
1099var vBufferGetters = new ValueGetter<VBuffer<double>>[colCount];
1106ValueGetter<bool> isWeightedGetter;
1112ValueGetter<uint> stratColGetter;
1175private static void UpdateSums(int isWeightedCol, int stratCol, int stratVal, AggregatedMetric[] aggregated, bool hasStdev, List<string> metricNames, bool hasWeighted, bool hasStrats, int colCount, ValueGetter<double>[] getters, ValueGetter<VBuffer<double>>[] vBufferGetters, ref double metricVal, ref VBuffer<double> metricVals)
1244ValueGetter<VBuffer<ReadOnlyMemory<char>>> getKeyValues =
1313ValueGetter<VBuffer<ReadOnlyMemory<char>>> getSlotNames = (ref VBuffer<ReadOnlyMemory<char>> dst) => dst = slotNames;
1480var countGetter = cursor.GetGetter<VBuffer<double>>(cursor.Schema[countIndex]);
1481ValueGetter<uint> stratGetter = null;
1742var getter = cursor.GetGetter<ReadOnlyMemory<char>>(warningTextColumn.Value);
Scorers\MulticlassClassificationScorer.cs (14)
154ValueGetter<VBuffer<T>> buffGetter = (ref VBuffer<T> dst) => buffValue.CopyTo(ref dst);
194Contracts.Assert(_getter is ValueGetter<VBuffer<T>>);
196var getter = (ValueGetter<VBuffer<T>>)_getter;
245env.Assert(getter is ValueGetter<VBuffer<T>>);
249return new Bound<T>(env, mapper, type, (ValueGetter<VBuffer<T>>)getter, metadataKind, canWrap);
259private readonly ValueGetter<VBuffer<T>> _labelNameGetter;
282public Bound(IHostEnvironment env, ISchemaBoundRowMapper mapper, VectorDataViewType type, ValueGetter<VBuffer<T>> getter,
312ValueGetter<VBuffer<T>> labelNameGetter, string labelNameKind)
380public override ValueGetter<TValue> GetGetter<TValue>(DataViewSchema.Column column) => Input.GetGetter<TValue>(column);
498ValueGetter<VBuffer<T>> getter =
568ValueGetter<VBuffer<float>> mapperScoreGetter = output.GetGetter<VBuffer<float>>(Bindings.RowMapper.OutputSchema[Bindings.ScoreColumnIndex]);
574ValueGetter<uint> predFn =
585ValueGetter<VBuffer<float>> scoreFn =
Transforms\Hashing.cs (23)
350private ValueGetter<uint> ComposeGetterOne(DataViewRow input, int iinfo, int srcCol, DataViewType srcType)
402private ValueGetter<VBuffer<uint>> ComposeGetterVec(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType)
449private ValueGetter<VBuffer<uint>> ComposeGetterVecCore<T, THash>(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType)
454var getSrc = input.GetGetter<VBuffer<T>>(input.Schema[srcCol]);
464private ValueGetter<uint> ComposeGetterCombined(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType)
997private static ValueGetter<uint> MakeScalarHashGetter<T, THash>(DataViewRow input, int srcCol, uint seed, uint mask, bool useOldHashing)
1005var srcGetter = input.GetGetter<T>(input.Schema[srcCol]);
1023private static ValueGetter<VBuffer<uint>> MakeVectorHashGetter<T, THash>(uint seed, uint mask, ValueGetter<VBuffer<T>> srcGetter, bool useOldHashing)
1141private static ValueGetter<VBuffer<uint>> MakeVectorOrderedHashGetter<T, THash>(uint seed, uint mask, ValueGetter<VBuffer<T>> srcGetter, bool useOldHashing)
1279private static ValueGetter<uint> MakeCombinedVectorHashGetter<T, THash>(DataViewRow input, int srcCol, uint seed, uint mask)
1285var getSrc = input.GetGetter<VBuffer<T>>(input.Schema[srcCol]);
1347ValueGetter<VBuffer<ReadOnlyMemory<char>>> getter = (ref VBuffer<ReadOnlyMemory<char>> dst) =>
1623private readonly ValueGetter<T> _srcGetter;
1624private readonly ValueGetter<uint> _dstGetter;
1633_dstGetter = dstGetter as ValueGetter<uint>;
1657private readonly ValueGetter<VBuffer<T>> _srcGetter;
1658private readonly ValueGetter<VBuffer<uint>> _dstGetter;
1667_dstGetter = dstGetter as ValueGetter<VBuffer<uint>>;
1691private readonly ValueGetter<VBuffer<T>> _srcGetter;
1692private readonly ValueGetter<VBuffer<uint>> _dstGetter;
1701_dstGetter = dstGetter as ValueGetter<VBuffer<uint>>;
Transforms\NormalizeColumn.cs (10)
724private readonly ValueGetter<TFloat> _getSrc;
726protected OneColumnFunctionBuilderBase(IHost host, long lim, ValueGetter<TFloat> getSrc)
759private readonly ValueGetter<VBuffer<TFloat>> _getSrc;
762protected VecColumnFunctionBuilderBase(IHost host, long lim, ValueGetter<VBuffer<TFloat>> getSrc)
797private readonly ValueGetter<int> _labelGetterSrc;
809private ValueGetter<int> GetLabelGetter(DataViewRow row, int col, out int labelCardinality)
822var getSrc = RowCursorUtils.GetGetterAs<ulong>(NumberDataViewType.UInt64, row, col);
842var getSrc = RowCursorUtils.GetGetterAs<Double>(NumberDataViewType.Double, row, col);
879private readonly ValueGetter<TFloat> _colGetterSrc;
905private readonly ValueGetter<VBuffer<TFloat>> _colValueGetter;
Transforms\NormalizeColumnDbl.cs (33)
709var getSrc = input.GetGetter<TFloat>(input.Schema[icol]);
710ValueGetter<TFloat> del =
785var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]);
787ValueGetter<VBuffer<TFloat>> del;
1029ValueGetter<TFloat> trivial =
1037var getSrc = input.GetGetter<TFloat>(input.Schema[icol]);
1038ValueGetter<TFloat> del =
1082var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]);
1084ValueGetter<VBuffer<TFloat>> del;
1211var getSrc = input.GetGetter<TFloat>(input.Schema[icol]);
1212ValueGetter<TFloat> del =
1296var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]);
1298ValueGetter<VBuffer<TFloat>> del =
1526protected MinMaxOneColumnFunctionBuilderBase(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc)
1546private MinMaxOneColumnFunctionBuilder(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc)
1552ValueGetter<TFloat> getter)
1574protected MinMaxVecColumnFunctionBuilderBase(IHost host, int cv, long lim, bool fix, ValueGetter<VBuffer<TFloat>> getSrc)
1596ValueGetter<VBuffer<TFloat>> getSrc)
1602ValueGetter<VBuffer<TFloat>> getter)
1654private MeanVarOneColumnFunctionBuilder(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc, bool useLog, bool useCdf, bool useSampleVariance)
1666ValueGetter<TFloat> getter)
1673ValueGetter<TFloat> getter)
1736ValueGetter<VBuffer<TFloat>> getSrc, bool useLog, bool useCdf, bool useSampleVariance)
1747ValueGetter<VBuffer<TFloat>> getter)
1755ValueGetter<VBuffer<TFloat>> getter)
1859private BinOneColumnFunctionBuilder(IHost host, long lim, bool fix, int numBins, ValueGetter<TFloat> getSrc)
1868ValueGetter<TFloat> getter)
1904ValueGetter<VBuffer<TFloat>> getSrc)
1917ValueGetter<VBuffer<TFloat>> getter)
2061private RobustScalerOneColumnFunctionBuilder(IHost host, long lim, bool centerData, uint quantileMin, uint quantileMax, ValueGetter<double> getSrc)
2085bool centerData, uint quantileMin, uint quantileMax, ValueGetter<double> getter)
2117private RobustScalerVecFunctionBuilder(IHost host, long lim, int vectorSize, bool centerData, uint quantileMin, uint quantileMax, ValueGetter<VBuffer<double>> getSrc)
2154bool centerData, uint quantileMin, uint quantileMax, ValueGetter<VBuffer<double>> getter)
Transforms\NormalizeColumnSng.cs (33)
867var getSrc = input.GetGetter<TFloat>(input.Schema[icol]);
868ValueGetter<TFloat> del =
942var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]);
944ValueGetter<VBuffer<TFloat>> del;
1189ValueGetter<TFloat> trivial =
1197var getSrc = input.GetGetter<TFloat>(input.Schema[icol]);
1198ValueGetter<TFloat> del =
1242var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]);
1244ValueGetter<VBuffer<TFloat>> del;
1372var getSrc = input.GetGetter<TFloat>(input.Schema[icol]);
1373ValueGetter<TFloat> del =
1457var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]);
1459ValueGetter<VBuffer<TFloat>> del =
1689protected MinMaxOneColumnFunctionBuilderBase(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc)
1709private MinMaxOneColumnFunctionBuilder(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc)
1715ValueGetter<TFloat> getter)
1737protected MinMaxVecColumnFunctionBuilderBase(IHost host, int cv, long lim, bool fix, ValueGetter<VBuffer<TFloat>> getSrc)
1759ValueGetter<VBuffer<TFloat>> getSrc)
1765ValueGetter<VBuffer<TFloat>> getter)
1817private MeanVarOneColumnFunctionBuilder(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc, bool useLog, bool useCdf, bool useSampleVariance)
1829ValueGetter<TFloat> getter)
1836ValueGetter<TFloat> getter)
1899ValueGetter<VBuffer<TFloat>> getSrc, bool useLog, bool useCdf, bool useSampleVariance)
1910ValueGetter<VBuffer<TFloat>> getter)
1918ValueGetter<VBuffer<TFloat>> getter)
2022private BinOneColumnFunctionBuilder(IHost host, long lim, bool fix, int numBins, ValueGetter<TFloat> getSrc)
2031ValueGetter<TFloat> getter)
2067ValueGetter<VBuffer<TFloat>> getSrc)
2080ValueGetter<VBuffer<TFloat>> getter)
2225private RobustScalerOneColumnFunctionBuilder(IHost host, long lim, bool centerData, uint quantileMin, uint quantileMax, ValueGetter<TFloat> getSrc)
2249bool centerData, uint quantileMin, uint quantileMax, ValueGetter<TFloat> getter)
2281private RobustScalerVecFunctionBuilder(IHost host, long lim, int vectorSize, bool centerData, uint quantileMin, uint quantileMax, ValueGetter<VBuffer<TFloat>> getSrc)
2316bool centerData, uint quantileMin, uint quantileMax, ValueGetter<VBuffer<TFloat>> getter)