Files
remote-sensing/scripts/inference/analyze_data.py
T

15 lines
616 B
Python

import joblib, numpy as np
data = joblib.load('dataset_cache/training_data_2d_temporal.joblib')
X, y = data['X'], data['y']
print(f'Shape: {X.shape}, dtype: {X.dtype}')
print(f'Labels unique: {np.unique(y)}')
print(f'Label counts:')
for lbl in sorted(np.unique(y)):
print(f' Label {lbl}: {(y==lbl).sum()}')
print(f'Range: [{X.min():.4f}, {X.max():.4f}], Mean: {X.mean():.4f}')
print(f'AllZero patches: {(X.reshape(X.shape[0],-1).sum(1)==0).sum()}')
for t in range(4):
block = X[:, t*6:(t+1)*6]
nz = (block.reshape(block.shape[0],-1).sum(1)!=0).sum()
print(f' Timestep {t}: non-zero={nz}/{len(X)}')