regressoR.batchLearn: Apply the Regression Learning to a Directory of Data and...

Description Usage Arguments See Also

Description

Recursively, a source directory is traversed and all files matching to a selector regular expression are picked up, loaded with a loader, and then modelled by the regressor. The resulting models are stored in a destination folder in a structure mirroring the source folder.

This method uses regressoR.learnForExport to learn the models and stores them into files using saveRDS to store them. They can later be read using regressoR.loadResult.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
regressoR.batchLearn(source = getwd(), destination = file.path(source,
  "../models"), loader = function(file) read.csv(file, sep = "\t", header =
  FALSE)[c(1, 2)], selector = path.extensionRegExp("txt"),
  check.directory = NULL, learn.single = TRUE, learn.all = FALSE,
  learners = regressoR.defaultLearners(), representations = function(x, y)
  Transformation.applyDefault2D(x = x, y = y, addIdentity = TRUE),
  metricGenerator = RegressionQualityMetric.default,
  suffix.single = "_single.model", suffix.all = "_all.model", q = 0.75,
  includeMetric = TRUE, cores = 1L, logging = if (cores <= 1L) {     TRUE
  } else {     file.path(destination, "log.txt") }, returnResults = FALSE,
  skipExisting = (!returnResults))

Arguments

source

the source directory, which is recursively searched for files with data to be modeled

destination

the destination folder, will be created if not existing

loader

a loader function which accepts a vector of paths and is supposed to return an n*2 matrix where the first column contains the x values and the second column the y values to model

selector

a regular expression against which file names are matched. Only matching files are considered.

check.directory

a function receiving a root folder and the path under root and decides whether this directory path should be recursively investigated (be default always TRUE)

learn.single

should every single file matching to the selector be modeled separately ?

learn.all

should all the files in one directory combined and modeled at once?

learners

the model learners to be applied

representations

a function which can transform a x/y dataset into a set of transformed data instances

metricGenerator

the learning quality metric generator

suffix.single

the suffix to append to the files containing the single models

suffix.all

the suffix to be applied to the files containing the models of all files in a folder

q

the modelling quality parameter

includeMetric

should the metric used for learning be stored in the files

cores

the number of cores to use (>1L leads to parallel execution)

logging

should progress information be printed: either TRUE for printing to the console via print, FALSE for no logging, or a path to a file receiving logging information

returnResults

should we return the computed results or not?

skipExisting

should already existing models (resulting from a previous, incomplete execution) simply be skipped or overwritting

See Also

regressoR.learnForExport

regressoR.loadResult


thomasWeise/regressoR documentation built on May 9, 2019, 8:12 p.m.