get_best_not_failing_model¶
- hcrystalball.model_selection.get_best_not_failing_model(grid_search, X, y)[source]¶
Prevent situation when model incompatible data are not seen during CV (in the last split of actuals) and model which cannot be fitted on the full dataset is choseen. In such a situation the next model with the lowest test score should be selected.
- Parameters
grid_search (sklearn.model_selection.GridSearchCV) – Fitted instance compatible with Sklearn GridSearchCV
X (pandas.DataFrame) – Input features.
y (array_like, (1d)) – Target vector.
- Returns
with keys
rank
andparams
- Return type
- Raises
ValueError – No available model could be fit on given data