Learn R Programming

phenoDist (version 1.20.0)

PDMBySvmAccuracy: Compute phenotypic distance matrix by SVM classification accuracy

Description

This function performs an SVM classification between two given samples, and calculates the classification accuracy via cross validation as the phenotypic distance between the two samples. For multiple samples, the function returns a pair-wise distance matrix.

Usage

PDMBySvmAccuracy(x, unames, selectedCellFtrs, cross=5, verbose=FALSE, ...)

Arguments

x
An imageHTS object.
unames
A character vector, containing the well names from where to collect the cell features. See getUnames for details.
selectedCellFtrs
A character vector for cell features to be used in the calculation. If missing, all features are used.
cross
An interger scalar indicating how many folds of cross validation should be performed.
verbose
A logical scalar indicating whether progress should be reported.
...
Additional arguments to be passed to the svm function of the e1071 package.

Value

A symmetric distance matrix with the number of rows equaling to the length of unames.

Details

For every pair of wells, this function collects features of all cells from both wells, and performs a bi-class classification using Support Vector Machine (SVM). The classification accuracy is defined as the phenotypic distance for the distance matrix.

See Also

svm

Examples

Run this code

  library('phenoDist')

  ## load the imageHTS object
  load(system.file('kimorph', 'kimorph.rda', package='phenoDist'))
  x@localPath <- file.path(tempdir(), 'kimorph')

  ## calculate pair-wise svm distance matrix
  load(system.file('kimorph', 'selectedFtrs.rda', package='phenoDist'))
  pdm <- PDMBySvmAccuracy(x, unames=getUnames(x, plate=1, row=2:3, col=3), selectedCellFtrs=selectedCellFtrs, cross=5, verbose=FALSE, cost=1, gamma=2^-5, kernel='radial')

Run the code above in your browser using DataLab