Code Monkey home page Code Monkey logo

rmtl's Introduction

RMTL

Regularized Multi-task Learning in R

Description

This package provides an efficient implementation of regularized multi-task learning comprising 10 algorithms applicable for regression, classification, joint feature selection, task clustering, low-rank learning, sparse learning and network incorporation. All algorithms are implemented basd on the accelerated gradient descent method and feature a complexity of O(1/k^2). Sparse model structure is induced by the solving the proximal operator. The package has been uploaded in the CRAN: https://CRAN.R-project.org/package=RMTL

Required Packages

Four packages have to be instaled in advanced to enable functions i.e. eigen-decomposition, 2D plotting: ‘MASS’, ‘psych’, ‘corpcor’ and ‘fields’. You can install them from the CRAN.

install.packages("MASS")
install.packages("psych")
install.packages("corpcor")
install.packages("fields")

Installation

You can choose any of the three ways to install RMTL.

  1. Install from CRAN in R environment (Recommend)
install.packages("RMTL")
# in this way, the requirement for installation are automatically checked.
  1. Install from github in R environment
install.packages("devtools")
library("devtools")
install_github("transbioZI/RMTL")
  1. Install from the source code
git clone https://github.com/transbioZI/RMTL.git
R CMD build ./RMTL/
R CMD INSTALL RMTL*.tar.gz

Tutorial

The tutorial of multi-task learning using RMTL can be found here.

Manual

Please check "RMTL-manuel.pdf" for more details.

Reference

Cao, Han, Jiayu Zhou and Emanuel Schwarz. "RMTL: An R Library for Multi-Task Learning." Bioinformatics (2018).

Contact

If you have any question, please contact: [email protected]

rmtl's People

Contributors

hank9cao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rmtl's Issues

My own datasets

Hello,
I like to use this package for the multi-task learning of classification problem. However, I don't know how to import my datasets ( three tasks) in this package.
Please help me in this regard

the error in seq.default(cv_idx, task_sample_size, by = cv_fold)

I used this package for the multi-task learning of regression problem. The dataset is (160row, 31 column), and the X is (160row, 28column), Y is (160row, 3 column).

The model and the parameter are that:

cvfitr1 <- cvMTL(X, Y, type="Regression", Regularization="L21",

  •             Lam1_seq=10^seq(1,-4, -1),  Lam2=0, opts=list(init=0,  tol=10^-6, maxIter=1500),
    
  •             nfolds= 10, stratify=F, parallel=F)
    

The error is that:
Error in seq.default(cv_idx, task_sample_size, by = cv_fold) :
wrong sign in 'by' argument.

Another model and parameter:

model <- MTL(X, Y, type = "Regression",Regularization="L21",

  •          Lam1=0.1, Lam2=0.1, opts=list(init=0, tol=10^-6, maxIter=500))
    

Error is that:
Error in Y[[x]] : 下标出界(the subscript out of size)

bugs in parallel

thank you for your works, but maybe there have bug in parallel functions,:
1 need add stopImplicitCluster() to stop cluster when compute finished, otherwise r background process will not close.
2 some times parallel cvMTL and single thread cvMTL got different result Lam1.min

set.seed(202000)
library(RMTL)
data <- Create_simulated_data(t=1,p=50,n=200000,
                              Regularization="Lasso",
                              type="Classification")

cvfit<-cvMTL(data$X, data$Y, type="Classification", 
                         Regularization="Lasso",nfolds = 10)

cvfit1<-cvMTL(data$X, data$Y, type="Classification", 
                         Regularization="Lasso",parallel = T,
                         ncores = 2,nfolds = 10)
cvfit$Lam1.min==cvfit1$Lam1.min

#run it 
> set.seed(202000)
> library(RMTL)
> data <- Create_simulated_data(t=1,p=50,n=200000,
+                               Regularization="Lasso",
+                               type="Classification")
> 
> cvfit<-cvMTL(data$X, data$Y, type="Classification", 
+                          Regularization="Lasso",nfolds = 10)
> 
> cvfit1<-cvMTL(data$X, data$Y, type="Classification", 
+                          Regularization="Lasso",parallel = T,
+                          ncores = 2,nfolds = 10)
> cvfit$Lam1.min==cvfit1$Lam1.min
[1] FALSE
> cvfit$Lam1.min
[1] 1e-04
> cvfit1$Lam1.min
[1] 0.001
> cvfit
$Lam1_seq
[1] 1e+01 1e+00 1e-01 1e-02 1e-03 1e-04

$Lam1.min
[1] 1e-04

$Lam2
[1] 0

$cvm
[1] 0.499590 0.499590 0.221030 0.041510 0.035485 0.035435

attr(,"class")
[1] "cvMTL"
> cvfit1
$Lam1_seq
[1] 1e+01 1e+00 1e-01 1e-02 1e-03 1e-04

$Lam1.min
[1] 0.001

$Lam2
[1] 0

$cvm
[1] 0.500890 0.500890 0.220945 0.041620 0.035445 0.035445

attr(,"class")
[1] "cvMTL"
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 
[2] LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RMTL_0.9

loaded via a namespace (and not attached):
[1] compiler_3.5.3    parallel_3.5.3    tools_3.5.3       codetools_0.2-16 
[5] doParallel_1.0.14 iterators_1.0.10  foreach_1.4.4    
> 

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.