-
Notifications
You must be signed in to change notification settings - Fork 1.9k
JSON export of model weights
Jack Gerrits edited this page Mar 14, 2022
·
4 revisions
This feature is experimental.
--dump_json_weights_experimental arg Experimental: Output json representation of model parameters.
(type: str)
--dump_json_weights_include_feature_names_experimental
Experimental: Whether to include feature names in json output
(type: bool)
--dump_json_weights_include_extra_online_state_experimental
Experimental: Whether to include extra online state in json output
(type: bool)
You can supply the option --dump_json_weights_experimental <file>
to produce a JSON formatted representation of the contents of the model file.
- Default output only contains values and indices
- To enable feature names use
--dump_json_weights_include_feature_names_experimental
- Adds
terms
andoffset
properties - For scalar features terms is a single value
- For interactions (
-q ::
), terms describes each component of the interaction -
string_value
is null unless--chain_hash
is used - If there is no available inverse hash information for a given feature
terms
andoffset
will be null - Enabling
dump_json_weights_include_feature_names_experimental
will implicitly enable recording hash the lookup table like in--invert_hash
. So the cost is similar to using--audit
or--invert_hash
- Adds
- To enable online state use
--dump_json_weights_include_extra_online_state_experimental
- Adds
gd_extra_online_state
property
- Adds
- Currently can only be used when
GD
is the base learner
An example of a produced default JSON file:
{
"weights": [
{
"index": 1924,
"value": -0.14526426792144776
},
{
"index": 1976,
"value": 0.15885187685489655
},
{
"index": 116060,
"value": 0.07498351484537125
},
{
"index": 162853,
"value": 0.11804789304733277
},
{
"index": 165201,
"value": 0.037461891770362857
},
{
"index": 229902,
"value": 0.05265675485134125
}
]
}
An example of a produced default JSON file with both --dump_json_weights_include_feature_names_experimental
and --dump_json_weights_include_extra_online_state_experimental
enabled:
{
"weights": [
{
"terms": [
{
"name": "1924",
"namespace": " ",
"string_value": null
}
],
"offset": 0,
"index": 1924,
"value": -0.14526426792144776,
"gd_extra_online_state": {
"adaptive": 4.0,
"normalized": 1.0
}
},
{
"terms": [
{
"name": "1976",
"namespace": " ",
"string_value": null
}
],
"offset": 0,
"index": 1976,
"value": 0.15885187685489655,
"gd_extra_online_state": {
"adaptive": 8.0,
"normalized": 1.0
}
},
{
"terms": [
{
"name": "Constant",
"namespace": "",
"string_value": null
}
],
"offset": 0,
"index": 116060,
"value": 0.07498351484537125,
"gd_extra_online_state": {
"adaptive": 12.0,
"normalized": 1.0
}
},
{
"terms": [
{
"name": "sqft",
"namespace": " ",
"string_value": null
}
],
"offset": 0,
"index": 162853,
"value": 0.11804789304733277,
"gd_extra_online_state": {
"adaptive": 0.5895999670028687,
"normalized": 0.3199999928474426
}
},
{
"terms": [
{
"name": "age",
"namespace": " ",
"string_value": null
}
],
"offset": 0,
"index": 165201,
"value": 0.037461891770362857,
"gd_extra_online_state": {
"adaptive": 4.007599830627441,
"normalized": 0.8700000047683716
}
},
{
"terms": [
{
"name": "price",
"namespace": " ",
"string_value": null
}
],
"offset": 0,
"index": 229902,
"value": 0.05265675485134125,
"gd_extra_online_state": {
"adaptive": 1.3827998638153077,
"normalized": 0.5299999713897705
}
}
]
}
- Support more base learners than GD
- 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: