/// <summary> /// Predict a target using a decision tree ranking model trained with the <see cref="LightGbmRankingTrainer"/>. /// </summary> /// <param name="catalog">The <see cref="RankingCatalog"/>.</param> /// <param name="options">Advanced options to the algorithm.</param> public static LightGbmRankingTrainer LightGbm(this RankingCatalog.RankingTrainers catalog, Options options) { Contracts.CheckValue(catalog, nameof(catalog)); var env = CatalogUtils.GetEnvironment(catalog); return new LightGbmRankingTrainer(env, options); }
/// <summary> /// Ranks a series of inputs based on their relevance, training a decision tree ranking model through the <see cref="FastTreeRankingTrainer"/>. /// </summary> /// <param name="catalog">The <see cref="RankingCatalog"/>.</param> /// <param name="options">Algorithm advanced settings.</param> public static FastTreeRankingTrainer FastTree(this RankingCatalog.RankingTrainers catalog, FastTreeRankingTrainer.Options options) { Contracts.CheckValue(catalog, nameof(catalog)); Contracts.CheckValue(options, nameof(options)); var env = CatalogUtils.GetEnvironment(catalog); return(new FastTreeRankingTrainer(env, options)); }
/// <summary> /// Predict a target using a decision tree ranking model trained with the <see cref="LightGbmRankingTrainer"/>. /// </summary> /// <param name="catalog">The <see cref="RankingCatalog"/>.</param> /// <param name="labelColumn">The labelColumn column.</param> /// <param name="featureColumn">The features column.</param> /// <param name="weights">The weights column.</param> /// <param name="groupIdColumn">The groupId column.</param> /// <param name="numLeaves">The number of leaves to use.</param> /// <param name="numBoostRound">Number of iterations.</param> /// <param name="minDataPerLeaf">The minimal number of documents allowed in a leaf of the tree, out of the subsampled data.</param> /// <param name="learningRate">The learning rate.</param> public static LightGbmRankingTrainer LightGbm(this RankingCatalog.RankingTrainers catalog, string labelColumn = DefaultColumnNames.Label, string featureColumn = DefaultColumnNames.Features, string groupIdColumn = DefaultColumnNames.GroupId, string weights = null, int? numLeaves = null, int? minDataPerLeaf = null, double? learningRate = null, int numBoostRound = Options.Defaults.NumBoostRound) { Contracts.CheckValue(catalog, nameof(catalog)); var env = CatalogUtils.GetEnvironment(catalog); return new LightGbmRankingTrainer(env, labelColumn, featureColumn, groupIdColumn, weights, numLeaves, minDataPerLeaf, learningRate, numBoostRound); }
/// <summary> /// Ranks a series of inputs based on their relevance, training a decision tree ranking model through the <see cref="FastTreeRankingTrainer"/>. /// </summary> /// <param name="catalog">The <see cref="RankingCatalog"/>.</param> /// <param name="labelColumn">The labelColumn column.</param> /// <param name="featureColumn">The featureColumn column.</param> /// <param name="groupId">The groupId column.</param> /// <param name="weights">The optional weights column.</param> /// <param name="numTrees">Total number of decision trees to create in the ensemble.</param> /// <param name="numLeaves">The maximum number of leaves per decision tree.</param> /// <param name="minDatapointsInLeaves">The minimal number of datapoints allowed in a leaf of the tree, out of the subsampled data.</param> /// <param name="learningRate">The learning rate.</param> public static FastTreeRankingTrainer FastTree(this RankingCatalog.RankingTrainers catalog, string labelColumn = DefaultColumnNames.Label, string featureColumn = DefaultColumnNames.Features, string groupId = DefaultColumnNames.GroupId, string weights = null, int numLeaves = Defaults.NumLeaves, int numTrees = Defaults.NumTrees, int minDatapointsInLeaves = Defaults.MinDocumentsInLeaves, double learningRate = Defaults.LearningRates) { Contracts.CheckValue(catalog, nameof(catalog)); var env = CatalogUtils.GetEnvironment(catalog); return(new FastTreeRankingTrainer(env, labelColumn, featureColumn, groupId, weights, numLeaves, numTrees, minDatapointsInLeaves, learningRate)); }
/// <summary> /// Predict a target using a decision tree ranking model trained with the <see cref="LightGbmRankingTrainer"/>. /// </summary> /// <param name="catalog">The <see cref="RankingCatalog"/>.</param> /// <param name="labelColumnName">The name of the label column.</param> /// <param name="featureColumnName">The name of the feature column.</param> /// <param name="rowGroupColumnName">The name of the group column.</param> /// <param name="exampleWeightColumnName">The name of the example weight column (optional).</param> /// <param name="numberOfLeaves">The number of leaves to use.</param> /// <param name="minimumExampleCountPerLeaf">The minimal number of data points allowed in a leaf of the tree, out of the subsampled data.</param> /// <param name="learningRate">The learning rate.</param> /// <param name="numberOfIterations">The number of iterations to use.</param> public static LightGbmRankingTrainer LightGbm(this RankingCatalog.RankingTrainers catalog, string labelColumnName = DefaultColumnNames.Label, string featureColumnName = DefaultColumnNames.Features, string rowGroupColumnName = DefaultColumnNames.GroupId, string exampleWeightColumnName = null, int?numberOfLeaves = null, int?minimumExampleCountPerLeaf = null, double?learningRate = null, int numberOfIterations = Options.Defaults.NumberOfIterations) { Contracts.CheckValue(catalog, nameof(catalog)); var env = CatalogUtils.GetEnvironment(catalog); return(new LightGbmRankingTrainer(env, labelColumnName, featureColumnName, rowGroupColumnName, exampleWeightColumnName, numberOfLeaves, minimumExampleCountPerLeaf, learningRate, numberOfIterations)); }
/// <summary> /// Ranks a series of inputs based on their relevance, training a decision tree ranking model through the <see cref="FastTreeRankingTrainer"/>. /// </summary> /// <param name="catalog">The <see cref="RankingCatalog"/>.</param> /// <param name="labelColumnName">The name of the label column.</param> /// <param name="featureColumnName">The name of the feature column.</param> /// <param name="rowGroupColumnName">The name of the group column.</param> /// <param name="exampleWeightColumnName">The name of the example weight column (optional).</param> /// <param name="numberOfTrees">Total number of decision trees to create in the ensemble.</param> /// <param name="numberOfLeaves">The maximum number of leaves per decision tree.</param> /// <param name="minimumExampleCountPerLeaf">The minimal number of data points allowed in a leaf of the tree, out of the subsampled data.</param> /// <param name="learningRate">The learning rate.</param> public static FastTreeRankingTrainer FastTree(this RankingCatalog.RankingTrainers catalog, string labelColumnName = DefaultColumnNames.Label, string featureColumnName = DefaultColumnNames.Features, string rowGroupColumnName = DefaultColumnNames.GroupId, string exampleWeightColumnName = null, int numberOfLeaves = Defaults.NumberOfLeaves, int numberOfTrees = Defaults.NumberOfTrees, int minimumExampleCountPerLeaf = Defaults.MinimumExampleCountPerLeaf, double learningRate = Defaults.LearningRate) { Contracts.CheckValue(catalog, nameof(catalog)); var env = CatalogUtils.GetEnvironment(catalog); return(new FastTreeRankingTrainer(env, labelColumnName, featureColumnName, rowGroupColumnName, exampleWeightColumnName, numberOfLeaves, numberOfTrees, minimumExampleCountPerLeaf, learningRate)); }