rust_ml/bench/core/train_metrics.rs
1/// Metrics related to the model training process.
2///
3/// This struct tracks performance metrics related to the training process itself,
4/// such as training time, rather than the model's predictive performance.
5#[derive(Debug)]
6pub struct TrainMetrics {
7 /// Time taken to train the model, measured in seconds.
8 training_time: f64,
9}
10
11impl TrainMetrics {
12 /// Creates a new TrainMetrics instance.
13 ///
14 /// # Arguments
15 ///
16 /// * `training_time` - The time taken to train the model, in seconds.
17 ///
18 /// # Returns
19 ///
20 /// A new TrainMetrics instance with the provided training time.
21 pub fn new(training_time: f64) -> Self {
22 Self { training_time }
23 }
24
25 /// Gets the training time in seconds.
26 ///
27 /// # Returns
28 ///
29 /// The time taken to train the model, in seconds.
30 pub fn training_time(&self) -> f64 {
31 self.training_time
32 }
33}