-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Predicting probabilities
By default, VW predictions are in the range [-50, +50]
(theoretically any real number, but VW truncates it to [-50, +50]).
To convert them to {-1, +1}, use --binary
– positive predictions are simply mapped to +1, negative to -1.
To convert them to [0, +1], use --link=logistic
. This uses the logistic function 1/(1 + exp(-x)). If you use --loss_function=logistic
, you can interpret the numbers as probabilities of the +1 class. So to output the probability prediction to a file use --loss_function=logistic --link=logistic -p probs.txt
.
(For completeness, to convert the predictions to [-1, +1], use --link=glf1
. This uses formula 2/(1 + exp(-x)) - 1, i.e. generalized logistic function with limits of 1.)
By default in oaa, VW predict the label of the most probable class.
To get probabilities for each of the 1..N classes, simply use --oaa N --loss_function=logistic --probabilities -p probs.txt
.
Logistic link function will be used automatically (you should not specify it with --link
) and the numbers (probabilities) will be normalized so they sum up to 1.
See example usage in test 109.
When using --probabilities
during training (or testing with gold costs available), a multi-class logistic loss is reported in addition to the standard zero-one loss.
The option --probabilities
is stored in the model, so it does not need (actually cannot) be repeated when testing.
For cost-sensitive oaa with label-dependent features,
use --csoaa_ldf=mc --loss_function=logistic --probabilities -p probs.txt
.
See example usage in test 110.
Add command-line examples here (with input data and expected output) instead of linking tests.
- Home
- First Steps
- Input
- Command line arguments
- Model saving and loading
- Controlling VW's output
- Audit
- Algorithm details
- Awesome Vowpal Wabbit
- Learning algorithm
- Learning to Search subsystem
- Loss functions
- What is a learner?
- Docker image
- Model merging
- Evaluation of exploration algorithms
- Reductions
- Contextual Bandit algorithms
- Contextual Bandit Exploration with SquareCB
- Contextual Bandit Zeroth Order Optimization
- Conditional Contextual Bandit
- Slates
- CATS, CATS-pdf for Continuous Actions
- Automl
- Epsilon Decay
- Warm starting contextual bandits
- Efficient Second Order Online Learning
- Latent Dirichlet Allocation
- VW Reductions Workflows
- Interaction Grounded Learning
- CB with Large Action Spaces
- CB with Graph Feedback
- FreeGrad
- Marginal
- Active Learning
- Eigen Memory Trees (EMT)
- Element-wise interaction
- Bindings
-
Examples
- Logged Contextual Bandit example
- One Against All (oaa) multi class example
- Weighted All Pairs (wap) multi class example
- Cost Sensitive One Against All (csoaa) multi class example
- Multiclass classification
- Error Correcting Tournament (ect) multi class example
- Malicious URL example
- Daemon example
- Matrix factorization example
- Rcv1 example
- Truncated gradient descent example
- Scripts
- Implement your own joint prediction model
- Predicting probabilities
- murmur2 vs murmur3
- Weight vector
- Matching Label and Prediction Types Between Reductions
- Zhen's Presentation Slides on enhancements to vw
- EZExample Archive
- Design Documents
- Contribute: