explicit dtype
This commit is contained in:
		| @@ -105,7 +105,7 @@ You can define your own estimator for Hyperopt by implementing `generate_estimat | |||||||
| ```python | ```python | ||||||
| class MyAwesomeStrategy(IStrategy): | class MyAwesomeStrategy(IStrategy): | ||||||
|     class HyperOpt: |     class HyperOpt: | ||||||
|         def generate_estimator(dimensions, **kwargs): |         def generate_estimator(dimensions: List['Dimension'], **kwargs): | ||||||
|             return "RF" |             return "RF" | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| @@ -119,7 +119,7 @@ Example for `ExtraTreesRegressor` ("ET") with additional parameters: | |||||||
| ```python | ```python | ||||||
| class MyAwesomeStrategy(IStrategy): | class MyAwesomeStrategy(IStrategy): | ||||||
|     class HyperOpt: |     class HyperOpt: | ||||||
|         def generate_estimator(dimensions, **kwargs): |         def generate_estimator(dimensions: List['Dimension'], **kwargs): | ||||||
|             from skopt.learning import ExtraTreesRegressor |             from skopt.learning import ExtraTreesRegressor | ||||||
|             # Corresponds to "ET" - but allows additional parameters. |             # Corresponds to "ET" - but allows additional parameters. | ||||||
|             return ExtraTreesRegressor(n_estimators=100) |             return ExtraTreesRegressor(n_estimators=100) | ||||||
| @@ -131,7 +131,7 @@ The `dimensions` parameter is the list of `skopt.space.Dimension` objects corres | |||||||
| ```python | ```python | ||||||
| class MyAwesomeStrategy(IStrategy): | class MyAwesomeStrategy(IStrategy): | ||||||
|     class HyperOpt: |     class HyperOpt: | ||||||
|         def generate_estimator(dimensions, **kwargs): |         def generate_estimator(dimensions: List['Dimension'], **kwargs): | ||||||
|             from skopt.utils import cook_estimator |             from skopt.utils import cook_estimator | ||||||
|             from skopt.learning.gaussian_process.kernels import (Matern, ConstantKernel) |             from skopt.learning.gaussian_process.kernels import (Matern, ConstantKernel) | ||||||
|             kernel_bounds = (0.0001, 10000) |             kernel_bounds = (0.0001, 10000) | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ class IHyperOpt(ABC): | |||||||
|         IHyperOpt.ticker_interval = str(config['timeframe'])  # DEPRECATED |         IHyperOpt.ticker_interval = str(config['timeframe'])  # DEPRECATED | ||||||
|         IHyperOpt.timeframe = str(config['timeframe']) |         IHyperOpt.timeframe = str(config['timeframe']) | ||||||
|  |  | ||||||
|     def generate_estimator(self, dimensions, **kwargs) -> EstimatorType: |     def generate_estimator(self, dimensions: List[Dimension], **kwargs) -> EstimatorType: | ||||||
|         """ |         """ | ||||||
|         Return base_estimator. |         Return base_estimator. | ||||||
|         Can be any of "GP", "RF", "ET", "GBRT" or an instance of a class |         Can be any of "GP", "RF", "ET", "GBRT" or an instance of a class | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user