Skip to content

Conversation

@Neeratyoy
Copy link
Contributor

@Neeratyoy Neeratyoy commented Apr 5, 2019

What does this PR implement/fix? Explain your changes.

Addresses #364.
An optional parameter has been added to the get_X functions called output_format. Which is by default dict so that nothing breaks. When output_format='dataframe' the output is a pandas data frame.

How should this PR be tested?

The following commands should suffice in demonstrating the change:
openml.datasets.list_datasets(size=10)
openml.datasets.list_datasets(size=10, output_format='dataframe')
openml.tasks.list_tasks(task_type_id=1, size = 10)
openml.tasks.list_tasks(task_type_id=1, size = 10, output_format='dataframe')
openml.evaluations.list_evaluations('predictive_accuracy', size = 10)
openml.evaluations.list_evaluations('predictive_accuracy', size = 10, output_format='object')
openml.evaluations.list_evaluations('predictive_accuracy', size = 10, output_format='dataframe')
openml.flows.list_flows(size=10)
openml.flows.list_flows(size=10, output_format='dataframe')
openml.runs.list_runs(size=10)
openml.runs.list_runs(size=10, output_format='dataframe')
openml.setups.list_setups(size=10)
openml.setups.list_setups(size=10, output_format='object')
openml.setups.list_setups(size=10, output_format='dataframe')

Any other comments?

  • For design parity, all the __list_X functions have been edited to produce the desired output format. In effect, every list function has an added parameter called output_format including the _list_all in utils.py.
  • The defaults have been kept as 'dict' and 'object' where applicable to ensure nothing breaks.
  • Examples which had listing as an example, has been updated.
  • A small unit test is added for all the listing calls that already being tested

@Neeratyoy Neeratyoy requested a review from mfeurer April 5, 2019 18:22
@Neeratyoy Neeratyoy changed the title Adding dataframe output option to listing functions Option to return dataframes for listing functions Apr 5, 2019
@Neeratyoy Neeratyoy marked this pull request as ready for review April 24, 2019 12:08
@codecov-io
Copy link

codecov-io commented Apr 30, 2019

Codecov Report

Merging #662 into develop will decrease coverage by 0.15%.
The diff coverage is 89.38%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #662      +/-   ##
===========================================
- Coverage     90.5%   90.35%   -0.16%     
===========================================
  Files           36       36              
  Lines         3730     3785      +55     
===========================================
+ Hits          3376     3420      +44     
- Misses         354      365      +11
Impacted Files Coverage Δ
openml/utils.py 91.66% <100%> (+0.39%) ⬆️
openml/study/functions.py 88.23% <66.66%> (-1.69%) ⬇️
openml/evaluations/functions.py 90.74% <82.35%> (-4.82%) ⬇️
openml/datasets/functions.py 95.66% <90%> (-0.28%) ⬇️
openml/runs/functions.py 81.48% <90.9%> (-0.03%) ⬇️
openml/tasks/functions.py 84.93% <90.9%> (-0.16%) ⬇️
openml/flows/functions.py 87.78% <90.9%> (-0.31%) ⬇️
openml/setups/functions.py 93.84% <96.87%> (-0.18%) ⬇️

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 72f131a...0a947af. Read the comment docs.

@mfeurer mfeurer merged commit 7129cf0 into develop Apr 30, 2019
@mfeurer mfeurer deleted the fix364 branch April 30, 2019 10:00
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.

4 participants