Files
FYS-STK4155/doc/Programs/ProjectsData/data_exploration.ipynb
T
2020-05-29 11:39:02 +02:00

16 KiB

In [1]:
import matplotlib.pyplot as plt
import numpy as np
In [42]:
train_data = np.load("../data/images/pr_train_simulated_50.0.npy")
test_data = np.load("../data/images/pr_test_simulated_50.0.npy")
all_data = np.concatenate([train_data, test_data])
np.save("../data/images/project_data.npy", all_data)

train_targets = np.load("../data/targets/train_targets.npy")
test_targets = np.load("../data/targets/test_targets.npy")
all_targets = np.concatenate([train_targets, test_targets])
np.save("../data/targets/project_targets.npy", all_targets)
In [43]:
train_data.shape
Out [43]:
(5600, 64, 64, 1)
In [33]:
train.shape
Out [33]:
(2400, 128, 128, 1)
In [35]:
plt.imshow(train[4].reshape((128, 128)))
Out [35]:
<matplotlib.image.AxesImage at 0x11c83b898>
In [36]:
other_maxs = np.zeros(train.shape[0])

for i, e in enumerate(train):
    other_maxs[i] = e.max()
In [37]:
other_maxs.shape
Out [37]:
(2400,)
In [17]:
maxs = np.amax(train, axis=(1,2, 3))
In [18]:
maxs.shape
Out [18]:
(2400,)
In [38]:
plt.hist(other_maxs, bins=20)
Out [38]:
(array([916., 920., 204.,  69.,  27.,  18.,  37.,  21.,  25.,  19.,  15.,
         38.,  41.,  12.,   6.,   6.,   7.,  10.,   4.,   5.]),
 array([  1.759  ,  13.81965,  25.8803 ,  37.94095,  50.0016 ,  62.06225,
         74.1229 ,  86.18355,  98.2442 , 110.30485, 122.3655 , 134.42615,
        146.4868 , 158.54745, 170.6081 , 182.66875, 194.7294 , 206.79005,
        218.8507 , 230.91135, 242.972  ]),
 <a list of 20 Patch objects>)
In [ ]: