rth/pysofia

how to use svm_train and svm_test

kirk86 opened this issue · 2 comments

Hi, I think svm_train might have some errors. For instance in sofia_ml.py in line 93 in function svm_train the arguments are in the wrong order from what are in the function signature of svm_train.

I always get the following error AttributeError: "'int' object has no attribute 'value'" and that's because in the function _sofia_ml.train_fast it's been using things such as learner.value, loop.value etc.

Since we give arguments as numbers that's what is causing the issue, I don't understand why it is coded like this loop.value. Where does that come from?

The only thing that I can think of is that loop should be a class in that case in order to use the dot operator.

rth commented

@kirk86 Yes, loop, learner etc are subclasses of Enum. The file pysofia/tests/test.py has an example of how to use svm_train and svm_test. Sorry it's not very clear; a Pull Request adding a better example of how to use these functions to examples/ (as a plain python script or a jupyter notebook) would be welcome )

@rth thanks for the answer.... I'll try to add some once I get the grip of it.