text_html_output_1.png
from sklearn.preprocessing import MinMaxScaler

import math

import numpy as np # linear algebra

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = '/kaggle/input/110-1-ntut-dl-app-hw3/IXIC.csv'
df = pd.read_csv(data)
df

df.shape

new_df = df.filter(['Close'])
dataset = new_df.values
training_data_len = math.ceil(len(dataset) * 0.8)
training_data_len

scaler = MinMaxScaler(feature_range=(0, 1))
scaled_data = scaler.fit_transform(dataset)
scaled_data

train_data = scaled_data[0:training_data_len, :]
X_train = []
Y_train = []
for i in range(60, len(train_data)):
    X_train.append(train_data[i - 60:i, 0])
    Y_train.append(train_data[i, 0])

X_train, Y_train = (np.array(X_train), np.array(Y_train))

print(X_train.shape)
X_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))
X_train.shape