Generalize YATSM timeseries estimator API to fit more workflows or approaches. Currently there is quite a lot of code in CLI scripts that are specific to models like CCDC or BFAST that wouldn't work for other algorithms. There's also some terminology and methods within the YATSM baseclass that aren't quite right for something like a VCT.
Basically, we need to make timeseries estimators more responsible for things like the setup, preprocessing, and postprocessing. The methods used also need to be more generic.
API
First stab at what YATSM baseclass should define:
[x] setup(self, df, **config)
Accomplish things necessary for running the model, but nothing specific to an individual timeseries (e.g., formulate X design matrix)
df is Pandas dataframe representation of the info in input_file for a dataset
return X
[x] preprocess(self, X, Y, dates, **config)
preprocess (mask, filter, transform, etc.) data per pixel
return X, Y, dates
[x] fit(self, X, Y, dates)
fit timeseries model
return self.record
[x] fit_models(self, X, Y, bands=None)
fit statistical estimator models for each n_series
Rationale
Generalize YATSM timeseries estimator API to fit more workflows or approaches. Currently there is quite a lot of code in CLI scripts that are specific to models like CCDC or BFAST that wouldn't work for other algorithms. There's also some terminology and methods within the YATSM baseclass that aren't quite right for something like a VCT.
Basically, we need to make timeseries estimators more responsible for things like the setup, preprocessing, and postprocessing. The methods used also need to be more generic.
API
First stab at what YATSM baseclass should define:
setup(self, df, **config)
df
is Pandas dataframe representation of the info ininput_file
for a datasetreturn X
preprocess(self, X, Y, dates, **config)
return X, Y, dates
fit(self, X, Y, dates)
return self.record
fit_models(self, X, Y, bands=None)
n_series
predict(self, X, dates)
return np.ndarray
score(self, X, Y, dates)
return namedtuple
plot(self, X, Y, dates, **config)