Skip to content

MAINT: accept ndarrays for input to fit and predict#224

Merged
TomAugspurger merged 1 commit intodask:masterfrom
stsievert:fit-predict-ndarray
Jun 23, 2018
Merged

MAINT: accept ndarrays for input to fit and predict#224
TomAugspurger merged 1 commit intodask:masterfrom
stsievert:fit-predict-ndarray

Conversation

@stsievert
Copy link
Copy Markdown
Member

This PR implements and tests

  • creating dask arrays if the input args are np.ndarrays (with 1 chunk of the same shape) for both fit and predict
  • having predict return the same type as the argument passed in

This generalizes to Incremental because it calls fit.

if isinstance(z_, da.Array):
assert result.chunks == ((2, 2),)
assert isinstance(result, da.Array)
assert result.compute().tolist() == sol.tolist()
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.

FYI, we'd typically use dask.array.utils.assert_eq (I know you didn't write this test).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good to know. I thought that seemed clunky.

@TomAugspurger TomAugspurger merged commit 5db49e9 into dask:master Jun 23, 2018
@stsievert stsievert deleted the fit-predict-ndarray branch June 23, 2018 03:31
stsievert added a commit to stsievert/dask-ml that referenced this pull request Jun 28, 2018
TomAugspurger added a commit that referenced this pull request Jun 29, 2018
Revert "MAINT: accept ndarrays for input to fit and predict (#224)"
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.

2 participants