Skip to content

Conversation

@EmilHvitfeldt
Copy link
Member

in reference to #122.

Still WIP. Most of the skeleton is there but the predict() outputs length of fitting data not new_data.

@topepo
Copy link
Member

topepo commented Jan 24, 2019

Please use type = "numeric" for regression and null_model for the user-facing function.

@DavisVaughan will get a laugh out at this coming from me but please lint the R code. Opening brackets should be on the same line as the function definition/if etc.

null_model.default <- function(x = NULL, y, ...) {

}

Can you also enable multivariate numeric regression?

iris_basic <- null_model(mode = "regression") %>%
  set_engine("parsnip") %>%
  fit(cbind(Sepal.Width) ~ ., data = iris)

predict_numeric(iris_basic, iris[1:5,])

iris_basic <- null_model(mode = "regression") %>%
  set_engine("parsnip") %>%
  fit(cbind(Sepal.Width, Petal.Width) ~ ., data = iris)

predict_numeric(iris_basic, iris[1:5,])
@EmilHvitfeldt
Copy link
Member Author

Can you also enable multivariate numeric regression?

Consider it done!

library(parsnip)

iris_basic <- null_model(mode = "regression") %>% 
  set_engine("parsnip") %>%
  fit(cbind(Sepal.Width) ~ ., data = iris)
  
predict_numeric(iris_basic, iris[1:5,])
#> [1] 3.057333 3.057333 3.057333 3.057333 3.057333

iris_basic <- null_model(mode = "regression") %>% 
  set_engine("parsnip") %>%
  fit(cbind(Sepal.Width, Petal.Width) ~ ., data = iris)
  
predict_numeric(iris_basic, iris[1:5,])
#>   Sepal.Width Petal.Width
#> 1    3.057333    1.199333
#> 2    3.057333    1.199333
#> 3    3.057333    1.199333
#> 4    3.057333    1.199333
#> 5    3.057333    1.199333

Created on 2019-01-25 by the reprex package (v0.2.1)

While we are at it, should we also add quantile and classprob? It doesn't make sense to add conf_int and pred_int.

@topepo
Copy link
Member

topepo commented Jan 29, 2019

type = "classprob" would be helpful. I don't think that we have quantiles implemented anywhere so I'd hold off on that.

@EmilHvitfeldt
Copy link
Member Author

Should be there now.

@topepo topepo merged commit 73f001e into tidymodels:master Feb 25, 2019
@topepo
Copy link
Member

topepo commented Feb 25, 2019

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2021

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants