Skip to content

Conversation

@github-actions
Copy link

Automated changes by create-pull-request GitHub action

klapo and others added 30 commits March 29, 2023 15:54
- Made several init arguments keyword arguments to better reflect algorithm logic
- Made several arguments belong to the fit command instead of the class init
to better reflect how the fit command should be used (namely window size and step size).
- Some pep8’ing
- n_components is now a required argument for the clustering operation
- Plotting now uses a circular color scheme for many clusters
- Updating the allocation to better reflect not knowing the optimal `svd_rank` a priori.
- Appropriated the svd_rank computation to handle the case with
no global svd and unknown svd_rank to return the number of data variables
for use in allocating the window arrays.
- build_windows now requires positional arguments intsead of accessing
class variables
- Add logic in `fit` for the case when no global svd nor svd_rank is used
and the svd_rank may change between windows.
- n_components is specified in the clustering function instead of
class creation.
- Local vs global svd logic should be more complete
- Moved to slice objects for indexing, allowing incomplete windows
and reconstrucitng the entire data set, regardless of the number of
integer windows.
- Fixed bug in the number of slides to make across the data
- Fixed bug in the initialization of the optdmd kwargs.
- Reblacked the project
- Added logic for initializing using the previous windows frequencies.
- Refactored to have a hopefully more catchy and descriptive name. No
promises that this is the last rename.
- re-blacked
- Added checks for how to initialize the DMD fit.
- Fixed global reconstruction
- Added `cluster_centroids`, `n_components`, `omega_classes` as properties.
- Changed detection of array shapes to use object derived values.
- Added flag to square the frequency or not.
- Sort the frequency band clusters according to centroid magnitude.
- Reconstructions, scale-separation, and plots according to object
values instead of externally provided arguments.
- Mode thresholding for discarding insignificant frequency bands.
- Scale separation for iterative decomposition.
Fork Sync: Update from parent repository
- Add a sorted list of labels for cluster labels, useful for trimming
- Fixed mode trimming and added a flag for resetting trimming.
- Documented several new additions to the doc string
- Reorganized the class to have properties first.
- Added the ability to include residuals to the reconstruction plots.
- matlab code and previous versions did not do the correct weighting
of each window by a gaussian, as described in the paper or implemented
for the scale separated reconstruction (e.g., high vs low frequency).
The global reconstruction now just sums up the individual reconstructed
components, using the gaussian weighting.
- Hyperparameter sweep function for finding the optimal number of
  clusters in the kmeans clustering of window frequencies. Uses the
silhouette score.
- to_xarray allows converting results to an xarray Dataset, enabling in
  and out functions with netcdfs and the powerful alignment tools for
comparing between decomposition levels.
- In the hyperparameter sweep for the optimal number of clusters, a
  cluster size of 1 causes an error. For the case with a small svd_rank
the automatic selection of clusters is forced to be larger than one.
- Plotting functions now accept plot_kwargs and fig_kwargs controlling
  the appearance of the plots and the figures, respectively.
- In the hyperparameter sweep for the optimal number of clusters, a
  cluster size of 1 causes an error. For the case with a small svd_rank
the automatic selection of clusters is forced to be larger than one.
- Plotting functions now accept plot_kwargs and fig_kwargs controlling
  the appearance of the plots and the figures, respectively.
- Added the from_xarray() method which converts an xarray Dataset (e.g.,
  one stored on disk as a netcdf) into a costs object. Costs methods,
such as scale separation and reconstruction can be made from this
converted object.
- Cleaned up unnecessary variables in the object related to time
  keeping. Somewhat simplifies the time keeping.
klapo and others added 28 commits November 22, 2023 17:24
- Added label and bin properties depending on the transform method
- Consolidated the transform logic for improved maintainability
- Object can now return a ragged array of time dynamcis, spatial modes,
  and amplitudes
- option to cluster using KMediods instead of KMeans. Requires new
  optional package.
- Cleaned up clustering kwargs
- Bug fixes: log10 omega transform histograms and omega time series
  plots
- Covers example without noise with two frequency bands
- Includes round trip check for xarray
- No plotting tested
COSTS uses xarray as the data format for saving due to its
multi-dimensional and sometimes large memory footprint nature. It seems
non-trivial to include xarray as an optional requirement for the
testing.
KMeans clustering had a change in how the `n_init` kwarg was handled.
Here I've made the choice to raise a FutureWarning about the change in
default behavior over specifying the default behavior (e.g.,
n_init='auto') as this fails in pre 1.2 versions of scikit-learn.
- `transform_method` cannot be False
- Check for data with bad dimensionality
COSTS:
- rest_alpha_init keyword actually functions now (COSTS)
- Checks for fitted properties actually function now (COSTS)
- squared_frequencies omega transform method had a major mistake,
  hindering clustering and later operations in mrCOSTS. This bug
originated in the matlab code, creating a major break between the
results of mrCOSTS and the original code.
- Round trip conversion to and from xarray of the pydmd_kwargs for
  eigenvalue constraints.
- All suppress_growth keywords are set to False by default in
  anticipation of removing the argument.
- Check for appropriate omega transformation methods.

mrCOSTS:
- Check for the consistency of input arguments.
- multiresolution interpolation of omega more explicitly handles the
  complex values now, although the previous version worked identically.
- Added KMediods option for global clustering.
mrcosts and test_mrcosts:
- Actually have unit tests now!
- Several new property getters for relevant parameters
- Checks for fitting and global clustering
- omega_classes and omega_array are now properties simplifiying the api
- changed to/from xarray methods to to/from netcdf, better representing
  how they function.
- plotting routines do a basic check of the input data
- Added a global_reconstruction function

test_costs:
- Fixed shadowed variable names
- Added test for bad window values
- Loosened reconstruction error for the random transient component
- Added h5netcdf package to requirements for mrCOSTS to/from netcdf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants