ARIMA lesson formatting

pull/38/head
Jen Looper 4 years ago
parent 5161ba2f19
commit 95090c4f32

@ -111,25 +111,27 @@ Now, you need to prepare the data for training by performing two tasks:
1. Filter the original dataset to include only the aforementioned time periods per set and only including the needed column 'load' plus the date:
```python
train = energy.copy()[(energy.index >= train_start_dt) & (energy.index < test_start_dt)][['load']]
test = energy.copy()[energy.index >= test_start_dt][['load']]
```python
train = energy.copy()[(energy.index >= train_start_dt) & (energy.index < test_start_dt)][['load']]
test = energy.copy()[energy.index >= test_start_dt][['load']]
print('Training data shape: ', train.shape)
print('Test data shape: ', test.shape)
```
You can see the shape of the data:
print('Training data shape: ', train.shape)
print('Test data shape: ', test.shape)
```
Training data shape: (1416, 1)
Test data shape: (48, 1)
You can see the shape of the data:
1. Scale the data to be in the range (0, 1).
```output
Training data shape: (1416, 1)
Test data shape: (48, 1)
```
2. Scale the data to be in the range (0, 1).
```python
scaler = MinMaxScaler()
train['load'] = scaler.fit_transform(train)
train.head(10)
```
```python
scaler = MinMaxScaler()
train['load'] = scaler.fit_transform(train)
train.head(10)
```
6. Now, visualize the original vs. scaled data:

Loading…
Cancel
Save