tidymodels / plsmod Goto Github PK
View Code? Open in Web Editor NEWModel Wrappers for Projection Methods
Home Page: https://plsmod.tidymodels.org
License: Other
Model Wrappers for Projection Methods
Home Page: https://plsmod.tidymodels.org
License: Other
We are getting warnings of
trimming keepX to c(2,2,2)keepX is of length 100 while ncomp is 3
trimming keepX to c(100,100,100)keepX is of length 100 while ncomp is 3
trimming keepX to c(100,100,100)
This may be a simple bug but it also might be related to multi_predict()
.
Prepare for release:
devtools::build_readme()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
Submit to CRAN:
usethis::use_version('patch')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
The master
branch of this repository will soon be renamed to main
, as part of a coordinated change across several GitHub organizations (including, but not limited to: tidyverse, r-lib, tidymodels, and sol-eng). We anticipate this will happen by the end of September 2021.
That will be preceded by a release of the usethis package, which will gain some functionality around detecting and adapting to a renamed default branch. There will also be a blog post at the time of this master
--> main
change.
The purpose of this issue is to:
message id: euphoric_snowdog
> pred_vals <- multi_predict(mv_meats, meats[1:5, 1:100], num_comp = 1:10)
Error in is(object, c("rgcca", "sparse.rgcca")) :
length(class2) == 1L is not TRUE
Hi tidymodels/plsmod devs,
First of all, thank you for creating and maintaining this package! I use PLS regression a lot for my work lately, so I'm really glad to have the option to write my analysis code in the tidymodels framework.
I'm writing to ask if you would consider adding support for the pls package as another engine?
It implements some alternative PLS algorithms not included in the mixOmics package, including some that are standard in other software's PLS implementations. For example, it implements SIMPLS (De Jong 1993), which is the default algorithm used by Matlab's plsregress. (My supervisor is a Matlab native, so very selfishly I would love a tidymodels PLS engine that implements the same algorithm as Matlab so that we can double-check each others' work against each other's!)
plsr()
, takes formula syntaxplsr()
has a nice predict()
method already set up that I think should be pretty smooth to fit into the tidymodels predict formatplsr()
also takes an ncomp
argument, which could be set up as a tunable hyperparameter similar to how the mixOmics engine has it set upOne big thing that would require some work is the preprocessing function for the data. For multivariate predictors or responses, pls::plsr()
expects all predictor and response columns to each be bound up in a single matrix-column. The oliveoil
sample data in the pls package demonstrates what this looks like. For example, a multi-column X and Y PLS regression can be run with the following sample data from the package:
library(pls)
oliveoil1 <- plsr(sensory ~ chemical, ncomp=1, data = oliveoil)
You can see that oliveoil
is a 2-column dataframe, where sensory
and chemical
are both matrix-columns. Traditional multi-column dataframes can be converted into matrix-column dataframes doing something like:
data(mtcars)
library(dplyr)
x <- mtcars %>%
select(mpg, cyl, disp) %>%
as.matrix()
y <- mtcars %>%
select(hp, drat, wt, qsec) %>%
as.matrix()
matrix_dataframe <- tibble(x = I(x), y = I(y))
I think it would be possible to use the role selector functions from the recipes package to pull the predictor and outcome columns out of a trained recipe and then preprocess them into matrix-columns for plsr()
!
What do you think? Please let me know!
PS: I've never tried to implement my own parsnip engine before, but I see that there is a tidymodels article about it, so I can definitely try following that guide and contributing through a fork and pull request if that's of interest.
Pre-history
usethis::use_readme_rmd()
usethis::use_roxygen_md()
usethis::use_github_links()
usethis::use_pkgdown_github_pages()
usethis::use_tidy_github_labels()
usethis::use_tidy_style()
usethis::use_tidy_description()
urlchecker::url_check()
2020
usethis::use_package_doc()
@importFrom
directives here.usethis::use_import_from()
is handy for this.usethis::use_testthat(3)
and upgrade to 3e, testthat 3e vignetteR/
files and test/
files for workflow happiness.usethis::rename_files()
can be helpful.2021
usethis::use_tidy_dependencies()
usethis::use_tidy_github_actions()
and update artisanal actions to use setup-r-dependencies
cran-comments.md
Authors@R
of DESCRIPTION like so, if appropriate:person("RStudio", role = c("cph", "fnd"))
2022
usethis::use_tidy_coc()
master
--> main
issuesdevelopment
is mode: auto
in pkgdown configPrepare for release:
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::cloud_check()
cran-comments.md
Submit to CRAN:
usethis::use_version('major')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
> test_check("plsmod")
โโ 1. Failure: classification model fitting (@test-class-pls.R#17) โโโโโโโโโโโโ
`... <- NULL` threw an error.
Message: unused argument (mode = "regression")
Class: simpleError/error/condition
Backtrace:
1. testthat::expect_error(...)
20. plsmod::pls_fit(x = as.matrix(x), y = y, ncomp = 3, mode = "regression")
โโ 2. Error: classification model fitting (@test-class-pls.R#26) โโโโโโโโโโโโโโ
object 'parsnip_pls_da' not found
Backtrace:
1. testthat::expect_equal(parsnip_pls_da$fit$loadings, mo_pls_da$loadings)
2. testthat::quasi_label(enquo(object), label, arg = "object")
3. rlang::eval_bare(expr, quo_get_env(quo))
โโ 3. Failure: classification model fitting (@test-class-spls.R#18) โโโโโโโโโโโ
`... <- NULL` threw an error.
Message: unused argument (mode = "regression")
Class: simpleError/error/condition
Backtrace:
1. testthat::expect_error(...)
20. plsmod::pls_fit(...)
โโ 4. Error: classification model fitting (@test-class-spls.R#27) โโโโโโโโโโโโโ
object 'parsnip_spls_da' not found
Backtrace:
1. testthat::expect_equal(parsnip_spls_da$fit$loadings, mo_spls_da$loadings)
2. testthat::quasi_label(enquo(object), label, arg = "object")
3. rlang::eval_bare(expr, quo_get_env(quo))
Prepare for release:
devtools::build_readme()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
We are standardizing to have our parsnip-adjacent package keep their model definitions in parsnip so that other packages can add engines.
This package should take a version dependency of parsnip >= 0.1.7.9000
.
If a scalar is passed, the value of num_terms
would only apply to the first component. This might require a wrapper if it can be resolved by modifying x$args
.
2023
Necessary:
person(given = "Posit Software, PBC", role = c("cph", "fnd"))
use_mit_license()
use_tidy_logo()
usethis::use_tidy_coc()
usethis::use_tidy_github_actions()
Optional:
pak::pak("org/pkg")
over devtools::install_github("org/pkg")
in READMEuse_tidy_dependencies()
and/or replace compat files with use_standalone()
use_standalone("r-lib/rlang", "types-check")
instead of home grown argument checkersPrepare for release:
git pull
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::cloud_check()
cran-comments.md
git push
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
git push
usethis::use_github_release()
usethis::use_dev_version()
git push
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.