ucurve: U-curve algorith on the Partition Lattice Learning Space

Description Usage Arguments Details Value Examples

View source: R/ucurve.R

Description

TBD

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ucurve(
  xtrain,
  ytrain,
  xval,
  yval,
  optimal = T,
  exhaust = 1000,
  sampleNeigh = F,
  verbose = T,
  stop = 0,
  path = "~/GDrive/Doutorado/Códigos/Particoes/",
  Lh = NULL,
  cores = 4
)

Arguments

xtrain

Vector with the training sample of x values.

ytrain

Vector with the training sample of y values.

xval

Vector with the validation sample of x values.

yval

Vector with the validation sample of y values.

optimal

Logical indicating if the algorithm should return an optimal solution.

exhaust

Number of points to exhaust before stopping the algorithm.

sampleNeigh

Either false to consider all neighboors, or the maximum number of neighboors to sample at each exhaustion. If a number,then optimal should be false.

verbose

Logical to print a trace of the algorithm.

stop

Number of nodes yet to evaluate to trigger exhaustive search.

path

Path to preprocessed partition files.

Lh

A data frame with the partition lattice.

cores

Number of cores for parallel computing.

Details

TBD

Value

hypotheses

The estimated hypothesis of the global minimums with least VC dimension.

partitions

Partitions of the global minimums with least VC dimension.

error

Validation error of the global minimums.

exhausted

Number of nodes exhausted during algorithm.

remain

Number of nodes remaining after algorithm stopped.

finished

If the algorithm was finished or ended after not finding any Strong Local Minimum.

SLMvis

Number of nodes exhasuted until the last Strong Local Minimum was found.

remain_after_prune

Number of nodes remaining after finding each Strong Local Minimum.

exhausted_until_prune

Number of nodes exhausted until finding each Strong Local Minimum.

optimal

Wheter an optimal solution was returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1)
x <- sample(x = c("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"),size = 500,replace = T)
y <- as.factor(ifelse(as.numeric(x)-10+rnorm(500,0,20/3) > 0,1,0))
x <- factor(x)
train <- sample(1:500,350,F)
xtrain <- x[train]
ytrain <- y[train]
xval <- x[!(c(1:500) %in% train)]
yval <- y[!(c(1:500) %in% train)]
ucurve(xtrain,ytrain,xval,yval,optimal = F,sampleNeigh = 5000)

dmarcondes/partitionUcurve documentation built on March 29, 2021, 10:23 p.m.