Skip to content

Commit

Permalink
Merge pull request #942 from jongbinjung/master
Browse files Browse the repository at this point in the history
fix documentation typo
  • Loading branch information
JohnLangford committed Feb 19, 2016
2 parents 4ad820b + 23940a5 commit be7494a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions R/r.vw/R/vw.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#'is NULL, the validation labels file is deleted before exiting the function. If validation_labels is not
#'NULL, it indicates the path where validation labels should be stored.
#'@param verbose mostly used to debug but shows AUC and the vw command used to train the model
#'@param keep_preds TRUE (default) to return a vector of the predictions
#'@param do_evaluation TRUE to compute auc on validation_data. Use FALSE, to just score data
#'@param use_perf use perf to compute auc. Otherwise, auc_roc() from the R package pROC is used.
#'@examples
Expand All @@ -61,7 +62,7 @@ vw <- function(training_data, validation_data, model='mdl.vw',
out_probs= NULL, validation_labels= NULL,
loss='logistic', b=25,
learning_rate=0.5, passes=1, l1=NULL, l2=NULL, early_terminate=NULL,
link_function='--link=logistic', extra=NULL,
link_function='--link=logistic', extra=NULL, keep_preds = TRUE,
do_evaluation=TRUE, use_perf=TRUE, plot_roc=TRUE, verbose=TRUE){


Expand Down Expand Up @@ -157,6 +158,9 @@ vw <- function(training_data, validation_data, model='mdl.vw',
print(verbose_log)
}

if(keep_preds)
probs = fread(out_probs)[['V1']]

## delete temporary files
for(i in 1:2)
if("data.frame" %in% class(data_args[[i]]))
Expand All @@ -166,7 +170,7 @@ vw <- function(training_data, validation_data, model='mdl.vw',
if(exists("del_val") && del_val)
file.remove(validation_labels)

return(auc)
return(list(auc=auc, preds=probs))
}

# Reads labels file (from the validation dataset)
Expand Down
2 changes: 1 addition & 1 deletion R/r.vw/man/dt2vw.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ by VW as two distinct categorical variables)}
\item{tag}{[string] tag of each line of the dataset}

\item{hard_parse}{[bool] if equals true, parses the data more strictly to avoid feeding VW with false categorical
variables like '_', or same variables perceived differently life "_var" and "var"}
variables like '_', or same variables perceived differently like "_var" and "var"}
}
\description{
Create a vw data file from a R data.frame object
Expand Down
2 changes: 2 additions & 0 deletions R/r.vw/man/vw.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ NULL, it indicates the path where validation labels should be stored.}

\item{extra}{These is where more VW commands can be passed as text}

\item{keep_preds}{TRUE (default) to return a vector of the predictions}

\item{do_evaluation}{TRUE to compute auc on validation_data. Use FALSE, to just score data}

\item{use_perf}{use perf to compute auc. Otherwise, auc_roc() from the R package pROC is used.}
Expand Down

0 comments on commit be7494a

Please sign in to comment.