I am trying to load model from a file
modelfromfile = pyvw.vw(quiet=True).load('some.model')
But I am getting following error --
AttributeError: 'vw' object has no attribute 'load'
Hey guys, I was wondering... what influences the time to load a model? I've tested model files of different sizes, but it doesn't seem like there's any correlation.
Is it the total number weights?
The number of non-null weights? (I don't think so because this is correlated to file size - which isn't correlated to loading time)... and by the way, is there an easy way to count the number of non-null weights? I'm currently iterating on all weights and counting those that aren't 0
Good morning everyone... I have a simple question regarding one of the Personalizer's examples.
Why the JSON input in this example defines the features as an array of objects? Why not simply an object? Does it have anything to do with Namespaces?
Hi all, I was wondering how lrq (aka factorization machine) plays with Importance Weight Aware Updates (https://arxiv.org/pdf/1011.1576.pdf) since the development in that paper is for linear models:
In this paper we focus on linear models i.e. p = <w, x> where w is a vector of weights
but lrq models are not linear given that they involve products of weights. So what about the property:
Therefore all gradients of a given example point to the same direction and only differ in magnitude.
that's assumed in the paper? I wasn't able to find any related discussion.
vw --active --port 6075 --daemon --foreground -i existing_model_filename.ext
Then I run python3.9 active_iterator.py localhost 6075 unlabeled_examples_filename.ext
. All of the over 800K unlabeled examples return an importance of exactly 1.0, even though the predictions are variable and largely accurate. In the past I have received highly useful and variable importance weights, and I cannot figure out what is wrong now. The only possibility that even occurs to me is that in active_iterator.py I had to change the first line of the recvall function to buf=s.recv(n).decode() from buf=s.recv(n), and I changed the sendall calls from sock.sendall(line) to sock.sendall(line.encode()). Any ideas? Thanks very much.
VWMultiClassifier.fit
only supports a 1-d y
Hello everyone. I have problems with convergence for --cv_explore_adf
on simple synthetic dataset of 3 classes and 5 features, all informative (the data was simulated via scikit-learn's make_classification
)
Here's a gist and an output plot above. Basically, it doesnt learn the difference b/w classes and oerforms no better than baseline (predict one class each time)/ tried w/ softmax exploration w/ different lambdas (since it's not bound by epsilon-soft convergence bound like e-greedy policy), same results
FYI, sklearn's softmax multiclass classifier gets 80% mean accuracy. So I really don't understand what might be the problem with VW (maybe smaller learning rate needed?). The documantation and the lack of --audit
support in Python certainly don't help.
https://gist.github.com/ColdTeapot273K/76a91a0416cb9b8ecb114e625f88f4a0
Good first issue
label and se if anything interests you
may you help understand why I have bug on Windows 10 and vowpalwabbit 8.10.2 or I do something wrong:
this code runs correctly and it takes few seconds
from vowpalwabbit import pyvw
ridge_lambda = 0.001
loss_function = 'squared'
VWmodel_simple = pyvw.vw(
learning_rate = 0.1,
l2 = ridge_lambda,
loss_function = loss_function,
)
but this code not running correctly
VWmodel_simple = pyvw.vw(
cache_file = 'my_VW_2.cache',
passes = 3,
learning_rate = 0.1,
l2 = ridge_lambda,
loss_function = loss_function,
)
code run never finished
what is wrong with creating this file 'my_VW_2.cache' ??
command line output is
using l2 regularization = 0.001
Num weight bits = 18
learning rate = 0.1
initial_t = 0
power_t = 0.5
decay_learning_rate = 1
creating cache_file = my_VW_2.cache
Reading datafile =
num sources = 1
Enabled reductions: gd, scorer
average since example example current current current
loss last counter weight label predict features
HI. I am using https://vowpalwabbit.org/tutorials/cb_simulation.html. I need to save the model and use it to later as the reward(feedback comes to the system few hours later). vw1 = pyvw.vw("--cb_explore_adf -q UA --quiet --epsilon 0.2 save_resume=True")
num_iterations = 5000
ctr = run_simulation(vw1, num_iterations, users, times_of_day, actions, get_cost)
Hello, can anyone tell how to make cb_explore_adf
agent respond to requests in daemon mode properly? i send the multiline commands via echo ... | netcat ...
like in documentation and get no response.
If i launch w/ --audit
flag i recieve a bunch of info with unintuitive formatting (see attachment). i assume the 1st value in each line is action probability, and the very last line is some combined gradients or whatnot. Very different from a pmf output, like in python example on website.
Sorry, couldn't attach the img to my prev message thread
A problem:
for some reasons i get n+1
size of pmf for data with n
distinct action.
Details:
When i do training on cb_explore_adf
for datapoints only with 3 actions (no features apart from shared|...
) and supply one of these examples for testing (action:cost:proba
removed obviously), i get 4 actions in the output file. Why it might be?
I trained the contextual bandit as vw1 = pyvw.vw("-d data/cb_load.dat --cb_explore_adf -q UA -P 1 --invert_hash mymodel.inverted") on https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/test/train-sets/cb_load.dat with the --inverted-hash and I got the mymodel.inverted
I could understand the user and action features. What does 18107:0.137426 . means in "User^time_of_day=afternoonAction^article=politics:18107:0.137426" ?
I think 18107 is the hash value for "User^time_of_day=afternoonAction^article=politics" and 0.137426 is weight. I don't know if this is correct?
How can I get the probability corresponding to the user and action features from the weights?
Version 8.11.0
Id
Min label:-1
Max label:0
bits:18
lda:0
0 ngram:
0 skip:
options: --cb_adf --cb_explore_adf --cb_type mtr --csoaa_ldf multiline --csoaa_rank --quadratic UA
Checksum: 2033437909
event_sum 113
action_sum 791
:0
User^time_of_day=afternoonAction^article=politics:18107:0.137426
User^user=Tom:32581:-0.0636371
User^user=TomAction^article=politics:38087:-0.0636749
Action^article=politics:52568:-0.110663
User^time_of_day=morningAction^article=music:58967:0.224528
User^user=AnnaAction^article=politics:62875:0.0165196
User^time_of_day=afternoon:65137:-0.0253498
Action^article=music:67569:-0.0505464
User^time_of_day=afternoonAction^article=food:67793:0.121444
User^time_of_day=morningAction^article=politics:77054:-0.192732
User^user=AnnaAction^article=music:81714:0.297336
Action^article=sports:86811:0.0540273
User^user=TomAction^article=music:89710:-0.101787
User^user=AnnaAction^article=sports:93144:0.0540273
Action^article=food:99122:0.121444
User^time_of_day=afternoonAction^article=music:101394:-0.190187
User^user=AnnaAction^article=food:113649:0.0457554
Constant:116060:-0.0947514
User^time_of_day=afternoonAction^article=sports:121080:0.0540273
User^user=TomAction^article=food:121517:0.109427
Action^article=camping:134640:0.0742112
User^user=Anna:141841:0.0966574
User^time_of_day=afternoonAction^article=health:144204:0.0344906
User^user=TomAction^article=camping:152687:0.0742112
User^user=AnnaAction^article=health:163948:0.0344906
Action^article=health:178351:0.0971796
User^user=TomAction^article=health:188720:0.09161
User^time_of_day=morningAction^article=health:219401:0.09161
User^time_of_day=morning:243586:0.0320462
User^time_of_day=morning*Action^article=camping:257110:0.0742112
Hi All,Is there any way to add importance weight to off line training of the contextual bandits? Similar to linear regression where we specify importance weight as 2 in the training example " 1 2 second_house | price:.18 sqft:.15 age:.35 1976".
This will help in reducing the training time of contextual bandits as the training data points are in billions. But we get good reduction if we use importance weight as data points are repeated.