==39770== Memcheck, a memory error detector ==39770== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==39770== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==39770== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==39770== R Under development (unstable) (2018-06-01 r74825) -- "Unsuffered Consequences" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "SemiSupervised" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('SemiSupervised') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("AnchorGraph") > ### * AnchorGraph > > flush(stderr()); flush(stdout()) > > ### Name: AnchorGraph > ### Title: Generate an Anchor Graph from an n x p data matrix > ### Aliases: AnchorGraph getAnchor > ### Keywords: classes models methods > > ### ** Examples > > ## Set up Sonar data with 20% labeled > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > g.agraph1<-agraph(Class~.,data=Sonar) ==39770== Invalid read of size 4 ==39770== at 0x158910DA: AREG_CV (packages/tests-vg/SemiSupervised/src/Anchor_Reg.c:56) ==39770== by 0x498A4D: R_doDotCall (svn/R-devel/src/main/dotcode.c:617) ==39770== by 0x499013: do_dotcall (svn/R-devel/src/main/dotcode.c:1252) ==39770== by 0x4CC6A9: bcEval (svn/R-devel/src/main/eval.c:6772) ==39770== by 0x4DAC0F: Rf_eval (svn/R-devel/src/main/eval.c:624) ==39770== by 0x4DC51E: R_execClosure (svn/R-devel/src/main/eval.c:1764) ==39770== by 0x4DAD9C: Rf_eval (svn/R-devel/src/main/eval.c:747) ==39770== by 0x46A46C: do_docall (svn/R-devel/src/main/coerce.c:2590) ==39770== by 0x4CC6A9: bcEval (svn/R-devel/src/main/eval.c:6772) ==39770== by 0x4DAC0F: Rf_eval (svn/R-devel/src/main/eval.c:624) ==39770== by 0x4DC51E: R_execClosure (svn/R-devel/src/main/eval.c:1764) ==39770== by 0x4D1CAC: bcEval (svn/R-devel/src/main/eval.c:6740) ==39770== Address 0x149dab24 is 868 bytes inside a block of size 7,960 alloc'd ==39770== at 0x4C2DB6B: malloc (/builddir/build/BUILD/valgrind-3.13.0/coregrind/m_replacemalloc/vg_replace_malloc.c:299) ==39770== by 0x510B7D: GetNewPage (svn/R-devel/src/main/memory.c:888) ==39770== by 0x512687: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2691) ==39770== by 0x1588F543: agraph_lscore (packages/tests-vg/SemiSupervised/src/Anchor_Reg.c:227) ==39770== by 0x15890A60: ARIDGE (packages/tests-vg/SemiSupervised/src/Anchor_Reg.c:182) ==39770== by 0x1589143C: AREG_CV (packages/tests-vg/SemiSupervised/src/Anchor_Reg.c:93) ==39770== by 0x498A4D: R_doDotCall (svn/R-devel/src/main/dotcode.c:617) ==39770== by 0x499013: do_dotcall (svn/R-devel/src/main/dotcode.c:1252) ==39770== by 0x4CC6A9: bcEval (svn/R-devel/src/main/eval.c:6772) ==39770== by 0x4DAC0F: Rf_eval (svn/R-devel/src/main/eval.c:624) ==39770== by 0x4DC51E: R_execClosure (svn/R-devel/src/main/eval.c:1764) ==39770== by 0x4DAD9C: Rf_eval (svn/R-devel/src/main/eval.c:747) ==39770== > > ##The following gives an equivalent output to the g.agraph1<-agraph(Class~.,data=Sonar) call. > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("agraph") > ### * agraph > > flush(stderr()); flush(stdout()) > > ### Name: agraph > ### Title: Anchor Graph Functions ('agraph') > ### Aliases: agraph agraph-methods agraph,formula-method > ### agraph,data.frame-method agraph,matrix-method agraph,vector-method > ### agraph,anchor-method show,agraph-method agraph.default > ### Keywords: classes models methods > > ### ** Examples > > ## Set up Sonar data with 20% labeled (comparing randomForest and glmnet) > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > ## Fit agraph to Sonar > g.agraph<-agraph(Class~.,data=Sonar) > g.agraph Anchor Graph Laplacian (agraph) with (n,|L|)=( 208 , 42 ) or 20 % labeled Performance Estimates: k-CV: 1.32 GCV: 0.034 DF: 0 Fit Estimates: Lagrangians: 10 0.001 Safe-Lagrangian 0.1 > tab=table(fitted(g.agraph)[U],y.true[U]) > 1-sum(diag(tab))/sum(tab) [1] 0.2650602 > > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("dG") > ### * dG > > flush(stderr()); flush(stdout()) > > ### Name: dG > ### Title: Specify graph terms for 'formula' instances of objects contained > ### in "SemiSupervised" > ### Aliases: dG sG aG > ### Keywords: classes models methods > > ### ** Examples > > ####### > ## Equivalent uses of the formula and default s4pm call. > ####### > > ## Set up Sonar data with 20% labeled > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > control=SemiSupervised.control(stability=0.0) ## turn off adjustment parameters for comparison > > (g.s4pm<-s4pm(Class~.,data=Sonar,control=control)) ### Fit s4pm to Sonar S4PM Fit with (n,|L|)=( 208 , 42 ) or 20 % labeled Performance Estimates: k-CV: 1.279 GCV: 2.261 DF: 4.251 Fit Estimates: Graph Kernel h: 0.17 Lagrangians: 0.1 0.001 Safe-Lagrangian 0.1 > > ##The following give equivalent output to the g.s4pm<-s4pm(Class~.,data=Sonar) call. > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("jtharm") > ### * jtharm > > flush(stderr()); flush(stdout()) > > ### Name: jtharm > ### Title: Joint Harmonic Functions ('jtharm') > ### Aliases: jtharm jtharm-methods jtharm,formula-method > ### jtharm,data.frame-method jtharm,matrix-method show,jtharm-method > ### jtharm.default > ### Keywords: classes models methods > > ### ** Examples > > ## Set up Sonar data with 20% labeled (comparing randomForest and glmnet) > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > ##Fit jtharm to Sonar > g.jtharm<-jtharm(Class~.,data=Sonar) ==39770== Conditional jump or move depends on uninitialised value(s) ==39770== at 0x15893D40: cv_jtharm_fit (packages/tests-vg/SemiSupervised/src/joint_harmonic.c:66) ==39770== by 0x498AE9: R_doDotCall (svn/R-devel/src/main/dotcode.c:596) ==39770== by 0x499013: do_dotcall (svn/R-devel/src/main/dotcode.c:1252) ==39770== by 0x4CC6A9: bcEval (svn/R-devel/src/main/eval.c:6772) ==39770== by 0x4DAC0F: Rf_eval (svn/R-devel/src/main/eval.c:624) ==39770== by 0x4DC51E: R_execClosure (svn/R-devel/src/main/eval.c:1764) ==39770== by 0x4DAD9C: Rf_eval (svn/R-devel/src/main/eval.c:747) ==39770== by 0x46A46C: do_docall (svn/R-devel/src/main/coerce.c:2590) ==39770== by 0x4CC6A9: bcEval (svn/R-devel/src/main/eval.c:6772) ==39770== by 0x4DAC0F: Rf_eval (svn/R-devel/src/main/eval.c:624) ==39770== by 0x4DC51E: R_execClosure (svn/R-devel/src/main/eval.c:1764) ==39770== by 0x4D1CAC: bcEval (svn/R-devel/src/main/eval.c:6740) ==39770== Uninitialised value was created by a stack allocation ==39770== at 0x15893831: cv_jtharm_fit (packages/tests-vg/SemiSupervised/src/joint_harmonic.c:3) ==39770== > tab=table(fitted(g.jtharm)[U],y.true[U]) > 1-sum(diag(tab))/sum(tab) [1] 0.1927711 > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("powerplant") > ### * powerplant > > flush(stderr()); flush(stdout()) > > ### Name: PowerPlant > ### Title: The Combined Cycle Power Plant Data Set > ### Aliases: powerplant > ### Keywords: datasets > > ### ** Examples > > > > > cleanEx() > nameEx("predict.agraph") > ### * predict.agraph > > flush(stderr()); flush(stdout()) > > ### Name: predict.agraph > ### Title: Out-of-Sample Predict Procedure for 'agraph' > ### Aliases: predict.agraph predict,agraph-method > ### Keywords: classes models methods > > ### ** Examples > > ## Prediction depends on the nature of the call. Consider some examples. > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > U1=sample(U,ceiling(0.5*n)) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > ## Typical, call to agraph and predict > > g.agraph1<-agraph(Class~.,data=Sonar[c(L,U1),]) > p.agraph1<-predict(g.agraph1,xnew=Sonar[U,-p]) > tab=table(y.true[U],p.agraph1) > 1-sum(diag(tab))/sum(tab) [1] 0.2349398 > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("predict.jtharm") > ### * predict.jtharm > > flush(stderr()); flush(stdout()) > > ### Name: predict.jtharm > ### Title: Out-of-Sample Predict Procedure for 'jtharm' > ### Aliases: predict.jtharm predict,jtharm-method > ### Keywords: classes models methods > > ### ** Examples > > ## Prediction depends on the nature of the call. Consider some examples. > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > U1=sample(U,ceiling(0.5*n)) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > ## Typical, call to jtharm and predict > g.jtharm1<-jtharm(Class~.,data=Sonar[c(L,U1),]) > p.jtharm1<-predict(g.jtharm1,xnew=Sonar[U,-p]) > tab=table(y.true[U],p.jtharm1) > 1-sum(diag(tab))/sum(tab) [1] 0.3012048 > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("predict.s4pm") > ### * predict.s4pm > > flush(stderr()); flush(stdout()) > > ### Name: predict.s4pm > ### Title: Out-of-Sample Predict Procedure for 's4pm' > ### Aliases: predict.s4pm predict,s4pm-method > ### Keywords: classes models methods > > ### ** Examples > > ## Prediction depends on the nature of the call. Consider some examples. > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > U1=sample(U,ceiling(0.5*n)) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > ## Typical, call to s4pm and predict > > g.s4pm<-s4pm(Class~.,data=Sonar[c(L,U1),]) > p.s4pm<-predict(g.s4pm,xnew=Sonar[U,-p]) > tab=table(y.true[U],p.s4pm) > 1-sum(diag(tab))/sum(tab) [1] 0.253012 > > > > cleanEx() detaching ‘package:mlbench’ > nameEx("s4pm") > ### * s4pm > > flush(stderr()); flush(stdout()) > > ### Name: s4pm > ### Title: Safe Semi-Supervised Semi-Parametric Model ('s4pm') > ### Aliases: s4pm s4pm-methods s4pm,formula-method s4pm,NULL-method > ### s4pm,lapGraph-method s4pm,vector-method s4pm,data.frame-method > ### s4pm,matrix-method show,s4pm-method s4pm.default > ### Keywords: classes models methods > > ### ** Examples > > ## Set up Sonar data with 20% labeled (comparing randomForest and glmnet) > library(mlbench) > data(Sonar) > > n=dim(Sonar)[1] > p=dim(Sonar)[2] > > nu=0.2 > set.seed(100) > L=sort(sample(1:n,ceiling(nu*n))) > U=setdiff(1:n,L) > > y.true<-Sonar$Class > Sonar$Class[U]=NA > > ## Fit s4pm to Sonar > g.s4pm<-s4pm(Class~.,data=Sonar) > g.s4pm S4PM Fit with (n,|L|)=( 208 , 42 ) or 20 % labeled Performance Estimates: k-CV: 1.278 GCV: 2.249 DF: 4.265 Fit Estimates: Graph Kernel h: 0.17 Lagrangians: 0.1 0.001 Safe-Lagrangian 0.1 > tab=table(fitted(g.s4pm)[U],y.true[U]) > 1-sum(diag(tab))/sum(tab) [1] 0.2048193 > > ## For comparison > > > > ### *