-
-
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
auto dispatch create methods in python #4998
Labels
Comments
Hmmm, this would be more complicated, because we call get with a visitor pattern, so we have Any to visit on. What you need is a way to dispatch with sgobject to the “base” class. Will have to think about it! Otherwise there is the naive with a try except for loop in Python.. |
ghost
mentioned this issue
Sep 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have
get
for python, which automatically returns the correct type, i.e.get('my_vector')
andget('my_int')
return a numpy array and an int respectively.Now, why don't we do the same thing for creating shogun objects via factories? (In Python)
create_kernel('GaussianKernel')
->create('GaussianKernel')
That should be possible using exactly the same mechanics as in
get
, or do I get this wrong? @gf712 Maybe you can provide pointers for a student to do thisThe text was updated successfully, but these errors were encountered: