Learn R Programming

zooimage (version 5.5.2)

ZITrain: Manipulate training and testsets 'ZITrain'/'ZITest' objects

Description

'ZITrain' contain a hierarchy of classes (taxonomic or not) and a link to a series of items belonging to these classes. It can be obtained after manual or automatic classification of various objects from .zid or .zidb files. 'ZITest' objects are almost identical, but with a constraint on the classes that must match the ones of the reference 'ZItrain' or 'ZIClass' object (a necessity to allow for comparisons)!

Usage

prepareTrain(traindir, zidbfiles, template = c("[Basic]", "[Detailed]",
    "[Very detailed]"), classes = NULL, …)
addToTrain(traindir, zidbfiles, classes = NULL, …)
getTrain(traindir, creator = NULL, desc = NULL, keep_ = FALSE, na.rm = FALSE)

prepareTest(testdir, zidbfiles, template, classes = NULL, …) addToTest(testdir, zidbfiles, classes = NULL, …) getTest(testdir, creator = NULL, desc = NULL, keep_ = NA, na.rm = FALSE)

cellModel(train, traindir, class, method = "mda") cellCompute(data, cellModels) cellCount(traindir, class, reset = FALSE)

template(object, …) # S3 method for default template(object, …)

recode(object, …) # S3 method for ZITrain recode(object, new.levels, depth, …) # S3 method for ZITest recode(object, new.levels, depth, …)

contextSelection()

Arguments

traindir

the root directory of the training set.

testdir

the root directory of the test set.

zidbfiles

.zidb files or .zid files to use for data and vignettes in the training set.

template

file containing subdirectories template to use for creating classes in the training or test set. Either a defaut template between [], or the name of a .zic file, or a template extracted from a 'ZITrain' or 'ZIClass' object using template(object) (with the add.others argument to TRUE for prepareTest() and to FALSE for prepareTrain())

classes

if vignettes are already classified in the zid(b) files, should they be sorted that way in the created training or test set? If not NULL, indicate the name of the classification column (usually, Class for manual classification or Predicted for automatic predictions). This can also be a 'ZIClass' or 'mlearning' object that will be used for classification of the particles first, ... or it can be a function that does the classification.

creator

name of the author of this classification (or the method, if done automatically).

desc

a short description of this manual classification.

keep_

do we keep items in the '\_' subdirectory (corresponding to unclassified ones)? Default to FALSE in getTrain() and to NA for getTest(), which transforms all items in the '\_' or one of its subdirectories into missing data.

na.rm

do we remove item with missing data? By default, not.

train

a ZITrain file to use for building the model.

class

a character string with the name of the class to process.

method

a character string with the nazme of the predictive method to use: "lm", "lda" or "mda" (by default).

data

a sample containing the particles to count.

cellModels

the file containing the models for cells countings.

reset

do we reset excisting counts for that class? By default, no.

object

a 'ZITrain' or 'ZITest' object. For prepareTest(), a 'ZITrain' or 'ZIClass' object to use as reference to determine the classes to make.

new.levels

a character string of same length as the levels of object$Class with the labels of the new levels.

depth

the depth in the hierachy of the classes as in the "path" attribute of the object to use for recoding classes. If this argument is provided, new.levels is ignored and recomputed (and a warning is issued if both arguments are provided).

further arguments passed to the method. For prepareXXX() and addToXXX(), it is further arguments passed to the prediction function provided in classes, or to the predict() method for 'ZIClass' or 'mlearning' objects.

See Also

ZIClass

Examples

Run this code
# NOT RUN {
##TODO...
# }

Run the code above in your browser using DataLab