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