The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

AI::XGBoost::DMatrix - XGBoost class for data

VERSION

version 0.007

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

get_float_info

Get float type property

Parameters

field

Field name of the information

set_label

Set label of DMatrix. This label is the "classes" in classification problems

Parameters

data

Array 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

get_weight

Get the weight of each instance

num_row

Number of rows

num_col

Number of columns

dims

Dimensions of the matrix. That is: rows, columns

DEMOLISH

Free the

AUTHOR

Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017 by Pablo Rodríguez González.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004