pub struct RegressionProfiler<Model, Opt, Input, Output> { /* private fields */ }Expand description
A profiler for regression models that measures training time and computes regression metrics.
This struct implements the Profiler trait specifically for regression models,
providing performance assessment through metrics such as Mean Squared Error (MSE),
Root Mean Squared Error (RMSE), and coefficient of determination (R²).
§Type Parameters
Model- The regression model type being profiledOpt- The optimizer type used for trainingInput- The input data type (features)Output- The output data type (target values)
Implementations§
Trait Implementations§
Source§impl<Model, Opt, Input, Output> Default for RegressionProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Default for RegressionProfiler<Model, Opt, Input, Output>
Source§impl<Model, Opt, Input, Output> Profiler<Model, Opt, Input, Output> for RegressionProfiler<Model, Opt, Input, Output>where
Model: BaseModel<Input, Output> + RegressionModel<Input, Output>,
Opt: Optimizer<Input, Output, Model>,
impl<Model, Opt, Input, Output> Profiler<Model, Opt, Input, Output> for RegressionProfiler<Model, Opt, Input, Output>where
Model: BaseModel<Input, Output> + RegressionModel<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 regression model.
Measures the time taken to train the model and computes regression metrics on the provided data.
§Arguments
model- Mutable reference to the regression model being trainedoptimizer- Mutable reference to the optimizer used for trainingx- Reference to input featuresy- Reference to target values
§Returns
A tuple containing training metrics (including training time) and regression metrics (MSE, RMSE, R²), 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 regression model.
Computes regression metrics for the model on the provided data.
§Arguments
model- Mutable reference to the regression model being evaluatedx- Reference to input featuresy- Reference to target values
§Returns
Regression metrics (MSE, RMSE, R²), or a ProfilerError if an error occurs.
Source§type EvalMetrics = RegressionMetrics
type EvalMetrics = RegressionMetrics
Auto Trait Implementations§
impl<Model, Opt, Input, Output> Freeze for RegressionProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> RefUnwindSafe for RegressionProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Send for RegressionProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Sync for RegressionProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> Unpin for RegressionProfiler<Model, Opt, Input, Output>
impl<Model, Opt, Input, Output> UnwindSafe for RegressionProfiler<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