/// <summary> /// Transforms a categorical column into a set of features that includes the count of each label class, /// the log-odds for each label class and the back-off indicator. /// </summary> /// <param name="catalog">The transforms catalog.</param> /// <param name="outputColumnName">Name of the column resulting from the transformation of <paramref name="inputColumnName"/>.</param> /// <param name="initialCounts">A previously trained count table containing initial counts.</param> /// <param name="inputColumnName">Name of the column to transform. If set to <see langword="null"/>, the value of the <paramref name="outputColumnName"/> will be used as source.</param> /// <param name="labelColumn">The name of the label column.</param> /// <returns></returns> public static CountTargetEncodingEstimator CountTargetEncode(this TransformsCatalog catalog, string outputColumnName, CountTargetEncodingTransformer initialCounts, string inputColumnName = null, string labelColumn = "Label") { return(new CountTargetEncodingEstimator(CatalogUtils.GetEnvironment(catalog), labelColumn, initialCounts, new[] { new InputOutputColumnPair(outputColumnName, inputColumnName) })); }
/// <summary> /// Transforms a categorical column into a set of features that includes the count of each label class, /// the log-odds for each label class and the back-off indicator. /// </summary> /// <param name="catalog">The transforms catalog.</param> /// <param name="columns">The input and output columns.</param> /// <param name="initialCounts">A previously trained count table containing initial counts.</param> /// <param name="labelColumn">The name of the label column.</param> /// <returns></returns> public static CountTargetEncodingEstimator CountTargetEncode(this TransformsCatalog catalog, InputOutputColumnPair[] columns, CountTargetEncodingTransformer initialCounts, string labelColumn = "Label") { return(new CountTargetEncodingEstimator(CatalogUtils.GetEnvironment(catalog), labelColumn, initialCounts, columns)); }