def __init__(self, model_type=DEFAULT_MODEL_TYPE):
"""
Set ups model and pipeline for learning and predicting.
:param model_type: only 'SVR' model is supported for now
"""
assert (model_type == 'SVR'), "Model '{}' is not supported. " \
"We support only SVR for now.".format(model_type)
self._model_type = model_type
self._model_params = BTCForecast.DEFAULT_SVR_MODEL_PARAMS
# set up SVR pipeline
self._scaler = preprocessing.StandardScaler(copy=True, with_mean=True, with_std=True)
self._model = SVR(kernel=self._model_params['kernel'],
epsilon=self._model_params['epsilon'],
C=self._model_params['c'],
gamma=self._model_params['gamma'])
self._pipeline = make_pipeline(self._scaler, self._model)
self.has_learned = False
评论列表
文章目录