train modified with more exact values

This commit is contained in:
Yevheniia Tsapkova 2020-05-26 11:52:02 +00:00
parent ba0ba3b068
commit 9d8b8556b2

4
train.py Executable file → Normal file
View File

@ -45,8 +45,8 @@ def predict_data(data):
prepared = prepare_data(data)
vectorized = vectorize.transform(data["text"])
predicted = bayes.predict_proba(vectorized)[:,1]
predicted[predicted < 0.05] = 0.05
predicted[predicted > 0.95] = 0.95
predicted[predicted < 0.05] = 0.00000005
predicted[predicted > 0.95] = 0.99999995
return predicted
dev_predicted = predict_data(dev_set)