allow users to pass 0 test data
This commit is contained in:
parent
5826fae8ee
commit
72b1d1c9ae
@ -89,6 +89,6 @@ Mandatory parameters are marked as **Required** and have to be set in one of the
|
||||
| Parameter | Description |
|
||||
|------------|-------------|
|
||||
| | **Extraneous parameters**
|
||||
| `freqai.keras` | If the selected model makes use of Keras (typical for Tensorflow-based prediction models), this flag needs to be activated so that the model save/loading follows Keras standards. <br> **Datatype:** Boolean. <br> Default: `False`.
|
||||
| `freqai.keras` | If the selected model makes use of Keras (typical for Tensorflow-based prediction models), this flag should be activated so that the model save/loading follows Keras standards. If the the provided `CNNPredictionModel` is used, then this is handled automatically. <br> **Datatype:** Boolean. <br> Default: `False`.
|
||||
| `freqai.conv_width` | The width of a convolutional neural network input tensor. This replaces the need for shifting candles (`include_shifted_candles`) by feeding in historical data points as the second dimension of the tensor. Technically, this parameter can also be used for regressors, but it only adds computational overhead and does not change the model training/prediction. <br> **Datatype:** Integer. <br> Default: `2`.
|
||||
| `freqai.reduce_df_footprint` | Recast all numeric columns to float32/int32, with the objective of reducing ram/disk usage and decreasing train/inference timing. This parameter is set in the main level of the Freqtrade configuration file (not inside FreqAI). <br> **Datatype:** Boolean. <br> Default: `False`.
|
||||
|
@ -23,6 +23,7 @@ class BaseTensorFlowModel(IFreqaiModel):
|
||||
if self.ft_params.get("DI_threshold", 0):
|
||||
self.ft_params["DI_threshold"] = 0
|
||||
logger.warning("DI threshold is not configured for Keras models yet. Deactivating.")
|
||||
self.dd.model_type = 'keras'
|
||||
|
||||
def train(
|
||||
self, unfiltered_df: DataFrame, pair: str, dk: FreqaiDataKitchen, **kwargs
|
||||
|
@ -75,11 +75,16 @@ class CNNPredictionModel(BaseTensorFlowModel):
|
||||
metrics=[tf.metrics.MeanAbsoluteError()],
|
||||
)
|
||||
|
||||
if self.freqai_info.get('data_split_parameters', {}).get('test_size', 0.1) == 0:
|
||||
val_data = None
|
||||
else:
|
||||
val_data = w1.val
|
||||
|
||||
model.fit(
|
||||
w1.train,
|
||||
epochs=MAX_EPOCHS,
|
||||
shuffle=False,
|
||||
validation_data=w1.val,
|
||||
validation_data=val_data,
|
||||
callbacks=[early_stopping],
|
||||
verbose=1,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user