pub fn grid_search<P: Clone, E: Fn(&P) -> Result<f64, ErrorsJSL>>(
candidates: &[P],
evaluate: E,
greater_is_better: bool,
) -> Result<GridSearchResult<P>, ErrorsJSL>Expand description
Evaluates every candidate (typically by the mean of a cross-validation) and keeps the best,
by largest score with greater_is_better or smallest otherwise. Candidates whose evaluation
fails or returns NaN are skipped.