python code for vowpal wabbit multilabel classifier with option --multilabel_oaa
Budget: $10 – $30 USD
write
python code for vowpal wabbit multilabel classifier with option --multilabel_oaa
data find by yourself with many rows and features
features are both categorical and continues
>>> import numpy as np
>>> X = np.array([ [10, 10], [8, 10], [-5, 5.5], [-5.4, 5.5], [-20, -20], [-15, -20] ])
>>> y = np.array([1, 1, 2, 2, 3, 3])
>>> from vowpalwabbit.sklearn_vw import VWMultiClassifier
>>> model = VWMultiClassifier(oaa=3, loss_function='logistic')
>>> _ = model.fit(X, y)
>>> model.predict_proba(X)
array([[0.38928846, 0.30534211, 0.30536944],
[0.40664235, 0.29666999, 0.29668769],
[0.52324486, 0.23841164, 0.23834346],
[0.5268591 , 0.23660533, 0.23653553],
[0.65397811, 0.17312808, 0.17289382],
[0.61190444, 0.19416356, 0.19393198]])
https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/test/RunTests
# Test 85: check multilabel_oaa
{VW} --multilabel_oaa 10 -d train-sets/multilabel -p multilabel.predict
python code for vowpal wabbit multilabel classifier with option --multilabel_oaa
data find by yourself with many rows and features
features are both categorical and continues
>>> import numpy as np
>>> X = np.array([ [10, 10], [8, 10], [-5, 5.5], [-5.4, 5.5], [-20, -20], [-15, -20] ])
>>> y = np.array([1, 1, 2, 2, 3, 3])
>>> from vowpalwabbit.sklearn_vw import VWMultiClassifier
>>> model = VWMultiClassifier(oaa=3, loss_function='logistic')
>>> _ = model.fit(X, y)
>>> model.predict_proba(X)
array([[0.38928846, 0.30534211, 0.30536944],
[0.40664235, 0.29666999, 0.29668769],
[0.52324486, 0.23841164, 0.23834346],
[0.5268591 , 0.23660533, 0.23653553],
[0.65397811, 0.17312808, 0.17289382],
[0.61190444, 0.19416356, 0.19393198]])
https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/test/RunTests
# Test 85: check multilabel_oaa
{VW} --multilabel_oaa 10 -d train-sets/multilabel -p multilabel.predict