Skip to content

Commit 74ff766

Browse files
authored
Merge pull request #178 from tidymodels/internal-refactoring
Internal refactoring of model information
2 parents b05d93c + 2034a3f commit 74ff766

File tree

111 files changed

+7723
-3332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+7723
-3332
lines changed

.travis.yml

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,27 @@ language: r
44
dist: trusty
55
sudo: true
66

7+
cran: https://cran.rstudio.com
8+
79
# until generics is finalized
810
warnings_are_errors: false
911

1012
r:
1113
- 3.2
12-
- oldrel
13-
- release
14+
- 3.3
15+
- 3.4
16+
- 3.5
17+
- 3.6
1418
- devel
1519

1620

1721
matrix:
1822
allow_failures:
19-
- r: 3.2
20-
21-
r_binary_packages:
22-
- RCurl
23-
- dplyr
24-
- glue
25-
- magrittr
26-
- stringi
27-
- stringr
28-
- munsell
29-
- rlang
30-
- reshape2
31-
- scales
32-
- tibble
33-
- ggplot2
34-
- Rcpp
35-
- RcppEigen
36-
- BH
37-
- glmnet
38-
- earth
39-
- sparklyr
40-
- flexsurv
41-
- ranger
42-
- randomforest
43-
- xgboost
44-
- C50
45-
23+
- r: 3.3 # inum install failure (seg fault)
24+
- r: 3.2 # partykit install failure (libcoin needs >= 3.4.0)
25+
- r: 3.4 # mvtnorm requires >= 3.5.0
4626

4727
cache:
48-
packages: true
4928
directories:
5029
- $HOME/.keras
5130
- $HOME/.cache/pip
@@ -69,12 +48,12 @@ before_script:
6948

7049

7150
before_install:
72-
- sudo apt-get -y install libnlopt-dev
51+
- sudo apt-get -y install libnlopt-dev
7352
- sudo apt-get update
7453
- sudo apt-get -y install python3
7554
- mkdir -p ~/.R && echo "CXX14=g++-6" > ~/.R/Makevars
7655
- echo "CXX14FLAGS += -fPIC" >> ~/.R/Makevars
77-
56+
7857

7958
after_success:
8059
- Rscript -e 'covr::codecov()'

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: parsnip
2-
Version: 0.0.2
2+
Version: 0.0.2.9000
33
Title: A Common API to Modeling and Analysis Functions
44
Description: A common interface is provided to allow users to specify a model without having to remember the different argument names across different functions or computational engines (e.g. 'R', 'Spark', 'Stan', etc).
55
Authors@R: c(
@@ -27,7 +27,8 @@ Imports:
2727
magrittr,
2828
stats,
2929
tidyr,
30-
globals
30+
globals,
31+
vctrs
3132
Roxygen: list(markdown = TRUE)
3233
RoxygenNote: 6.1.1
3334
Suggests:
@@ -49,3 +50,4 @@ Suggests:
4950
rpart,
5051
MASS,
5152
nlme
53+
Remotes: r-lib/vctrs

NAMESPACE

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ S3method(translate,decision_tree)
4545
S3method(translate,default)
4646
S3method(translate,mars)
4747
S3method(translate,mlp)
48+
S3method(translate,nearest_neighbor)
4849
S3method(translate,rand_forest)
4950
S3method(translate,surv_reg)
5051
S3method(translate,svm_poly)
@@ -85,6 +86,11 @@ export(fit.model_spec)
8586
export(fit_control)
8687
export(fit_xy)
8788
export(fit_xy.model_spec)
89+
export(get_dependency)
90+
export(get_fit)
91+
export(get_from_env)
92+
export(get_model_env)
93+
export(get_pred_type)
8894
export(keras_mlp)
8995
export(linear_reg)
9096
export(logistic_reg)
@@ -97,13 +103,24 @@ export(multinom_reg)
97103
export(nearest_neighbor)
98104
export(null_model)
99105
export(nullmodel)
106+
export(pred_value_template)
100107
export(predict.model_fit)
101108
export(rand_forest)
102109
export(rpart_train)
103110
export(set_args)
111+
export(set_dependency)
104112
export(set_engine)
113+
export(set_env_val)
114+
export(set_fit)
115+
export(set_in_env)
105116
export(set_mode)
117+
export(set_model_arg)
118+
export(set_model_engine)
119+
export(set_model_mode)
120+
export(set_new_model)
121+
export(set_pred)
106122
export(show_call)
123+
export(show_model_info)
107124
export(surv_reg)
108125
export(svm_poly)
109126
export(svm_rbf)
@@ -180,7 +197,6 @@ importFrom(stats,na.omit)
180197
importFrom(stats,na.pass)
181198
importFrom(stats,predict)
182199
importFrom(stats,qnorm)
183-
importFrom(stats,qt)
184200
importFrom(stats,quantile)
185201
importFrom(stats,setNames)
186202
importFrom(stats,terms)
@@ -194,4 +210,4 @@ importFrom(utils,capture.output)
194210
importFrom(utils,getFromNamespace)
195211
importFrom(utils,globalVariables)
196212
importFrom(utils,head)
197-
importFrom(utils,stack)
213+
importFrom(vctrs,vec_unique)

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# parsnip 0.0.2.9000
22

3+
## Breaking Changes
4+
5+
* The method that `parsnip` stores the model information has changed. Any custom models from previous versions will need to use the new method for registering models. The methods are detailed in `?get_model_env()` and the [package vignette for adding models](https://tidymodels.github.io/parsnip/articles/articles/Scratch.html).
6+
* The mode need to be declared for models that can be used for more than one mode prior to fitting and/or translation).
7+
* For `surv_reg()`, the engine that uses the `survival` package is now called `survival` instead of `survreg`.
8+
39
## New Features
410

511
* `add_rowindex()` can create a column called `.row` to a data frame.

R/aaa.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ convert_stan_interval <- function(x, level = 0.95, lower = TRUE) {
1818
res
1919
}
2020

21+
# ------------------------------------------------------------------------------
22+
23+
#' @importFrom utils globalVariables
24+
utils::globalVariables(
25+
c('.', '.label', '.pred', '.row', 'data', 'engine', 'engine2', 'group',
26+
'lab', 'original', 'predicted_label', 'prediction', 'value', 'type')
27+
)

0 commit comments

Comments
 (0)