Skip to content

TST: make sure delayed works as expected - #259

Closed
stsievert wants to merge 5 commits into
dask:masterfrom
stsievert:score-compute
Closed

stsievert wants to merge 5 commits into
dask:masterfrom
stsievert:score-compute

Conversation

@stsievert

Copy link
Copy Markdown
Member

These test cases makes sure that delayed(Incremental(...)) work as expected.

This PR implements nothing new but will help people clarify what works and what doesn't. It took me a while to find out how call fit and score repeatedly without re-building the graph.

@stsievert

Copy link
Copy Markdown
Member Author

I think we want to add a compute flag to score – right now I believe we're launching tasks from tasks.

inc = Incremental(est, scoring='accuracy')

inc = delayed(inc)
r = inc.partial_fit(X, y, classes=da.unique(y))

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.

Partial_fit can call dask code though, right? If so I would like to avoid calling dask within dask if we can avoid it.

I think that it might be simpler long term to provide a compute=False keyword to partial_fit.

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.

Something like the following:

inc = inc.partial_fit(X, y, compute=False)

This might not align well with current design though.

@TomAugspurger

Copy link
Copy Markdown
Member

I think we want to add a compute flag to score – right now I believe we're launching tasks from tasks.

In general, I think all of these should gain a compute flag

  • fit
  • partial_fit
  • score
  • predict
  • predict_proba

probably others.

@mrocklin

mrocklin commented Jul 2, 2018

Copy link
Copy Markdown
Member

How should these operate? For example, lets consider the case of

incremental.fit(X, y, compute=False)
score = incremental.score(X2, y2, compute=False)

score.compute()

After the lazy fit, where do we keep the compute graph? What happens if someone looks at incremental.estimator? Is it a delayed object?

@TomAugspurger TomAugspurger mentioned this pull request Jul 3, 2018
@stsievert

Copy link
Copy Markdown
Member Author

I'm closing this in favor of #278.

@stsievert stsievert closed this Jul 4, 2018
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