Skip to content

Add manual task iteration tutorial - #788

Merged
mfeurer merged 6 commits into
developfrom
add_task_iteration_tutorial
Oct 7, 2019
Merged

mfeurer merged 6 commits into
developfrom
add_task_iteration_tutorial

Conversation

@mfeurer

@mfeurer mfeurer commented Sep 30, 2019

Copy link
Copy Markdown
Collaborator

No description provided.

@mfeurer
mfeurer requested a review from ArlindKadra September 30, 2019 14:55
@codecov-io

codecov-io commented Oct 1, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #788 into develop will increase coverage by 0.51%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #788      +/-   ##
==========================================
+ Coverage    87.69%   88.2%   +0.51%     
==========================================
  Files           36      36              
  Lines         4200    4452     +252     
==========================================
+ Hits          3683    3927     +244     
- Misses         517     525       +8
Impacted Files Coverage 螖
openml/evaluations/evaluation.py 60.52% <0%> (-1.02%) 猬囷笍
openml/extensions/sklearn/__init__.py 100% <0%> (酶) 猬嗭笍
openml/datasets/functions.py 95.96% <0%> (+0.48%) 猬嗭笍
openml/evaluations/functions.py 93.33% <0%> (+1.75%) 猬嗭笍
openml/runs/functions.py 84.25% <0%> (+2.02%) 猬嗭笍

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 de0335c...d6c92a4. Read the comment docs.

@mfeurer
mfeurer requested a review from janvanrijn October 1, 2019 14:51
import openml

####################################################################################################
task_id = 233

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.

maybe add small comment which task this is and why (few observations, well-known iris, ... ?)

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.

Great idea, thanks I lot, I just added that explanation.

# Task ``233`` is a simple task using the holdout estimation procedure and therefore has only a
# single repeat, a single fold and a single sample size:

print(n_repeats, n_folds, n_samples)

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.

use logging instead of print (?) also, little bit more verbose would be good:

logging.info('dataset %s, %d repeats, %d folds, %d samples' % (task.get_dataset.name, n_repeats, n_folds, n_samples))

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 made this more verbose.


####################################################################################################
# We can now retrieve the train/test split for this combination of repeats, folds and number of
# samples (indexing is zero-based):

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.

maybe add that usually we do a loop around this, but only neglect this since we have a single repeat / fold

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.

Done.

sample=0,
)

print(train_indices.shape, train_indices.dtype)

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.

logging (?)

X_test = X.loc[test_indices]
y_test = y[test_indices]

print(X_train.shape, y_train.shape, X_test.shape, y_test.shape)

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.

logging (?)

print(X_train.shape, y_train.shape, X_test.shape, y_test.shape)

####################################################################################################
# Obviously, we can also retrieve cross-validation versions of the dataset used in task ``233``:

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.

mention that we require 1 for loop over folds

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 added a loop here and for the other two as well.

print(n_repeats, n_folds, n_samples)

####################################################################################################
# And also versions with multiple repeats:

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.

idem, 2 for loops

print(n_repeats, n_folds, n_samples)

####################################################################################################
# And finally a task based on learning curves:

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.

idem, 3 for loops

Comment thread openml/evaluations/functions.py Outdated
api_call += "/flow/%s" % ','.join([str(int(i)) for i in flow])
if uploader is not None:
api_call += "/uploader/%s" % ','.join([str(int(i)) for i in uploader])
if run is not None:

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.

can you also add a unit test that filters based on runs?

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.

Sorry, this should not have been part of this PR, I will do a new PR.

@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.

looks good. I could only find some very small things.

Comment thread examples/30_extended/task_manual_iteration_tutorial.py Outdated
Comment thread examples/30_extended/task_manual_iteration_tutorial.py Outdated
Comment thread examples/30_extended/task_manual_iteration_tutorial.py
Comment thread examples/30_extended/task_manual_iteration_tutorial.py
Comment thread examples/30_extended/task_manual_iteration_tutorial.py
@mfeurer
mfeurer requested review from ArlindKadra and janvanrijn and removed request for ArlindKadra October 7, 2019 13:33
@mfeurer
mfeurer merged commit 4020c1e into develop Oct 7, 2019
@mfeurer
mfeurer deleted the add_task_iteration_tutorial branch October 7, 2019 14:05
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