0

I'm using catboostEvaluate method to predict a classification problem. In Catboost, the evaluation result is like this:

model.predict(X_validation)
array([0, 0, 0, ..., 1, 0, 0])

However, in clickhouse, the result is this like:

# clickhouse client --host 127.0.0.1 --query="SELECT catboostEvaluate('/root/occupy.bin', Temperature , Humidity , Light , CO2 , HumidityRatio ) AS prediction FROM occupancy LIMIT 1" 

4.695691092573497

It is not a result of a classification problem.

Does anyone knows how to solve this problem, to change the result to 0 or 1? I have no idea whether this is a bug or it's a feature.

1 Answers1

0

I had this issue and it's very hard to find in docs what to do, but:

1. / (1. + exp(-pred)) as prob

that's how you get the obvious probability. then just use your threshold to convert it into 0/1

if(prob>0.5,1,0) as class