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

Make Machine class stateless #5111

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Make Machine class stateless #5111

wants to merge 9 commits into from

Conversation

gf712
Copy link
Member

@gf712 gf712 commented Aug 10, 2020

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

@karlnapf
Copy link
Member

Nice to see this coming in :)

@gf712 gf712 force-pushed the feature/machine_refactor branch from 5794acb to 944cfc9 Compare December 8, 2020 08:45
@gf712
Copy link
Member Author

gf712 commented Dec 8, 2020

@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

@gf712 gf712 force-pushed the feature/machine_refactor branch 2 times, most recently from c4676c9 to 0c4eab8 Compare December 8, 2020 09:58
@@ -78,7 +78,7 @@ namespace shogun
}, v.second);
}
m_ensemble_machine->train(current_data, labs);
return m_ensemble_machine;
return true;
Copy link
Member Author

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.

@gf712 gf712 force-pushed the feature/machine_refactor branch 4 times, most recently from c71110e to 41afca2 Compare December 8, 2020 13:22

machine->train(train_feats, train_labels);

auto pred = machine->apply_multiclass(test_feats);
Copy link
Member Author

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

@gf712 gf712 force-pushed the feature/machine_refactor branch 2 times, most recently from 23f6044 to 61bce85 Compare December 8, 2020 14:35
LiuYuHui and others added 9 commits December 8, 2020 17:03
* add nonparametric machine
* fix notebooks
* 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
@gf712 gf712 force-pushed the feature/machine_refactor branch from 61bce85 to 8ec52a4 Compare December 8, 2020 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants