==1140620== Memcheck, a memory error detector ==1140620== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1140620== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==1140620== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==1140620== R Under development (unstable) (2021-03-19 r80100) -- "Unsuffered Consequences" Copyright (C) 2021 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 <- "PPtree" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('PPtree') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("LDA.Tree") > ### * LDA.Tree > > flush(stderr()); flush(stdout()) > > ### Name: LDA.Tree > ### Title: Find PP tree structure using LDA > ### Aliases: LDA.Tree > ### Keywords: tree > > ### ** Examples > > > data(iris) > n <- nrow(iris) > tot <- c(1:n) > n.train <- round(n*0.9) > train <- sample(tot,n.train) > test <- tot[-train] > > Tree.result <- LDA.Tree(iris[train,5],iris[train,1:4]) > Tree.result $Tree.Struct id L.node.ID R.F.node.ID Coef.ID Index [1,] 1 2 3 1 0 [2,] 2 4 5 2 0 [3,] 3 0 1 0 0 [4,] 4 0 2 0 0 [5,] 5 0 3 0 0 $Alpha.Keep Sepal.Length Sepal.Width Petal.Length Petal.Width [1,] 0.4548857 1.734833 -1.593083 -0.4326364 [2,] -0.9091797 -1.737140 1.886287 3.4362713 $C.Keep 1 1 1 1 1 1 [1,] 2.505242 3.642822 3.446147 2.395825 3.195770 2.022686 [2,] 4.366764 4.300822 4.155606 4.293805 4.047777 4.112381 > > > > cleanEx() > nameEx("PDA.Tree") > ### * PDA.Tree > > flush(stderr()); flush(stdout()) > > ### Name: PDA.Tree > ### Title: Find PP tree structure using PDA > ### Aliases: PDA.Tree > ### Keywords: tree > > ### ** Examples > > > data(iris) > n <- nrow(iris) > tot <- c(1:n) > n.train <- round(n*0.9) > train <- sample(tot,n.train) > test <- tot[-train] > > Tree.result <- PDA.Tree(iris[train,5],iris[train,1:4]) > Tree.result $Tree.Struct id L.node.ID R.F.node.ID Coef.ID Index [1,] 1 2 3 1 0 [2,] 2 4 5 2 0 [3,] 3 0 1 0 0 [4,] 4 0 3 0 0 [5,] 5 0 2 0 0 $Alpha.Keep [,1] [,2] [,3] [,4] [1,] 0.0000000 0 -1.0000000 0.0000000 [2,] -0.1434048 0 -0.6237269 -0.7683748 $C.Keep 1 1 1 1 1 1 [1,] -3.206581 -3.812593 -1.618479 -2.285438 -1.963244 -2.35831 [2,] -5.263553 -5.239329 -5.202216 -5.220745 -5.206929 -5.18291 > > > > cleanEx() > nameEx("PP.Tree") > ### * PP.Tree > > flush(stderr()); flush(stdout()) > > ### Name: PP.Tree > ### Title: Find PP tree structure > ### Aliases: PP.Tree > ### Keywords: tree > > ### ** Examples > > > data(iris) > n <- nrow(iris) > tot <- c(1:n) > n.train <- round(n*0.9) > train <- sample(tot,n.train) > test <- tot[-train] > > Tree.result <- PP.Tree("LDA",iris[train,5],iris[train,1:4]) > Tree.result $Tree.Struct id L.node.ID R.F.node.ID Coef.ID Index [1,] 1 2 3 1 0.904976 [2,] 2 4 5 2 0.803396 [3,] 3 0 1 0 0.000000 [4,] 4 0 3 0 0.000000 [5,] 5 0 2 0 0.000000 $Alpha.Keep [,1] [,2] [,3] [,4] [1,] 0.1307996 0.2535357 -0.9520379 -0.1106117 [2,] 0.2662413 0.2484687 -0.6764643 -0.6401366 $C.Keep 1 1 1 1 1 1 [1,] -1.623099 -2.222681 -0.1428791 -0.876758 -0.4685198 -0.8991251 [2,] -2.022520 -2.004019 -2.0133122 -2.008665 -2.0058929 -1.9874263 > > > > cleanEx() > nameEx("PP.classify") > ### * PP.classify > > flush(stderr()); flush(stdout()) > > ### Name: PP.classify > ### Title: Predict class for the test set and calculate prediction error > ### Aliases: PP.classify > ### Keywords: tree > > ### ** Examples > > data(iris) > n <- nrow(iris) > n.train <- round(n*0.9) > train <- sample(n, n.train) > > Tree.result <- PP.Tree("LDA", iris[train,5], iris[train, 1:4]) > tree.train <- PP.classify(iris[train, 1:4], iris[train, 5], Tree.result, + Rule=1) > tree.train $predict.error [1] 2 $predict.class [1] 2 3 1 1 2 2 1 3 2 1 2 2 1 3 3 1 3 3 2 1 3 2 3 1 1 3 1 1 3 1 2 3 1 3 1 3 1 [38] 3 3 1 1 1 3 1 1 1 1 2 3 2 3 3 2 2 2 1 3 3 1 2 1 3 1 2 3 3 2 3 3 3 1 1 3 2 [75] 2 2 3 3 1 1 3 2 1 1 2 2 3 3 2 2 1 3 2 2 3 2 2 2 1 3 1 2 3 3 3 2 3 2 1 3 1 [112] 2 1 3 3 1 2 3 3 2 2 2 1 1 1 3 1 2 2 3 1 2 3 3 2 > tree.test <- PP.classify(iris[-train, 1:4], iris[-train, 5], + Tree.result, Rule=1) > tree.test $predict.error [1] 0 $predict.class [1] 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 > > > > cleanEx() > nameEx("PP.optimize") > ### * PP.optimize > > flush(stderr()); flush(stdout()) > > ### Name: PP.optimize > ### Title: Find optimal projection by maximizing selected PP index > ### Aliases: PP.optimize PP.optimize.random PP.optimize.anneal > ### PP.optimize.Huber PP.optimize.plot > ### Keywords: optimize > > ### ** Examples > > data(iris) > > PP.opt<-PP.optimize.random("LDA",1,iris[,1:4],iris[,5],cooling=0.999,temp=1) > > PP.opt$index.best [1] 0.969672 > PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) > > > PP.opt<-PP.optimize.anneal("LDA",1,iris[,1:4],iris[,5],cooling=0.999,temp=1,energy=0.01) > PP.opt$index.best [1] 0.969872 > > PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) > > > PP.opt<-PP.optimize.Huber("LDA",2,iris[,1:4],iris[,5],cooling=0.999,r=1) ==1140620== Conditional jump or move depends on uninitialised value(s) ==1140620== at 0x166C4B0F: optimize3 (packages/tests-vg/PPtree/src/optimize.c:711) ==1140620== by 0x49F61C: do_dotCode (svn/R-devel/src/main/dotcode.c:1852) ==1140620== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1140620== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1140620== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1140620== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1140620== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1140620== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1140620== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1140620== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1140620== by 0x521587: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==1140620== by 0x521614: run_Rmainloop (svn/R-devel/src/main/main.c:1113) ==1140620== Uninitialised value was created by a client request ==1140620== at 0x52D37C: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2898) ==1140620== by 0x52E34B: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:595) ==1140620== by 0x52E34B: R_alloc (svn/R-devel/src/main/memory.c:2257) ==1140620== by 0x166C43EC: optimize3 (packages/tests-vg/PPtree/src/optimize.c:534) ==1140620== by 0x49F61C: do_dotCode (svn/R-devel/src/main/dotcode.c:1852) ==1140620== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1140620== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1140620== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1140620== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1140620== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1140620== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1140620== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1140620== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1140620== > PP.opt$index.best [1] 0.9765225 > PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) > > > > > > cleanEx() > nameEx("PPindex.class") > ### * PPindex.class > > flush(stderr()); flush(stdout()) > > ### Name: PPindex.class > ### Title: Calculate Projection Pursuit index > ### Aliases: PPindex.class PPindex.LDA PPindex.Lp PPindex.PDA > ### Keywords: multivariate > > ### ** Examples > > data(iris) > > PPindex.class("LDA",iris[,1:2],iris[,5]) [1] 0.8334565 > PPindex.class("LDA",iris[,1:2],iris[,5],weight=FALSE) [1] 0.8334565 > PPindex.class("Lp",iris[,1:2],iris[,5],r=1) [1] 1.220794 > PPindex.class("PDA",iris[,1:2],iris[,5],lambda=0.1) [1] 0.6823908 > > > > > ### *