Skip to content

Commit a8e221f

Browse files
committed
XML documentation for Calibrated and Non Calibrated SDCA Trainers.
1 parent cc40049 commit a8e221f

File tree

2 files changed

+72
-10
lines changed

2 files changed

+72
-10
lines changed

src/Microsoft.ML.StandardTrainers/Standard/SdcaBinary.cs

+64-2
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,38 @@ private protected override BinaryPredictionTransformer<TModelParameters> MakeTra
15501550
/// The trained model is <a href='https://en.wikipedia.org/wiki/Calibration_(statistics)'>calibrated</a> and can produce probability by feeding the output value of the
15511551
/// linear function to a <see cref="PlattCalibrator"/>.
15521552
/// </summary>
1553-
/// <include file='doc.xml' path='doc/members/member[@name="SDCA_remarks"]/*' />
1553+
/// <remarks>
1554+
/// <format type="text/markdown"><![CDATA[
1555+
/// To create this trainer, use [SdcaLogisticRegression](xref:Microsoft.ML.StandardTrainersCatalog.SdcaLogisticRegression(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,System.String,System.String,System.String,System.Nullable{System.Single},System.Nullable{System.Single},System.Nullable{System.Int32}))
1556+
/// or [SdcaLogisticRegression(Options)](xref:Microsoft.ML.StandardTrainersCatalog.SdcaLogisticRegression(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,Microsoft.ML.Trainers.SdcaLogisticRegressionBinaryTrainer.Options)).
1557+
///
1558+
/// [!include[io](~/../docs/samples/docs/api-reference/io-columns-binary-classification.md)]
1559+
///
1560+
/// ### Trainer Characteristics
1561+
/// | | |
1562+
/// | -- | -- |
1563+
/// | Machine learning task | Binary classification |
1564+
/// | Is normalization required? | Yes |
1565+
/// | Is caching required? | No |
1566+
/// | Required NuGet in addition to Microsoft.ML | None |
1567+
///
1568+
/// ### Training Algorithm Details
1569+
/// This trainer is based on the Stochastic Dual Coordinate Ascent (SDCA) method, a state-of-the-art optimization technique for convex objective functions.
1570+
/// The algorithm can be scaled for use on large out-of-memory data sets due to a semi-asynchronized implementation that supports multi-threading.
1571+
/// Convergence is underwritten by periodically enforcing synchronization between primal and dual updates in a separate thread.
1572+
/// Several choices of loss functions are also provided.The SDCA method combines several of the best properties and capabilities of logistic regression and SVM algorithms.
1573+
/// Note that SDCA is a stochastic and streaming optimization algorithm. The results depends on the order of the training data.
1574+
/// For reproducible results, it is recommended that one sets 'Shuffle' to False and 'NumThreads' to 1.
1575+
/// Elastic net regularization can be specified by the 'L2Const' and 'L1Threshold' parameters. Note that the 'L2Const' has an effect on the rate of convergence.
1576+
/// In general, the larger the 'L2Const', the faster SDCA converges.
1577+
/// For more information, see: [Scaling Up Stochastic Dual Coordinate Ascent](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/06/main-3.pdf ) and
1578+
/// [Stochastic Dual Coordinate Ascent Methods for Regularized Loss Minimization](http://www.jmlr.org/papers/volume14/shalev-shwartz13a/shalev-shwartz13a.pdf).
1579+
/// ]]>
1580+
/// </format>
1581+
/// </remarks>
1582+
/// <seealso cref="Microsoft.ML.StandardTrainersCatalog.SdcaLogisticRegression(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,System.String,System.String,System.String,System.Nullable{System.Single},System.Nullable{System.Single},System.Nullable{System.Int32})"/>
1583+
/// <seealso cref="Microsoft.ML.StandardTrainersCatalog.SdcaLogisticRegression(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,Microsoft.ML.Trainers.SdcaLogisticRegressionBinaryTrainer.Options)"/>
1584+
/// <seealso cref="Options"/>
15541585
public sealed class SdcaLogisticRegressionBinaryTrainer :
15551586
SdcaBinaryTrainerBase<CalibratedModelParametersBase<LinearBinaryModelParameters, PlattCalibrator>>
15561587
{
@@ -1614,7 +1645,38 @@ private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchem
16141645
/// <summary>
16151646
/// The <see cref="IEstimator{TTransformer}"/> for training a binary logistic regression classification model using the stochastic dual coordinate ascent method.
16161647
/// </summary>
1617-
/// <include file='doc.xml' path='doc/members/member[@name="SDCA_remarks"]/*' />
1648+
/// <remarks>
1649+
/// <format type="text/markdown"><![CDATA[
1650+
/// To create this trainer, use [SdcaNonCalibrated](xref:Microsoft.ML.StandardTrainersCatalog.SdcaNonCalibrated(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,System.String,System.String,System.String,Microsoft.ML.Trainers.ISupportSdcaClassificationLoss,System.Nullable{System.Single},System.Nullable{System.Single},System.Nullable{System.Int32}))
1651+
/// or [SdcaNonCalibrated(Options)](xref:Microsoft.ML.StandardTrainersCatalog.SdcaNonCalibrated(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,Microsoft.ML.Trainers.SdcaNonCalibratedBinaryTrainer.Options)).
1652+
///
1653+
/// [!include[io](~/../docs/samples/docs/api-reference/io-columns-binary-classification.md)]
1654+
///
1655+
/// ### Trainer Characteristics
1656+
/// | | |
1657+
/// | -- | -- |
1658+
/// | Machine learning task | Binary classification |
1659+
/// | Is normalization required? | Yes |
1660+
/// | Is caching required? | No |
1661+
/// | Required NuGet in addition to Microsoft.ML | None |
1662+
///
1663+
/// ### Training Algorithm Details
1664+
/// This trainer is based on the Stochastic Dual Coordinate Ascent (SDCA) method, a state-of-the-art optimization technique for convex objective functions.
1665+
/// The algorithm can be scaled for use on large out-of-memory data sets due to a semi-asynchronized implementation that supports multi-threading.
1666+
/// Convergence is underwritten by periodically enforcing synchronization between primal and dual updates in a separate thread.
1667+
/// Several choices of loss functions are also provided.The SDCA method combines several of the best properties and capabilities of logistic regression and SVM algorithms.
1668+
/// Note that SDCA is a stochastic and streaming optimization algorithm. The results depends on the order of the training data.
1669+
/// For reproducible results, it is recommended that one sets 'Shuffle' to False and 'NumThreads' to 1.
1670+
/// Elastic net regularization can be specified by the 'L2Const' and 'L1Threshold' parameters. Note that the 'L2Const' has an effect on the rate of convergence.
1671+
/// In general, the larger the 'L2Const', the faster SDCA converges.
1672+
/// For more information, see: [Scaling Up Stochastic Dual Coordinate Ascent](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/06/main-3.pdf ) and
1673+
/// [Stochastic Dual Coordinate Ascent Methods for Regularized Loss Minimization](http://www.jmlr.org/papers/volume14/shalev-shwartz13a/shalev-shwartz13a.pdf).
1674+
/// ]]>
1675+
/// </format>
1676+
/// </remarks>
1677+
/// <seealso cref="Microsoft.ML.StandardTrainersCatalog.SdcaNonCalibrated(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,System.String,System.String,System.String,Microsoft.ML.Trainers.ISupportSdcaClassificationLoss,System.Nullable{System.Single},System.Nullable{System.Single},System.Nullable{System.Int32})"/>
1678+
/// <seealso cref="Microsoft.ML.StandardTrainersCatalog.SdcaNonCalibrated(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,Microsoft.ML.Trainers.SdcaNonCalibratedBinaryTrainer.Options)"/>
1679+
/// <seealso cref="Options"/>
16181680
public sealed class SdcaNonCalibratedBinaryTrainer : SdcaBinaryTrainerBase<LinearBinaryModelParameters>
16191681
{
16201682
/// <summary>

src/Microsoft.ML.StandardTrainers/StandardTrainersCatalog.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ public static SdcaRegressionTrainer Sdca(this RegressionCatalog.RegressionTraine
181181
}
182182

183183
/// <summary>
184-
/// Predict a target using a linear classification model trained with <see cref="SdcaLogisticRegressionBinaryTrainer"/>.
184+
/// Creates a <see cref="SdcaLogisticRegressionBinaryTrainer"/> that predicts a target using a linear classification model trained over a boolean label data.
185185
/// </summary>
186186
/// <param name="catalog">The binary classification catalog trainer object.</param>
187-
/// <param name="labelColumnName">The name of the label column.</param>
188-
/// <param name="featureColumnName">The name of the feature column.</param>
187+
/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="System.Boolean"/></param>
188+
/// <param name="featureColumnName">The name of the feature column. The column data must be a known-sized vector of <see cref="System.Single"/>.</param>
189189
/// <param name="exampleWeightColumnName">The name of the example weight column (optional).</param>
190190
/// <param name="l2Regularization">The L2 weight for <a href='https://en.wikipedia.org/wiki/Regularization_(mathematics)'>regularization</a>.</param>
191191
/// <param name="l1Regularization">The L1 <a href='https://en.wikipedia.org/wiki/Regularization_(mathematics)'>regularization</a> hyperparameter. Higher values will tend to lead to more sparse model.</param>
@@ -211,7 +211,7 @@ public static SdcaLogisticRegressionBinaryTrainer SdcaLogisticRegression(
211211
}
212212

213213
/// <summary>
214-
/// Predict a target using a linear classification model trained with <see cref="SdcaLogisticRegressionBinaryTrainer"/> and advanced options.
214+
/// Creates a <see cref="SdcaLogisticRegressionBinaryTrainer"/> that predicts a target using a linear classification model trained over boolean label data with advanced options.
215215
/// </summary>
216216
/// <param name="catalog">The binary classification catalog trainer object.</param>
217217
/// <param name="options">Trainer options.</param>
@@ -233,11 +233,11 @@ public static SdcaLogisticRegressionBinaryTrainer SdcaLogisticRegression(
233233
}
234234

235235
/// <summary>
236-
/// Predict a target using a linear classification model trained with <see cref="SdcaNonCalibratedBinaryTrainer"/>.
236+
/// Creates a <see cref="SdcaNonCalibratedBinaryTrainer"/> that predicts a target using a linear classification model.
237237
/// </summary>
238238
/// <param name="catalog">The binary classification catalog trainer object.</param>
239-
/// <param name="labelColumnName">The name of the label column.</param>
240-
/// <param name="featureColumnName">The name of the feature column.</param>
239+
/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="System.Boolean"/>.</param>
240+
/// <param name="featureColumnName">The name of the feature column. The column data must be a known-sized vector of <see cref="System.Single"/>.</param>
241241
/// <param name="exampleWeightColumnName">The name of the example weight column (optional).</param>
242242
/// <param name="lossFunction">The <a href="https://en.wikipedia.org/wiki/Loss_function">loss</a> function minimized in the training process. Defaults to <see cref="LogLoss"/> if not specified.</param>
243243
/// <param name="l2Regularization">The L2 weight for <a href='https://en.wikipedia.org/wiki/Regularization_(mathematics)'>regularization</a>.</param>
@@ -265,7 +265,7 @@ public static SdcaNonCalibratedBinaryTrainer SdcaNonCalibrated(
265265
}
266266

267267
/// <summary>
268-
/// Predict a target using a linear classification model trained with <see cref="SdcaNonCalibratedBinaryTrainer"/> and advanced options.
268+
/// Creates a <see cref="SdcaNonCalibratedBinaryTrainer"/> that predicts a target using a linear classification model trained over boolean label data with advanced options.
269269
/// </summary>
270270
/// <param name="catalog">The binary classification catalog trainer object.</param>
271271
/// <param name="options">Trainer options.</param>

0 commit comments

Comments
 (0)