-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Make Machine class stateless #5111
base: develop
Are you sure you want to change the base?
Conversation
Nice to see this coming in :) |
5794acb
to
944cfc9
Compare
@LiuYuHui sorry for the delays, I was meant to do this a while ago. I rebased your branch now and it should be good to merge soon. Feel free to review in case I messed up the rebase |
c4676c9
to
0c4eab8
Compare
@@ -78,7 +78,7 @@ namespace shogun | |||
}, v.second); | |||
} | |||
m_ensemble_machine->train(current_data, labs); | |||
return m_ensemble_machine; | |||
return 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.
@LiuYuHui I had to change the return type, since that is the type of Machine::train. In future it might be worth returning the Machine object.
c71110e
to
41afca2
Compare
|
||
machine->train(train_feats, train_labels); | ||
|
||
auto pred = machine->apply_multiclass(test_feats); |
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.
At some point Machines should return a pointer to themselves after calling train (like in sklearn) so that we can use a builder pattern in situations like this
23f6044
to
61bce85
Compare
* add nonparametric machine * fix notebooks
* refactor gp machine
* Refactor KernelMachine
* refactor linear machine * fix unit tests * update gpl submodule * use DotFeatures in train_machine
* Refactor Multiclass Machine
* Add NonParametricMachine class (#5055) * add nonparametric machine * fix notebooks * Refactor NearestCentroid class
* make BaggingMachine stateless * change get_oob_error to lambda * fix meta example * fix segfault
* refactor all machines * fix unit test * fix python legacy and jupyter notebook
61bce85
to
8ec52a4
Compare
@LiuYuHui's main GSoC project. Machine class becomes stateless wrt Features and Labels which means that the user has to provide features and labels when fitting a Machine. This is essentially done by adding the notion of (Non)Parametric Machines.