Skip to content
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

Merged
merged 6 commits into from
Jun 23, 2017
Merged

Add a meta information extractor #1031

merged 6 commits into from
Jun 23, 2017

Conversation

micyril
Copy link
Member

@micyril micyril commented Jun 16, 2017

Add a tool for extracting meta information about machine learning algorithms.

Add support for specifying the minimum number of additional arguments.
Add a tool for extracting meta information about machine learning
algorithms.
Copy link
Member

@rcurtin rcurtin left a 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>
Copy link
Member

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.

Copy link
Member Author

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>
Copy link
Member

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?

Copy link
Member Author

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>;
Copy link
Member

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. :)

Copy link
Member Author

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>>();
Copy link
Member

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.

Copy link
Member Author

@micyril micyril Jun 19, 2017

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.
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right.

@@ -113,7 +113,7 @@ void CheckPredictionsType()
BOOST_AUTO_TEST_CASE(PredictionsTypeTest)
{
CheckPredictionsType<LinearRegression, arma::rowvec>();
CheckPredictionsType<FFN<>, arma::mat>();
Copy link
Member Author

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).

@micyril
Copy link
Member Author

micyril commented Jun 22, 2017

By the way, if you don't see any problems, feel free to merge.

@rcurtin rcurtin merged commit e177287 into mlpack:master Jun 23, 2017
@micyril micyril changed the title Extracting meta information Add a meta information extractor Aug 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants