-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C API Example Manipulation
Jack Gerrits edited this page Apr 27, 2020
·
17 revisions
float get_topic_prediction(example* ec, size_t i); // i=0 to max topic -1
float get_label(example* ec);
float get_importance(example* ec);
float get_initial(example* ec);
float get_prediction(example* ec);
float get_cost_sensitive_prediction(example* ec);
v_array<float>& get_cost_sensitive_prediction_confidence_scores(example* ec);
uint32_t* get_multilabel_predictions(example* ec, size_t& len);
float get_action_score(example* ec, size_t i);
size_t get_action_score_length(example* ec);
size_t get_tag_length(example* ec);
const char* get_tag(example* ec);
size_t get_feature_number(example* ec);
float get_confidence(example* ec);
feature* get_features(vw& all, example* ec, size_t& feature_number);
void return_features(feature* f);
void add_constant_feature(vw& all, example* ec);
void add_label(example* ec, float label, float weight = 1, float base = 0);
void copy_example_data(bool audit, example*, example*, size_t, void (*copy_label)(void*, void*));
void copy_example_metadata(bool audit, example*, example*);
void copy_example_data(bool audit, example*, example*); // metadata + features, don't copy the label
void clear_example_data(example&); // don't clear the label
void move_feature_namespace(example* dst, example* src, namespace_index c);
TBD
TBD
enum prediction_type
{
empty,
simple,
multi,
cs,
cb,
ccb,
slates,
cb_eval,
multilabels,
}
ErrorCode get_prediction(prediction_type type, void** out_prediction);
ErrorCode set_prediction(prediction_type type, void* prediction);enum prediction_type
{
empty,
simple,
multi,
cs,
cb,
ccb,
slates,
cb_eval,
multilabels,
}
ErrorCode get_prediction(prediction_type type, void** out_param);An example is composed of:
- Features -> map<namespace_index, feature_space>
- Where feature_space -> hash[], value[]
- Prediction
- prediction_type
- prediction_data
- Label
- label_type
- label_data
-
Metadata:
- Interactions - required
- ft_offset - required
- tag - required
- Weight - required
- num_features - maybe expose?
- total_sum_feat_sq - maybe expose?
- partial_prediction - maybe expose?
- loss - maybe expose?
- example_counter - internal
- updated_prediction - internal
- confidence - internal
- test_only - internal
- end_pass - internal
- sorted - internal
Sections: prediction, label, features, interactions, other metadata
- 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: