-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Scrubbing PkPd #2749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrubbing PkPd #2749
Conversation
@@ -623,7 +623,7 @@ private static ICalibratorTrainer GetCalibratorTrainerOrThrow(IExceptionContext | |||
/// <param name="imputeMissingLabelsAsNegative">Whether to treat missing labels as having negative labels, instead of keeping them missing.</param> | |||
/// <param name="maxCalibrationExamples">Number of instances to train the calibrator.</param> | |||
/// <typeparam name="TModel">The type of the model. This type parameter will usually be inferred automatically from <paramref name="binaryEstimator"/>.</typeparam> | |||
public static Pkpd PairwiseCoupling<TModel>(this MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog, | |||
public static PkpdTrainer PairwiseCoupling<TModel>(this MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PkpdTrainer PairwiseCoupling [](start = 22, length = 28)
PairwiseCouplingTrainer PairwiseCoupling
Let's match name of trainer and method in catalog #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, I renamed pkpd to PairwiseCouplingTrainer
In reply to: 260530151 [](ancestors = 260530151)
In Ova I can access internal predictors, in Pkpd, I can't. Refers to: src/Microsoft.ML.StandardLearners/Standard/MultiClass/Pkpd.cs:245 in af544af. [](commit_id = af544af, deletion_comment = False) |
@@ -42,17 +42,17 @@ namespace Microsoft.ML.Trainers | |||
/// pair. | |||
/// | |||
/// These two can allow you to exploit trainers that do not naturally have a | |||
/// multiclass option, for example, using the Runtime.FastTree.FastTreeBinaryClassificationTrainer | |||
/// multiclass option, for example, using the Microsoft.ML.Trainers.FastTree.FastTreeBinaryClassificationTrainer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Microsoft.ML.Trainers.FastTree.FastTreeBinaryClassificationTrainer [](start = 50, length = 66)
use <see cref="something"/>
otherwise it become obsolete again. #WontFix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally tried this, however it would require the StandardLearners to take a dependency on FastTree. Not worth it for documentation.
In reply to: 260532822 [](ancestors = 260532822)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another solution, will post here soon.
In reply to: 260540515 [](ancestors = 260540515,260532822)
/// to solve a multiclass problem. | ||
/// Alternately, it can allow ML.NET to solve a "simpler" problem even in the cases | ||
/// where the trainer has a multiclass option, but using it directly is not | ||
/// practical due to, usually, memory constraints.For example, while a multiclass | ||
/// practical due to, usually, memory constraints. For example, while a multiclass | ||
/// logistic regression is a more principled way to solve a multiclass problem, it | ||
/// requires that the learner store a lot more intermediate state in the form of | ||
/// L-BFGS history for all classes *simultaneously*, rather than just one-by-one | ||
/// as would be needed for OVA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: If we are renaming OVA to OneVsAll, I'd also change it here. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree -- I will make the predictors private in my ova changes and see if anything breaks. In reply to: 467655648 [](ancestors = 467655648) Refers to: src/Microsoft.ML.StandardLearners/Standard/MultiClass/Pkpd.cs:245 in af544af. [](commit_id = af544af, deletion_comment = False) |
Codecov Report
@@ Coverage Diff @@
## master #2749 +/- ##
==========================================
- Coverage 71.7% 71.68% -0.02%
==========================================
Files 809 809
Lines 142401 142402 +1
Branches 16112 16112
==========================================
- Hits 102102 102083 -19
- Misses 35864 35888 +24
+ Partials 4435 4431 -4
|
@@ -213,6 +214,9 @@ public override TTransformer Fit(IDataView input) | |||
} | |||
} | |||
|
|||
/// <summary> | |||
/// Contains the model parameters and prediction functions for Pkpd. | |||
/// </summary> | |||
public sealed class PkpdModelParameters : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PkpdModelParameters [](start = 24, length = 19)
Maybe rename this one too, so that it does not use the contraction. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -167,7 +168,7 @@ private IDataView MapLabels(RoleMappedData data, int cls1, int cls2) | |||
return MapLabelsCore(NumberDataViewType.Double, (in double val) => val == key1 || val == key2, data); | |||
} | |||
|
|||
throw Host.ExceptNotSupp($"Label column type is not supported by PKPD: {lab.Type}"); | |||
throw Host.ExceptNotSupp($"Label column type is not supported by PkPdTrainer: {lab.Type.RawType}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PkPdTrainer [](start = 77, length = 11)
Can you rename this too? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor comments otherwise looks good!
- Renamed pkpd.cs to PairwiseCouplingTrainer.cs - Updates to PairwiseCoupling api such as removing abbreviations from parameter names, updating comments and documentation. This closes dotnet#2619
@@ -167,7 +166,7 @@ private IDataView MapLabels(RoleMappedData data, int cls1, int cls2) | |||
return MapLabelsCore(NumberDataViewType.Double, (in double val) => val == key1 || val == key2, data); | |||
} | |||
|
|||
throw Host.ExceptNotSupp($"Label column type is not supported by PKPD: {lab.Type}"); | |||
throw Host.ExceptNotSupp($"Label column type is not supported by PairwiseCouplingTrainer: {lab.Type.RawType}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PairwiseCouplingTrainer [](start = 77, length = 23)
nameof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #2619