Code Monkey home page Code Monkey logo

cpmr's Introduction

cpmr

R-CMD-check Codecov test coverage CRAN status

The cpmr package is specifically designed for the analysis of the connectome predictive modeling (CPM) method in R. This package relies on Rfast to do row oriented calculation.

Installation

You can install the released version of cpmr from CRAN with:

install.packages("cpmr")

Or you can install the development version of cpmr from r-universe with:

install.packages("cpmr", repos = c("https://psychelzh.r-universe.dev", getOption("repos")))

Example

It is very simple to use this package. Just shape your connectivity matrix as a subjects by edges matrix, i.e., each row contains the correlation matrix (removed diagonal and duplicated values, e.g., lower triangular data) for each subject, and your behavior data a vector and feed them in cpm() function.

library(cpmr)

withr::local_seed(123)
conmat <- matrix(rnorm(100 * 1000), nrow = 100)
behav <- rnorm(100)
res <- cpm(conmat, behav, kfolds = 10)
plot(res$real, res$pred[, "both"], xlab = "Real", ylab = "Predicted")

cpmr's People

Contributors

psychelzh avatar

Watchers

 avatar  avatar

cpmr's Issues

Release cpmr 0.0.9

Prepare for release:

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

Submit to CRAN:

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

Wait for CRAN...

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

Support more modules

The following modules might be added:

  • #8
  • #6
  • โ“ Results visualization: this would require some other dependencies; thus, it might best live in a new package.

How to better control confounds?

Based on the original paper of Shen, the confounding variables are only used in edge selection (AFAIK). I have implemented that in versions 0.0.5-0.0.6, but after second thought, I resorted to my method, i.e., using residuals after regressing all the confounds variables both for the connectivity matrices and behavioral measures.

This is open for discussion. However, for now I am satisfied with this "residual" method, although the predicted values are not so well-fitted for explanation.

Add `na.action`?

It would be better if NA can be handled here. Or a simple na.rm argument could be added.

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.