Description Usage Arguments Details Value Examples
This function allows to run predictions on provided data.
1 2 3 4 5 6 7 8 9 10 | lgbm.predict(model, y_pred = NA, x_pred = NA, SVMLight = is(x_pred,
"dgCMatrix"), data_has_label = FALSE, lgbm_path = ifelse(is.list(model),
model[["lgbm"]], getwd()), workingdir = ifelse(is.list(model),
model[["Path"]], getwd()), input_model = ifelse(is.list(model),
model[["Name"]], "lgbm_model.txt"), pred_conf = "lgbm_pred.conf",
predict_leaf_index = FALSE, verbose = TRUE,
data_name = ifelse(is.list(model) & is.null(dim(x_pred)), model[["Valid"]],
paste0("lgbm_test", ifelse(SVMLight, ".svm", ".csv"))), files_exist = TRUE,
output_preds = "lgbm_predict_result.txt",
data.table = exists("data.table"))
|
model |
Type: list. The model file. If a character vector is provided, it is considered to be the model which is going to be saved as |
y_pred |
Type: vector. The validation labels. Leave it alone unless you know what you are doing. Defaults to |
x_pred |
Type: data.table (preferred), data.frame, or dgCMatrix (with |
SVMLight |
Type: boolean. Whether the input is a dgCMatrix to be output to SVMLight format. Setting this to |
data_has_label |
Type: boolean. Whether the data has labels or not. Do not modify this. Defaults to |
lgbm_path |
Type: character. Where is stored LightGBM? Include only the folder to it. Defaults to |
workingdir |
Type: character. The working directory used for LightGBM. Defaults to |
input_model |
Type: character. The file name of the model. Defaults to |
pred_conf |
Type: character. The name of the pred_conf file for the model. Defaults to |
predict_leaf_index |
Type: boolean. Should LightGBM predict leaf indexes instead of pure predictions? Defaults to |
verbose |
Type: boolean. Whether to print to console verbose information. When FALSE, the printing is diverted to |
data_name |
Type: character. The file output name for the vaildation file. Defaults to |
files_exist |
Type: boolean. Whether to NOT create CSV files for the prediction data, if already created. Defaults to |
output_preds |
Type: character. The output prediction file. Defaults to |
data.table |
Type: boolean. Whether to use data.table to read data (returns a data.table). Defaults to |
If for some reason you lose the ability to print in the console, run sink()
in the console several times until you get an error.
The predictions as a vector.
1 | #None yet.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.