feat: expose hyper tuning module in model_selection (#179)
* feat: expose hyper tuning module in model_selection * Move to a folder Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
This commit is contained in:
+15
-3
@@ -1,3 +1,12 @@
|
|||||||
|
use crate::{
|
||||||
|
api::Predictor,
|
||||||
|
error::{Failed, FailedError},
|
||||||
|
linalg::Matrix,
|
||||||
|
math::num::RealNumber,
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::model_selection::{cross_validate, BaseKFold, CrossValidationResult};
|
||||||
|
|
||||||
/// grid search results.
|
/// grid search results.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct GridSearchResult<T: RealNumber, I: Clone> {
|
pub struct GridSearchResult<T: RealNumber, I: Clone> {
|
||||||
@@ -60,9 +69,12 @@ where
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::linear::logistic_regression::{
|
use crate::{
|
||||||
LogisticRegression, LogisticRegressionSearchParameters,
|
linalg::naive::dense_matrix::DenseMatrix,
|
||||||
};
|
linear::logistic_regression::{LogisticRegression, LogisticRegressionSearchParameters},
|
||||||
|
metrics::accuracy,
|
||||||
|
model_selection::{hyper_tuning::grid_search, KFold},
|
||||||
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_grid_search() {
|
fn test_grid_search() {
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
mod grid_search;
|
||||||
|
pub use grid_search::{grid_search, GridSearchResult};
|
||||||
@@ -110,8 +110,10 @@ use crate::math::num::RealNumber;
|
|||||||
use crate::rand::get_rng_impl;
|
use crate::rand::get_rng_impl;
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
|
|
||||||
|
pub(crate) mod hyper_tuning;
|
||||||
pub(crate) mod kfold;
|
pub(crate) mod kfold;
|
||||||
|
|
||||||
|
pub use hyper_tuning::{grid_search, GridSearchResult};
|
||||||
pub use kfold::{KFold, KFoldIter};
|
pub use kfold::{KFold, KFoldIter};
|
||||||
|
|
||||||
/// An interface for the K-Folds cross-validator
|
/// An interface for the K-Folds cross-validator
|
||||||
|
|||||||
Reference in New Issue
Block a user