Movatterモバイル変換


[0]ホーム

URL:


Data Piling

Eric Bridgeford

2020-06-25

require(lolR)
## Loading required package: lolR
require(ggplot2)
## Loading required package: ggplot2
require(MASS)
## Loading required package: MASS
n=400d=30r=3

Data for this notebook will ben=400 examples ofd=30 dimensions.

DP

Stacked Cigar Simulation

We first visualize the first2 dimensions:

testdat <-lol.sims.cigar(n, d)X <-testdat$XY <-testdat$Ydata <-data.frame(x1=X[,1],x2=X[,2],y=Y)data$y <-factor(data$y)ggplot(data,aes(x=x1,y=x2,color=y))+geom_point()+xlab("x1")+ylab("x2")+ggtitle("Simulated Data")

Projecting with MDP toK-1=1 dimension and visualizing:

result <-lol.project.dp(X, Y)data <-data.frame(x1=result$Xr[,1],y=Y)data$y <-factor(data$y)ggplot(data,aes(x=x1,y=y,color=y))+geom_point()+xlab("x1")+ylab("Class")+ggtitle("Projected Data using MDP")

Trunk Simulation

We visualize the first2 dimensions:

testdat <-lol.sims.rtrunk(n, d)X <-testdat$XY <-testdat$Ydata <-data.frame(x1=X[,1],x2=X[,2],y=Y)data$y <-factor(data$y)ggplot(data,aes(x=x1,y=x2,color=y))+geom_point()+xlab("x1")+ylab("x2")+ggtitle("Simulated Data")

Projecting with MDP toK-1=1 dimensions and visualizing:

result <-lol.project.dp(X, Y)data <-data.frame(x1=result$Xr[,1],y=Y)data$y <-factor(data$y)ggplot(data,aes(x=x1,y=y,color=y))+geom_point()+xlab("x1")+ylab("Class")+ggtitle("Projected Data using MDP")

Rotated Trunk Simulation

We visualize the first2 dimensions:

testdat <-lol.sims.rtrunk(n, d,rotate=TRUE)X <-testdat$XY <-testdat$Ydata <-data.frame(x1=X[,1],x2=X[,2],y=Y)data$y <-factor(data$y)ggplot(data,aes(x=x1,y=x2,color=y))+geom_point()+xlab("x1")+ylab("x2")+ggtitle("Simulated Data")

Projecting with MDP toK-1=1 dimensions and visualizing:

result <-lol.project.dp(X, Y)data <-data.frame(x1=result$Xr[,1],y=Y)data$y <-factor(data$y)ggplot(data,aes(x=x1,y=y,color=y))+geom_point()+xlab("x1")+ylab("Class")+ggtitle("Projected Data using MDP")


[8]ページ先頭

©2009-2025 Movatter.jp