SearchResult

Defined in fynance.models.tuning

class SearchResult(table, params, best_params, best_model, n_trials)[source]

Bases: object

Result of walk_forward_search.

Attributes:
tablenumpy.ndarray

Out-of-sample scores, shape (n_configs, n_folds) – row i, column j is the score of params[i] on fold j.

paramslist of dict

Parameter dict tried for each row of table (same order).

best_paramsdict

The configuration with the highest mean OOS score (mean over folds).

best_modelAny

factory(**best_params) refit on the last (most recent) train window – the model to actually deploy.

n_trialsint

Number of configurations tried (== len(params) == table.shape[0]). Feed this into fynance.research.guards.deflated_sharpe_ratio as n_trials so the winning configuration’s Sharpe ratio is deflated by the number of configurations the search tried, rather than reported at face value.