[][src]Module gbdt::input

This module implements the data loader.

Currently we support to kind of input format: csv format and libsvm data format.

Example

LibSVM format

use gbdt::input::InputFormat;
use gbdt::input;
let test_file = "data/xgb_binary_logistic/agaricus.txt.test";
let mut fmt = input::InputFormat::txt_format();
fmt.set_feature_size(126);
fmt.set_delimeter(' ');
let test_data = input::load(test_file, fmt);

CSV format

use gbdt::input::InputFormat;
use gbdt::input;
let test_file = "data/xgb_multi_softmax/dermatology.data.test";
let mut fmt = InputFormat::csv_format();
fmt.set_feature_size(34);
let test_data = input::load(test_file, fmt);

Structs

InputFormat

The input file format struct.

Enums

FileFormat

This enum type defines the data file format.

Functions

infer

Function used for input file type inference. This can help recognize the file format. If the file is in csv type, this function also helps to check whether the csv file has header.

load

Load file with certain input format.

load_csv

Load csv file.

load_txt

Load txt file.