pycredits.param_grid

Module Contents

Functions

param_grid_for_grid_search(n_estimators_range, ...)

Create parameter grid for grid search.

Create parameter grid for grid search.

Parameters:

n_estimators_rangelist

A list containing the range of values for the number of trees in the forest.

max_depth_rangelist

A list containing the range of values for the maximum depth of the trees.

Returns:

dict

A dictionary representing the parameter grid for grid search.

Raises:

TypeError

If either n_estimators_range or max_depth_range is not provided as a list.

ValueError

If either n_estimators_range or max_depth_range is an empty list, or if any non-numeric values are included in the parameter ranges.

Example:

>>> n_estimators_range = [100, 150, 200, 250, 300]
>>> max_depth_range = [1, 5, 10, 15, 20]
>>> param_grid_for_grid_search(n_estimators_range, max_depth_range)