makeNotNotMnistProblem: MNIST like problem.

Description Usage Arguments Value Examples

View source: R/makeNotNotMnist.R

Description

Generate images of letters or numbers in various ways. Randomized size, position, rotations and fonts are available to set the difficulty of the problem.

Usage

1
2
3
makeNotNotMnistProblem(n = 5^4, sample.font = TRUE, random.rotation = 0,
  position.range = c(0.3, 0.7), size.range = c(15, 50), letters = LETTERS,
  resolution = c(32, 32), pointsize = 2, create.task = TRUE)

Arguments

n

[integer(1)]
Number of observations to create. Default is 5000L.

sample.font

[logical(1)]
Should every image be sampled from a different font. Fonts are sampled from Hershey. Default is TRUE.

random.rotation

[numeric(1)]
Should the rotation of the letters/numbers be randomized. Value is the maximum degree of rotation. Default is 0, which is no rotation at all.

position.range

[numeric(2]
Randomize position of the letter/number. First number is the lower bound for x/y value, second number the upper bound. Minimal/maximal values of the canvas are 0 and 1. Note that it is possible that some element of the letters/number might be out of the bound, depending on the range and size. Default is c(0.3, 0.7)

size.range

[numeric(2)]
Size of the letters/numbers, is sampled between first and second value. This is the cex value of the plot. Default is c(15, 50).

letters

[numeric() | character()]
Letters/Numbers to sample from. Can be anything that can be passed to text(). Default is LETTERS.

resolution

[integer(2)]
Resolution of the image. This defines the number of features. Default is c(32, 32), which creates 1024 features.

pointsize

[integer(1)]
Pointsize of intepreted big points (1/72 inch). See bmp. Default is 2.

create.task

[logical(1)]
Should a task be created? If TRUE a mlr classification task (see makeClassifTask is returned. Otherwise a data.frame is returned.

Value

ClassifTask | data.frame.

Examples

1
2
 data = makeNotNotMnistProblem(10, create.task = FALSE)
 image(matrix(as.numeric(data[1, -1]), ncol = 32))

ja-thomas/dlbench documentation built on May 18, 2019, 7:15 a.m.