-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add a meta information extractor #1031
Conversation
Add support for specifying the minimum number of additional arguments.
Add a tool for extracting meta information about machine learning algorithms.
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 see no problems with the actual code; I made a handful of very minor comments. Let me know when you are ready for me to merge this.
typename PredictionsType, | ||
typename WeightsType, | ||
bool DatasetInfo, | ||
bool NumClasses> |
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.
If I am understanding correctly, you will use this to determine regression or classification types, right? NumClasses
should be true for all classification types (some changes still necessary there, would you like me to do them?) and false for all regression types.
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.
Yes, you're right again. It will be nice if you normalize API across classification algorithms.
bool NumClasses> | ||
struct TrainForm; | ||
|
||
template<typename PT, typename WT, typename...SignatureParams> |
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.
Minor style comment---should there be a space between typename...
and SignatureParams
?
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 don't mind adding a space. Maybe it's worth to explicitly state about this convention in the style guidelines?
|
||
/* Forms of Train with weights for classification algorithms */ | ||
using WTF4 = TrainForm<MT, PT, WT, false, true>; | ||
using WTF5 = TrainForm<MT, PT, WT, true, true>; |
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 like the names of these variables. :)
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.
:)
CheckPredictionsType<DecisionTree<>, arma::Row<size_t>, arma::mat, | ||
arma::Row<size_t>>(); | ||
CheckPredictionsType<DecisionTree<>, arma::Row<char>, arma::mat, | ||
arma::Row<char>>(); |
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.
Just out of curiosity, did you try alternate types for other classes than DecisionTree<>
and have a failure? I think since #290 is not done yet, there may be problems with that for some classes.
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 was trying it also for HoeffdingTree<>
in the line 121:
CheckPredictionsType<HoeffdingTree<>, arma::Row<size_t>, arma::imat>();
Here arma::imat
is used is as the data type in the Train
method.
* A wrapper struct for holding a Train form. | ||
* | ||
* @tparam MatType The type of data. | ||
* @tparam PredictionsType The type of predictions. |
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.
The assumption here is that LabelsType == PredictionsType
, right? I think that's completely reasonable, I just want to make sure I am comprehending fully.
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.
Yes, you're right.
src/mlpack/tests/cv_test.cpp
Outdated
@@ -113,7 +113,7 @@ void CheckPredictionsType() | |||
BOOST_AUTO_TEST_CASE(PredictionsTypeTest) | |||
{ | |||
CheckPredictionsType<LinearRegression, arma::rowvec>(); | |||
CheckPredictionsType<FFN<>, arma::mat>(); |
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 disabled the check since API for FFN have changed (now the Train method takes data and predictions as values, rather than as const references).
By the way, if you don't see any problems, feel free to merge. |
Add a tool for extracting meta information about machine learning algorithms.