Exemple #1
0
        /// <summary>
        ///  Predict a target using a linear binary classification model trained with the <see cref="SymbolicStochasticGradientDescentClassificationTrainer"/>.
        /// </summary>
        /// <param name="catalog">The <see cref="BinaryClassificationCatalog"/>.</param>
        /// <param name="options">Algorithm advanced options. See <see cref="SymbolicStochasticGradientDescentClassificationTrainer.Options"/>.</param>
        /// <example>
        /// <format type="text/markdown">
        /// <![CDATA[
        /// [!code-csharp[SymbolicStochasticGradientDescent](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/SymbolicStochasticGradientDescentWithOptions.cs)]
        /// ]]>
        /// </format>
        /// </example>
        public static SymbolicStochasticGradientDescentClassificationTrainer SymbolicStochasticGradientDescent(
            this BinaryClassificationCatalog.BinaryClassificationTrainers catalog,
            SymbolicStochasticGradientDescentClassificationTrainer.Options options)
        {
            Contracts.CheckValue(catalog, nameof(catalog));
            Contracts.CheckValue(options, nameof(options));
            var env = CatalogUtils.GetEnvironment(catalog);

            return(new SymbolicStochasticGradientDescentClassificationTrainer(env, options));
        }
Exemple #2
0
        /// <summary>
        ///  Predict a target using a linear binary classification model trained with the <see cref="SymbolicStochasticGradientDescentClassificationTrainer"/>.
        /// </summary>
        /// <param name="catalog">The <see cref="BinaryClassificationCatalog"/>.</param>
        /// <param name="labelColumnName">The name of the label column.</param>
        /// <param name="featureColumnName">The name of the feature column.</param>
        /// <param name="numberOfIterations">Number of training iterations.</param>
        /// <example>
        /// <format type="text/markdown">
        /// <![CDATA[
        /// [!code-csharp[SymbolicStochasticGradientDescent](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/SymbolicStochasticGradientDescent.cs)]
        /// ]]>
        /// </format>
        /// </example>
        public static SymbolicStochasticGradientDescentClassificationTrainer SymbolicStochasticGradientDescent(this BinaryClassificationCatalog.BinaryClassificationTrainers catalog,
                                                                                                               string labelColumnName   = DefaultColumnNames.Label,
                                                                                                               string featureColumnName = DefaultColumnNames.Features,
                                                                                                               int numberOfIterations   = SymbolicStochasticGradientDescentClassificationTrainer.Defaults.NumberOfIterations)
        {
            Contracts.CheckValue(catalog, nameof(catalog));
            var env = CatalogUtils.GetEnvironment(catalog);

            var options = new SymbolicStochasticGradientDescentClassificationTrainer.Options
            {
                LabelColumnName   = labelColumnName,
                FeatureColumnName = featureColumnName,
            };

            return(new SymbolicStochasticGradientDescentClassificationTrainer(env, options));
        }