transbiozi / rmtl Goto Github PK
View Code? Open in Web Editor NEWRegularized Multi-task Learning in R
Home Page: https://CRAN.R-project.org/package=RMTL
Regularized Multi-task Learning in R
Home Page: https://CRAN.R-project.org/package=RMTL
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)
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
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
>
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.