rvw-org / rvw

R interface to Vowpal Wabbit
22 stars 2 forks source link

Feature/vignette and fixes #12

Closed ivan-pavlov closed 6 years ago

ivan-pavlov commented 6 years ago

Unfortunately, one thing that I still can't get working is the full error output for a vignette.

For example, regular output using the console is:

Converting data.frame to VW format
Starting VW testing session
VW v8.6.1
Using data file: /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/test.vw
Using model file: /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/vw_1534769079_mdl.vw
Command line parameters: 
 -t -d /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/test.vw -i /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/vw_1534769079_mdl.vw --passes 1 -p /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/temp_probs_out.vw
Generating 3-grams for b namespaces.
only testing
predictions = /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/temp_probs_out.vw
Num weight bits = 18
learning rate = 0.5
initial_t = 0
power_t = 0.5
using no cache
Reading datafile = /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/test.vw
num sources = 1
average  since         example        example  current  current  current
loss     last          counter         weight    label  predict features
1.000000 1.000000            1            1.0        2        1        9
0.500000 0.000000            2            2.0        3        3        9
0.750000 1.000000            4            4.0        3        2        9
0.375000 0.000000            8            8.0        2        2        9
0.375000 0.375000           16           16.0        2        2        9
0.281250 0.187500           32           32.0        2        2        9
0.359375 0.437500           64           64.0        1        1        9
0.406250 0.453125          128          128.0        3        2        9
0.351562 0.296875          256          256.0        1        2        9
0.332031 0.312500          512          512.0        3        3        9

finished run
number of examples = 836
weighted example sum = 836.000000
weighted label sum = 0.000000
average loss = 0.334928
total feature number = 7524

But in the vignette I only see this output:

Converting data.frame to VW format
Starting VW testing session
VW v8.6.1
Using data file: /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/test.vw
Using model file: /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/vw_1534769079_mdl.vw
Command line parameters: 
 -t -d /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/test.vw -i /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/vw_1534769079_mdl.vw --passes 1 -p /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/temp_probs_out.vw
Generating 3-grams for b namespaces.
only testing
predictions = /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/temp_probs_out.vw
Num weight bits = 18
learning rate = 0.5
initial_t = 0
power_t = 0.5
using no cache
Reading datafile = /var/folders/yx/6949djdd3yb4qsw7x_95wfjr0000gn/T//RtmpVNU4z4/test.vw
num sources = 1
average  since         example        example  current  current  current
loss     last          counter         weight    label  predict features

So vignette (with error=TRUE in a chunk) only captures error output until first regular output and all error output that comes after that gets omitted.

eddelbuettel commented 6 years ago

Two approvals, so ready to merge?

As for the vignette, you could "cheat" and use eval=FALSE (ie not run the vignette code, just show the invocation) but then just copy and paste the output from a previous run. I have done that in the past too.

ivan-pavlov commented 6 years ago

Yes, then I'll just add this "cheat" in one minute and merge after

eddelbuettel commented 6 years ago

Sounds good to me. And then we merge with a fuller vignette?

ivan-pavlov commented 6 years ago

Yes, I think it's good to show actual full output, even if it's not fully genuine.