From 3e35a26af40485ab9c37c7aaded2cdc07ebc9dc8 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 8 Sep 2024 23:02:48 +0300 Subject: [PATCH] add print --- model.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/model.py b/model.py index 45116e5..e5cd57f 100644 --- a/model.py +++ b/model.py @@ -114,11 +114,18 @@ def train_model(timeframe): price_data = pd.read_csv(training_price_data_path) df = load_frame(price_data, timeframe) + + if df.empty: + raise ValueError("No data available after loading and formatting. Check the data source or timeframe.") + print(df.tail()) y_train = df['close'].shift(-1).dropna().values X_train = df[:-1] + if X_train.empty or len(y_train) == 0: + raise ValueError("Training data is empty. Ensure there is enough data for training.") + print(f"Training data shape: {X_train.shape}, {y_train.shape}") # Define the model