Giter Club home page Giter Club logo

plsmod's Issues

resolve mixOmics warnings

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().

Release plsmod 0.1.1

Prepare for release:

  • devtools::build_readme()
  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Polish NEWS

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()

Move `master` branch to `main`

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:

  • Help us firm up the list of targetted repositories
  • Make sure all maintainers are aware of what's coming
  • Give us an issue to close when the job is done
  • Give us a place to put advice for collaborators re: how to adapt

message id: euphoric_snowdog

length(class2) == 1L errors

> 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

Feature request: Adding engine support for pls package?

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!)

  • The main user-facing PLS function of the pls package, plsr(), takes formula syntax
  • plsr() has a nice predict() method already set up that I think should be pretty smooth to fit into the tidymodels predict format
  • plsr() also takes an ncomp argument, which could be set up as a tunable hyperparameter similar to how the mixOmics engine has it set up
  • The package is also actively maintained so I feel safe that we would not be throwing users into a hole

One 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.

Upkeep for plsmod

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()
    Consider letting usethis manage your @importFrom directives here.
    usethis::use_import_from() is handy for this.
  • usethis::use_testthat(3) and upgrade to 3e, testthat 3e vignette
  • Align the names of R/ 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
  • Remove check environments section from cran-comments.md
  • Bump required R version in DESCRIPTION to 3.4
  • Use lifecycle instead of artisanal deprecation messages, as described in Communicate lifecycle changes in your functions
  • Make sure RStudio appears in Authors@R of DESCRIPTION like so, if appropriate:
    person("RStudio", role = c("cph", "fnd"))

2022

Release plsmod 1.0.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::cloud_check()
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post
  • Ping Tracy Teal on Slack

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

fix r-devel errors

> 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))

Release plsmod 0.1.0

Prepare for release:

  • devtools::build_readme()
  • Check current CRAN check results
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Polish NEWS
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

move model definition to parsnip

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.

expand keepX

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.

Upkeep for plsmod

2023

Necessary:

  • Update copyright holder in DESCRIPTION: person(given = "Posit Software, PBC", role = c("cph", "fnd"))
  • Double check license file uses '[package] authors' as copyright holder. Run use_mit_license()
  • Update email addresses *@rstudio.com -> *@posit.co
  • Update logo (https://github.com/rstudio/hex-stickers); run use_tidy_logo()
  • usethis::use_tidy_coc()
  • usethis::use_tidy_github_actions()

Optional:

  • Review 2022 checklist to see if you completed the pkgdown updates
  • Prefer pak::pak("org/pkg") over devtools::install_github("org/pkg") in README
  • Consider running use_tidy_dependencies() and/or replace compat files with use_standalone()
  • use_standalone("r-lib/rlang", "types-check") instead of home grown argument checkers
  • Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for examples

Release plsmod 0.2.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::cloud_check()
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • git push
  • Draft blog post
  • Slack link to draft blog in #open-source-comms

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.