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

Add scaling_range and new test for scaling_range #57

Closed
wants to merge 1 commit into from

Conversation

ZhengyanZhu
Copy link
Contributor

Hallo.
Ich die Pull Request mit Git Bash gemacht, hoffe es in Ordnung ist.

Außer was ich beim letzten Mal geändert habe, wird es eine neue Test addiert, um den "scaling_range" zu testen. Dabei habe ich aber die
"if not os.path.exists(self._get_scaler_path()):" in ncmapss.py ignoriert, da solang es ein scaling file schon hat, wird kein neu "scaling_range" akzeptiert.

Ich versuch weitere Löusung zu finden, aber ich denke mal, dass ich was ich bis jetzt habe schon mal schicken

Copy link
Owner

@tilman151 tilman151 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work so far, but I have some comments. You can try to fix them now or we just talk about it this afternoon.

You can also have a look at the results of the automated checks below.

) -> None:
"""
Create a new reader for the New C-MAPSS dataset. The maximum RUL value is set
to 65 by default. The default channels are the four operating conditions,
to 65 by default. The default channels are the four operating conditions,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one white space missing.

features, _, _ = self._load_data("dev")
scaler = scaling.fit_scaler(features, MinMaxScaler())
scaling.save_scaler(scaler, self._get_scaler_path())
#if not os.path.exists(self._get_scaler_path()):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will obviously need to find a solution for this. The scaling range should be part of the scaler_path. Try to modify _get_scaler_path to take the range into account. This way it would refit the scaler if the range changed.

reader.prepare_data()
features_default, _ = reader.load_split("dev")

assert not np.array_equal(features[0][:, :, 1], features_default[0][:, :, 1])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think testing min and max of the features would be a more suitable test. After scaling features should be inside the scaling range. Additionally, you should test all elements of features, not only the first one. It is okay to have an assert inside a for loop.

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.

2 participants