plot.GMDHplot: Plotting Using GMDH and dce-GMDH Algorithms for Binary...

View source: R/plot.GMDHplot.R

plot.GMDHplotR Documentation

Plotting Using GMDH and dce-GMDH Algorithms for Binary Classification

Description

This function plots minimum specified external criterion across layers based upon a model trained by GMDH or dceGMDH. This is plotted for validation set.

Usage

## S3 method for class 'GMDHplot'
plot(x, ...)

Arguments

x

an object of class created by GMDH or dceGMDH.

...

currently not used.

Author(s)

Osman Dag

See Also

GMDH, dceGMDH

Examples


library(GMDH2)

library(mlbench)
data(BreastCancer)

data <- BreastCancer

# to obtain complete observations
completeObs <- complete.cases(data)
data <- data[completeObs,]

x <- data.matrix(data[,2:10])
y <- data[,11]

seed <- 12345
set.seed(seed)
nobs <- length(y)

# to split train, validation and test sets
indices <- sample(1:nobs)

ntrain <- round(nobs*0.6,0)
nvalid <- round(nobs*0.2,0)
ntest <- nobs-(ntrain+nvalid)

train.indices <- sort(indices[1:ntrain])
valid.indices <- sort(indices[(ntrain+1):(ntrain+nvalid)])
test.indices <- sort(indices[(ntrain+nvalid+1):nobs])


x.train <- x[train.indices,]
y.train <- y[train.indices]

x.valid <- x[valid.indices,]
y.valid <- y[valid.indices]

x.test <- x[test.indices,]
y.test <- y[test.indices]

set.seed(seed)
# to construct model via GMDH algorithm
model <- GMDH(x.train, y.train, x.valid, y.valid)
plot(model)

# to construct model via dce-GMDH algorithm
model2 <- dceGMDH(x.train, y.train, x.valid, y.valid)
plot(model2)



GMDH2 documentation built on Oct. 26, 2022, 5:06 p.m.

Related to plot.GMDHplot in GMDH2...