-
-
Save quantra-go-algo/ad4a3894af817f3de88dc3480b4615ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import libraries | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from keras.models import Sequential | |
from keras.layers import Conv1D, MaxPooling1D, Flatten, Dense | |
# Load and preprocess the data | |
data = pd.read_csv('trading_data.csv') | |
# Perform data preprocessing steps as per your requirements | |
# Split the data into training and testing sets | |
train_data = data.loc[data['date'] < date_to_split] | |
test_data = data.loc[data['date'] >= date_to_split] | |
# Define the input and output variables | |
x_train = train_data[['feature1', 'feature2', 'feature3']].values | |
y_train = train_data['target'].values | |
x_test = test_data[['feature1', 'feature2', 'feature3']].values | |
y_test = test_data['target'].values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment