Function gbdt::input::load

source · []
pub fn load(file_name: &str, input_format: InputFormat) -> Result<DataVec>
Expand description

Load file with certain input 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);

Error

Raise error if file cannot be open correctly.