Skip to content
CatBus

Tag: timeseries

All the articles with the tag "timeseries".

PYTORCHLAB 11-4
# load data
xy = np.loadtxt("data-02-stock_daily.csv", delimiter=",")
xy = xy[::-1]  # reverse order

# split train-test set
train_size = int(len(xy) * 0.7)
train_set = xy[0:train_size]
test_set = xy[train_size - seq_length:]

앞서 언급한대로 scaling을 하고 학습하기 좋은 형태로 data를 가공해야 한다.

def minmax_scaler(data):
    numerator = data - np.min(data, 0)
    denominator = np.max(data, 0) - np.min(data, 0)
    return numerator / (denominator + 1e-7)

train_set = minmax_scaler(train_set)
test_set = minmax_scaler(test_set)

Timeseries

timeseries(시게열) data는 일정 시간 간격으로 배치된 data를 말한다. 매장의 시간별 매출, 요일별 주식 시가/종가 등이 여기에 속할 수 있다.

2022.06.09·8분·rnn