add print

This commit is contained in:
vvzvlad 2024-09-08 23:02:48 +03:00
parent 1178063983
commit 3e35a26af4

View File

@ -114,11 +114,18 @@ def train_model(timeframe):
price_data = pd.read_csv(training_price_data_path) price_data = pd.read_csv(training_price_data_path)
df = load_frame(price_data, timeframe) 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()) print(df.tail())
y_train = df['close'].shift(-1).dropna().values y_train = df['close'].shift(-1).dropna().values
X_train = df[:-1] 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}") print(f"Training data shape: {X_train.shape}, {y_train.shape}")
# Define the model # Define the model