[−][src]Struct gbdt::input::InputFormat
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.
Methods
impl InputFormat
[src]
pub fn csv_format() -> InputFormat
[src]
Return a default CSV input format.
Example
use gbdt::input::InputFormat; let mut fmt = InputFormat::csv_format(); println!("{}", fmt.to_string());
pub fn txt_format() -> InputFormat
[src]
Return a default LibSVM input format.
Example
use gbdt::input::InputFormat; let mut fmt = InputFormat::txt_format(); println!("{}", fmt.to_string());
pub fn to_string(&self) -> String
[src]
Transform the input format to human readable string.
Example
use gbdt::input::InputFormat; let mut fmt = InputFormat::csv_format(); println!("{}", fmt.to_string());
pub fn set_feature_size(&mut self, size: usize)
[src]
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
pub fn set_label_index(&mut self, idx: usize)
[src]
Set for label index for CSV format.
Example
use gbdt::input::InputFormat; let mut fmt = InputFormat::csv_format(); fmt.set_label_index(34);
pub fn set_delimeter(&mut self, delim: char)
[src]
Set for label index for CSV format.
Example
use gbdt::input::InputFormat; let mut fmt = InputFormat::txt_format(); fmt.set_delimeter(' ');
Trait Implementations
impl Clone for InputFormat
[src]
fn clone(&self) -> InputFormat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for InputFormat
[src]
impl Debug for InputFormat
[src]
impl Serialize for InputFormat
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for InputFormat
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for InputFormat
impl Sync for InputFormat
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,