pub struct ClassificationProfiler<Model, Opt, Input, Output> { /* private fields */ }Expand description
A profiler for classification models that measures training time and computes classification metrics.
This struct implements the Profiler trait specifically for classification models,
providing performance assessment through metrics such as accuracy, precision, recall,
and F1 score.
§Type Parameters
Model- The classification model type being profiledOpt- The optimizer type used for trainingInput- The input data type (features)Output- The output data type (labels/classes)
Implementations§
Trait Implementations§
Source§impl<Model, Opt, Input, Output> Default for ClassificationProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Default for ClassificationProfiler<Model, Opt, Input, Output>
Source§impl<Model, Opt, Input, Output> Profiler<Model, Opt, Input, Output> for ClassificationProfiler<Model, Opt, Input, Output>where
Model: BaseModel<Input, Output> + ClassificationModel<Input, Output>,
Opt: Optimizer<Input, Output, Model>,
impl<Model, Opt, Input, Output> Profiler<Model, Opt, Input, Output> for ClassificationProfiler<Model, Opt, Input, Output>where
Model: BaseModel<Input, Output> + ClassificationModel<Input, Output>,
Opt: Optimizer<Input, Output, Model>,
Source§fn train(
&self,
model: &mut Model,
optimizer: &mut Opt,
x: &Input,
y: &Output,
) -> Result<(TrainMetrics, Self::EvalMetrics), ProfilerError>
fn train( &self, model: &mut Model, optimizer: &mut Opt, x: &Input, y: &Output, ) -> Result<(TrainMetrics, Self::EvalMetrics), ProfilerError>
Profiles the training process of a classification model.
Measures the time taken to train the model and computes classification metrics on the provided data.
§Arguments
model- Mutable reference to the classification model being trainedoptimizer- Mutable reference to the optimizer used for trainingx- Reference to input featuresy- Reference to target labels
§Returns
A tuple containing training metrics (including training time) and classification metrics (accuracy, precision, recall, F1 score), or a ProfilerError if an error occurs.
Source§fn profile_evaluation(
&self,
model: &mut Model,
x: &Input,
y: &Output,
) -> Result<Self::EvalMetrics, ProfilerError>
fn profile_evaluation( &self, model: &mut Model, x: &Input, y: &Output, ) -> Result<Self::EvalMetrics, ProfilerError>
Profiles the evaluation process of a classification model.
Computes classification metrics for the model on the provided data.
§Arguments
model- Mutable reference to the classification model being evaluatedx- Reference to input featuresy- Reference to target labels
§Returns
Classification metrics (accuracy, precision, recall, F1 score), or a ProfilerError if an error occurs.
Source§type EvalMetrics = ClassificationMetrics
type EvalMetrics = ClassificationMetrics
Auto Trait Implementations§
impl<Model, Opt, Input, Output> Freeze for ClassificationProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> RefUnwindSafe for ClassificationProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Send for ClassificationProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Sync for ClassificationProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Unpin for ClassificationProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> UnwindSafe for ClassificationProfiler<Model, Opt, Input, Output>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more