pub struct DataReader { /* private fields */ }Expand description
Reads a text dataset of binary features into a Cover.
The default format is one instance per line, whitespace separated, the
label in column 0, # starting a comment, and no header. Feature values
must be 0 or 1, and labels non-negative integers.
Implementations§
Source§impl DataReader
impl DataReader
Sourcepub fn with_format(self, format: DataFormat) -> Self
pub fn with_format(self, format: DataFormat) -> Self
Sets the column delimiter.
Sourcepub fn with_headers(self, has_headers: bool) -> Self
pub fn with_headers(self, has_headers: bool) -> Self
Whether the first data line is a header to skip.
Sourcepub fn with_comment_char(self, comment_char: Option<char>) -> Self
pub fn with_comment_char(self, comment_char: Option<char>) -> Self
Lines starting with this character are ignored.
Sourcepub fn with_label_column(self, label_column: Option<usize>) -> Self
pub fn with_label_column(self, label_column: Option<usize>) -> Self
Which column holds the label; None for unlabelled data.
Sourcepub fn auto_detect_format(self, path: &Path) -> Self
pub fn auto_detect_format(self, path: &Path) -> Self
Picks the delimiter from the file extension.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataReader
impl RefUnwindSafe for DataReader
impl Send for DataReader
impl Sync for DataReader
impl Unpin for DataReader
impl UnsafeUnpin for DataReader
impl UnwindSafe for DataReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more