pub struct InputFormat {
    pub ftype: FileFormat,
    pub header: bool,
    pub label_idx: usize,
    pub enable_unknown_value: bool,
    pub delimeter: char,
    pub feature_size: usize,
}
Expand description

The input file format struct.

Fields

ftype: FileFormat

Data file format

header: bool

Set if ftype is set to FileFormat. Indicates whether the csv has header.

label_idx: usize

Set if ftype is set to FileFormat. Indicates which colume is the data label. (default = 0)

enable_unknown_value: bool

Set if ftype is set to FileFormat. Indicates if we allow unknown value in data file or not.

delimeter: char

Delimeter of the data file.

feature_size: usize

Set if ftype is set to FileFormat. Indicates the total feature size.

Implementations

Return a default CSV input format.

Example
use gbdt::input::InputFormat;
let mut fmt = InputFormat::csv_format();
println!("{}", fmt.to_string());

Return a default LibSVM input format.

Example
use gbdt::input::InputFormat;
let mut fmt = InputFormat::txt_format();
println!("{}", fmt.to_string());

Transform the input format to human readable string.

Example
use gbdt::input::InputFormat;
let mut fmt = InputFormat::csv_format();
println!("{}", fmt.to_string());

Set feature size for the LibSVM input format.

Example
use gbdt::input::InputFormat;
let mut fmt = InputFormat::txt_format();
fmt.set_feature_size(126); // the total feature size

Set for label index for CSV format.

Example
use gbdt::input::InputFormat;
let mut fmt = InputFormat::csv_format();
fmt.set_label_index(34);

Set for label index for CSV format.

Example
use gbdt::input::InputFormat;
let mut fmt = InputFormat::txt_format();
fmt.set_delimeter(' ');

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.