Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

36 make pandasstandardscaler for hugs #38

Merged
merged 14 commits into from
Nov 4, 2024

Conversation

sgoldenCS
Copy link
Contributor

Creates a StandardScaler for Pandas DataFrames with unittests for both the scaler and a few new I/O utility functions for YAML configuration files.

Also, includes a small update to the Parser2DataFrame to include the new I/O behavior. All unittests still work. This probably should have been its own issue/pull, but the changes were very minimal.

This will close #36 as complete.

We may want to think about whether we should rename run() and reverse() with transform() and inverse_transform() which matches Scikit-Learn.

Inital upload of a standard scaler that supports pandas dataframes as input. Maybe it should be renamed to DataFrame scaler to match the parser_to_dataframe.py file...
Using scikit-learn's StandardScaler as a base. Saving and loading is a bit tricky as the internal state of the scikit-learn implementation isn't easily saved. It looks like you can save it's internal __dict__ and then set the attributes on load, but I'm not sure if this is robust...
The implementation avoids using scikit-learn entirely for a number of reasons including no option for axis changes and no option for changing the epsilon value when dealing with small variances.
Saving and loading configurations are now done by utility functions in the utils folder. This simplifies the modules and allows for unit testing on the config I/O functions outside of any module.
Utility functions try to properly handle FileNotFound and FileExists errors.
[save/load]_config --> [save/load]_yaml_config to avoid confusion if we want another version for JSON or something else.
Adding lots of additional documentation. Some functions aren't fully documented, but this is a very good start.
@sgoldenCS sgoldenCS self-assigned this May 9, 2024
@sgoldenCS sgoldenCS linked an issue May 9, 2024 that may be closed by this pull request
Unittests still work and changes seem to mostly be single quotes to double and removing spaces.
This reverts commit f759eba.
@dlersch
Copy link
Contributor

dlersch commented Nov 4, 2024

Reviewed code. looks good to me. going to approve.

@dlersch dlersch merged commit 977eec3 into main Nov 4, 2024
@sgoldenCS sgoldenCS deleted the 36-make-pandasstandardscaler-for-hugs branch November 4, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make PandasStandardScaler for HUGS
2 participants