You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Catboost (https://catboost.ai/) for classification and have a bit of complication with return values.
In case of xgboost, when you run xgboost.predict(xgb.DMatrix(x)), it returns a single value which gives the probability of a sample being in class 1 against class 0.
def predict(x):
a, b = cat_clf.predict_proba(x)
return b
as I need the second value, the probability of being class 1, and put that in my model. The problem is, when I run the app, it somehow returns the value of 'a' instead of 'b'.
I saw your pytorch example (https://github.com/ucbrise/clipper/blob/develop/examples/frameworks/pytorch_on_docker_example.ipynb) and here you can see the identical behavior. cell number [7], the model returns two values but in cell number [21], the 'output' is the first value only.
How can I make it return the second value?
The text was updated successfully, but these errors were encountered:
I am using Catboost (https://catboost.ai/) for classification and have a bit of complication with return values.
In case of xgboost, when you run xgboost.predict(xgb.DMatrix(x)), it returns a single value which gives the probability of a sample being in class 1 against class 0.
Catboost, however, returns both values (https://catboost.ai/docs/concepts/python-reference_catboostclassifier_predict_proba.html)
for example.
a, b = catboost_model.predict_proba(data)
where a = probability of being class 0, b = probability of being class 1,
and a+b should be equal to 1.
I defined my 'func' to be
def predict(x):
a, b = cat_clf.predict_proba(x)
return b
as I need the second value, the probability of being class 1, and put that in my model. The problem is, when I run the app, it somehow returns the value of 'a' instead of 'b'.
I saw your pytorch example (https://github.com/ucbrise/clipper/blob/develop/examples/frameworks/pytorch_on_docker_example.ipynb) and here you can see the identical behavior. cell number [7], the model returns two values but in cell number [21], the 'output' is the first value only.
How can I make it return the second value?
The text was updated successfully, but these errors were encountered: