data images

This commit is contained in:
wassname
2020-11-01 16:30:13 +08:00
parent 4aa8b3a52e
commit 6aca4a7e1e
8 changed files with 25 additions and 5 deletions
+4 -2
View File
@@ -82,6 +82,9 @@ class RegressionForecastData:
def __repr__(self):
return f'<{type(self).__name__} {self.df.shape if (self.df is not None) else None}>'
def __len__(self):
return len(self.df.dropna(subset=self.columns_target))
class GasSensor(RegressionForecastData):
"""
See: http://archive.ics.uci.edu/ml/datasets/Gas+sensor+array+temperature+modulation
@@ -330,7 +333,6 @@ class IMOSCurrentsVel(RegressionForecastData):
# made in previous notebook
xd = xr.load_dataset(outfile)
df = xd.to_dataframe()
df['SPD'] = np.sqrt(df.VCUR**2 + df.UCUR**2)
df = df[['VCUR', 'UCUR', 'WCUR', 'TEMP', 'DEPTH', 'M2',
'S2', 'N2', 'K2', 'K1', 'O1', 'P1', 'Q1', 'M4', 'M6', 'S4', 'MK3', 'MM',
'SSA', 'SA', 'SPD']]
@@ -340,6 +342,6 @@ class IMOSCurrentsVel(RegressionForecastData):
has_past = df.SPD.isna().rolling(48).sum()<5
df = df[has_past]
df = df.resample('10T').first()
df = df.resample('30T').mean()
return df