NAME
AI::XGBoost::DMatrix - XGBoost class for data
VERSION
version 0.11
SYNOPSIS
use aliased 'AI::XGBoost::DMatrix';
my $train_data = DMatrix->FromFile(filename => 'agaricus.txt.train');
DESCRIPTION
XGBoost DMatrix perl model
Work In Progress, the API may change. Comments and suggestions are welcome!
METHODS
From
Construct a DMatrix from diferent sources. Based on parameters dispatch to the correct From* method
Refer to From* to see what can be done.
FromFile
Construct a DMatrix from a file
Parameters
- filename
-
File to read
- silent
-
Supress messages
FromMat
Construct a DMatrix from a bidimensional array
Parameters
- matrix
-
Bidimensional array
- label
-
Array with the labels of the rows of matrix. Optional
- missing
-
Value to identify missing values. Optional, default `NaN`
set_float_info
Set float type property
Parameters
- field
-
Field name of the information
- info
-
array with the information
set_float_info_pdl
Set float type property
Parameters
- field
-
Field name of the information
- info
-
Piddle with the information
get_float_info
Get float type property
Parameters
- field
-
Field name of the information
set_uint_info
Set uint type property
Parameters
- field
-
Field name of the information
- info
-
array with the information
get_uint_info
Get uint type property
Parameters
- field
-
Field name of the information
save_binary
Save DMatrix object as a binary file.
This file should be used with FromFile
Parameters
- filename
-
Filename and path
- silent
-
Don't show information messages, optional, default 1
set_label
Set label of DMatrix. This label is the "classes" in classification problems
Parameters
- data
-
Array with the labels
set_label_pdl
Set label of DMatrix. This label is the "classes" in classification problems
Parameters
- data
-
Piddle with the labels
get_label
Get label of DMatrix. This label is the "classes" in classification problems
set_weight
Set weight of each instance
Parameters
- weight
-
Array with the weights
set_weight_pdl
Set weight of each instance
Parameters
- weight
-
pdl with the weights
get_weight
Get the weight of each instance
set_base_margin
Set base margin of booster to start from
Parameters
- margin
-
Array with the margins
get_base_margin
Get the base margin
set_group
Set group size
Parameters
- group
-
Array with the size of each group
num_row
Number of rows
num_col
Number of columns
dims
Dimensions of the matrix. That is: rows, columns
slice
Slice the DMatrix and return a new DMatrix tha only contains the list of indices
Parameters
- list_of_indices
-
Reference to an array of indices
DEMOLISH
Free the DMatrix
This method gets called automatically
AUTHOR
Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
COPYRIGHT AND LICENSE
Copyright (c) 2017 by Pablo Rodríguez González.