-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_normalization.py
More file actions
36 lines (28 loc) · 971 Bytes
/
Copy pathplot_normalization.py
File metadata and controls
36 lines (28 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import matplotlib.pyplot as plt
import pickle
from sklearn.preprocessing import MinMaxScaler
# Load the TimeSeriesObject instances from the saved file
with open('500_data_objects.pkl', 'rb') as file:
time_series_objects = pickle.load(file)
with open('500_data_normalized_objects.pkl', 'rb') as file:
normalized_time_series_objects = pickle.load(file)
original_data = time_series_objects[0].gold.copy()
normalized_data = normalized_time_series_objects[0].gold.copy()
# Plotting original and normalized data
plt.figure(figsize=(10, 5))
# Plot original data
plt.subplot(1, 2, 1)
plt.plot(original_data, label='Original Data')
plt.title('Original Data')
plt.xlabel('Time')
plt.ylabel('Value')
plt.legend()
# Plot normalized data
plt.subplot(1, 2, 2)
plt.plot(normalized_data, label='Normalized Data')
plt.title('Normalized Data')
plt.xlabel('Time')
plt.ylabel('Normalized Value')
plt.legend()
plt.tight_layout()
plt.show()