allow users to pass 0 test data
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
Reference in New Issue
Block a user