Skip to content

Unit test and fix for #422 - #481

Merged
mfeurer merged 6 commits into
developfrom
test#422
Jun 21, 2018
Merged

mfeurer merged 6 commits into
developfrom
test#422

Conversation

@mfeurer

@mfeurer mfeurer commented Jun 19, 2018

Copy link
Copy Markdown
Collaborator

This PR adds a unit test for #422 which will fail with the current liac-arff release 2.2.1. Upgrading to liac-arff 2.2.2 will make the unit test work again (release is under preparation).

@janvanrijn janvanrijn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like the substantial part of this PR are many dicts to OrderedDicts, upgrade of liac-arff and more strict unit tests

Comment thread openml/runs/run.py Outdated
run.trace_attributes = trace['attributes']
run.trace_content = trace['data']
data_tmp = trace['data']
# TODO move this functionality to trace.py and serialize/deserialize the trace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like an unresolved TODO. Is there a reason to not do this immediately?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I currently don't have the time. This is related to #482 and should be resolved in there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok. can you open an issue for this?

I don't get why you need to cast the first three items to an int, and the fourth to a float. Aren't the data types maintained by the arff dumps function?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I created issue #483. The casts are necessary because arff only defines values to be numerical, not float or int. The cast to float isn't there any more, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume not, as all other columns should be float as well (the predictions per class and the 'predicted' and 'correct' class)

The thing I am mostly worried about is the 'assumptions' in the code, i.e., if we ever add one column we don't have the overview where these kind of manual patches are. Therefore I would propose to move this part to the trace file anyway (I can do this later today, if that helps)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

They are all represented as float, regardless whether they are floats or ints. I totally agree, if you have the time to implement #483 this would definitively be great.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No problem. In that case I guess you would have to also review this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I moved the functionality to the trace.py. While doing so, I realized that the current way of representing the trace (in arff) is quite hacky, and we should use the actual trace object throughout the run. This update will make things way more neat, but it will cost several hours to implement, which I can't do / test right now.

I think the current solution moves the functionality to exactly where one would expect it to be and is fine for now. Furthermore, I made it a private function, so we don't have a real obligation to maintain it in future versions.

@mfeurer

mfeurer commented Jun 20, 2018

Copy link
Copy Markdown
Collaborator Author

The most important part is the new unit tests. All other changes are fixes to make the unit test pass.

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #481 into develop will decrease coverage by 0.04%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #481      +/-   ##
===========================================
- Coverage    89.59%   89.54%   -0.05%     
===========================================
  Files           32       32              
  Lines         2777     2803      +26     
===========================================
+ Hits          2488     2510      +22     
- Misses         289      293       +4
Impacted Files Coverage Δ
openml/runs/run.py 88.92% <100%> (ø) ⬆️
openml/runs/trace.py 90.24% <78.57%> (+0.58%) ⬆️
openml/runs/functions.py 87.82% <78.78%> (-0.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 666d4c7...0f13c97. Read the comment docs.

@mfeurer

mfeurer commented Jun 21, 2018

Copy link
Copy Markdown
Collaborator Author

but it will cost several hours to implement, which I can't do / test right now.

That's why I shied away from this in the first place.

Besides that, thanks for your changes, they look great!

@janvanrijn

Copy link
Copy Markdown
Member

Let's merge then

@mfeurer
mfeurer merged commit 906992a into develop Jun 21, 2018
@mfeurer
mfeurer deleted the test#422 branch June 21, 2018 18:11
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.

3 participants