[−][src]Struct liblinear::util::TrainingInput
Input data for LibLinearModel and LibLinearCrossValidator.
Methods
impl TrainingInput
[src]
pub fn len_data(&self) -> usize
[src]
Number of training instances.
pub fn len_features(&self) -> usize
[src]
Dimensionality of the feature vector.
pub fn get(&self, index: usize) -> Option<&TrainingInstance>
[src]
Returns a reference to the training instance at the given index.
pub fn from_libsvm_file(path: &str) -> Result<TrainingInput, TrainingInputError>
[src]
Create a new instance from a LIBSVM training data file.
Each line in the data file represents a training instance and has the following format:
<target_value> <feature_index>:<feature_value> <feature_index>:<feature_value>...
Feature indices start from 1 and increase monotonically. However, they do not need to be continuous.
pub fn from_dense_features(
labels: Vec<f64>,
features: Vec<Vec<f64>>
) -> Result<TrainingInput, TrainingInputError>
[src]
labels: Vec<f64>,
features: Vec<Vec<f64>>
) -> Result<TrainingInput, TrainingInputError>
Create a new instance from a dense vector of features and their corresponding target values.
pub fn from_sparse_features(
labels: Vec<f64>,
features: Vec<Vec<(u32, f64)>>
) -> Result<TrainingInput, TrainingInputError>
[src]
labels: Vec<f64>,
features: Vec<Vec<(u32, f64)>>
) -> Result<TrainingInput, TrainingInputError>
Create a new instance from a sparse vector of features and their corresponding target values.
The feature vector must be a list of tuples that encode a feature index and its corresponding feature value.
Trait Implementations
impl Default for TrainingInput
[src]
fn default() -> TrainingInput
[src]
impl Clone for TrainingInput
[src]
fn clone(&self) -> TrainingInput
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for TrainingInput
impl Sync for TrainingInput
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,