| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.ModelSelection
Description
Cross-validation and grid search for hyperparameter tuning.
Synopsis
- crossValScore :: Int -> Int -> (DataFrame -> DataFrame -> Double) -> DataFrame -> [Double]
- crossValidate :: Int -> Int -> Metric -> Expr Double -> (DataFrame -> Expr Double) -> DataFrame -> [Double]
- stratifiedFoldIds :: Int -> Int -> Vector Double -> Vector Int
- outOfFold :: Vector Int -> (DataFrame -> DataFrame -> Vector Double) -> DataFrame -> Vector Double
- data GridSearchResult c = GridSearchResult {
- gsBest :: !c
- gsBestScore :: !Double
- gsAll :: ![(c, Double)]
- gridSearch :: Int -> Int -> [c] -> (c -> DataFrame -> DataFrame -> Double) -> DataFrame -> GridSearchResult c
Documentation
crossValScore :: Int -> Int -> (DataFrame -> DataFrame -> Double) -> DataFrame -> [Double] Source #
Per-fold scores from k-fold cross-validation.
crossValidate :: Int -> Int -> Metric -> Expr Double -> (DataFrame -> Expr Double) -> DataFrame -> [Double] Source #
Fit on each training fold and score predictions on the held-out fold.
stratifiedFoldIds :: Int -> Int -> Vector Double -> Vector Int Source #
A class-balanced fold number in [0, k) for every row.
outOfFold :: Vector Int -> (DataFrame -> DataFrame -> Vector Double) -> DataFrame -> Vector Double Source #
Out-of-fold scores: each row is scored by a model not trained on it.
data GridSearchResult c Source #
The outcome of a grid search: the best config, its score, and all results.
Constructors
| GridSearchResult | |
Fields
| |
Instances
| Show c => Show (GridSearchResult c) Source # | |
Defined in DataFrame.ModelSelection Methods showsPrec :: Int -> GridSearchResult c -> ShowS # show :: GridSearchResult c -> String # showList :: [GridSearchResult c] -> ShowS # | |
gridSearch :: Int -> Int -> [c] -> (c -> DataFrame -> DataFrame -> Double) -> DataFrame -> GridSearchResult c Source #
Search configurations by mean cross-validated score, returning the best.