ClassificationDataSet

Struct ClassificationDataSet 

Source
pub struct ClassificationDataSet<Features, Label> {
    pub dataset: Vec<ClassificationRecord<Features, Label>>,
}
Expand description

Dataset to feed into classification model for training task

Fields§

§dataset: Vec<ClassificationRecord<Features, Label>>

dataset of classification records on which to train

Implementations§

Source§

impl<Features, Label> ClassificationDataSet<Features, Label>

Source

pub fn get_labels(&self) -> Vec<&Label>

get labels for record

Source

pub fn get_features(&self) -> Vec<&Features>

get features

Source

pub fn get_records(&self) -> &Vec<ClassificationRecord<Features, Label>>

get records

Source

pub fn consume_records(self) -> Vec<ClassificationRecord<Features, Label>>

consume records of dataset

Source

pub fn from_struct<'a, I, S: 'a>( it: I, feature_extraction: fn(&S) -> Features, label_extraction: fn(&S) -> Label, ) -> Self
where I: Iterator<Item = &'a S>,

Create dataset from iterator of structs

Trait Implementations§

Source§

impl<Features: Debug, Label: Debug> Debug for ClassificationDataSet<Features, Label>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Input: Estimatable, Label: PartialEq + Clone> Estimator<ClassificationDataSet<Input, Label>> for GaussianNBEstimator

Source§

type Estimator = GaussianNB<Input, Label>

Output model or transformer fitted to input data.
Source§

fn fit( &self, input: &ClassificationDataSet<Input, Label>, ) -> Option<Self::Estimator>

Fit model or transformer based on given inputs, or None if the estimator was not able to fit to the input data as expected.
Source§

impl<Itr, Record, Features, Label> From<Itr> for ClassificationDataSet<Features, Label>
where Itr: IntoIterator<Item = Record>, Record: Into<ClassificationRecord<Features, Label>>,

Source§

fn from(value: Itr) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<Features, Label> Freeze for ClassificationDataSet<Features, Label>

§

impl<Features, Label> RefUnwindSafe for ClassificationDataSet<Features, Label>
where Features: RefUnwindSafe, Label: RefUnwindSafe,

§

impl<Features, Label> Send for ClassificationDataSet<Features, Label>
where Features: Send, Label: Send,

§

impl<Features, Label> Sync for ClassificationDataSet<Features, Label>
where Features: Sync, Label: Sync,

§

impl<Features, Label> Unpin for ClassificationDataSet<Features, Label>
where Features: Unpin, Label: Unpin,

§

impl<Features, Label> UnwindSafe for ClassificationDataSet<Features, Label>
where Features: UnwindSafe, Label: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V