-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUG] Fix write_ndarray_to_tsfile
for classLabel = False
#3303
Conversation
@achieveordie, I think you recently looked at these I/O utilities - do you have any comments? |
write_ndarray_to_tsfile
for classLabel = false
@paulbauriegel, thanks for the fix! Just started the CI to check. Btw, do you know whether there is a test that checks for the |
@fkiraly As far as I understand you have two test functions in
So far there is no function that actually checks what is written. So I think it would make sense to implement a test that verifies the output of |
that would be neat, much obliged! |
write_ndarray_to_tsfile
for classLabel = false
write_ndarray_to_tsfile
for classLabel = False
I believe this is due to a typo that this PR fixes. In if class_label is not None:
space_separated_class_label = " ".join(str(label) for label in class_label)
file.write(f"@classLabel true {space_separated_class_label}\n")
else:
file.write("@class_label false\n") We're passing two conflicting names: elif line.startswith("@classlabel"):
... in The right way would be to change these to |
Hm - I think this discrepancy between specifier strings indicates that we should write a file format specification for ts and tsf. We had people asking for this before. Unfortunately, the time series classification crowd has never properly documented the file formats, as far as I know. We already have an issue here: #2043 FYI @ltsaprounis, @TNTran92 who were involved in another related discussion. |
I'll merge this PR so it is in the next days' release.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
Reference Issues/PRs
Fixes the following issue when reading a tsfile written with
write_ndarray_to_tsfile
What does this implement/fix? Explain your changes.
The issue in
load_from_tsfile_to_dataframe
happend becausehas_class_labels_tag = False
. This is because the lineis never executed since the
line.startswith("@classlabel")
isFalse
Does your contribution introduce a new dependency? If yes, which one?
No
What should a reviewer concentrate their feedback on?
How should the tag "@classlabel" be named,
write_ndarray_to_tsfile
andload_from_tsfile_to_dataframe
depend on each other here. Another solution would be to allow multiple way of writing this tag inload_from_tsfile_to_dataframe
For all contributions