otopred: Predict new samples based on classification models

Description Usage Arguments Details Value Note See Also

View source: R/otopred.R

Description

Predict new, unknown samples using either shape decriptors or semi-landmark configurations.

Usage

1
2
3
4
otopred(project, query, multiview = FALSE, type = c("nef", "gpa", "des"),
  method = c("lda", "agglda", "tree", "plsda"), har, pc, threshold,
  reland = TRUE, tol = NULL, fix = NULL, mode = c("pred",
  "search+pred"), saveresult = FALSE, search.plot = FALSE, ...)

Arguments

project

path to a project (.rds file) to be read, saved using saveproj, or a project object already read into R. if not given, interactive file selector will pop out to prompt user to select a .rds file (Windows only)

query

path(s) to otolith images/ path(s) of folder containing the otolith images/ code.tps file containing the semi-landmark configurations/ p x k matrix or p x k x n array of semi-landmark configuration(s) to be predicted. If none is given, interactive file selector will pop out to prompt user to select images to be searched (Windows only)

multiview

logical. Turn on mode of combination of different views for prediction. see details

type

type of data to predict

method

classification method. see Note

har

numeric. optional. By default har range saved in the project is used. a different value could be set using this argument

pc

numeric. optional. By default pc range saved in the project is used. a different value could be set using this argument

threshold

numeric. optional. threshold value on posterior probalility to reject the prediction. see threcv. Currently works with lda only

reland

logical. whether to do automatic re-arrangement of landmark- configuration

tol

numeric. max limit of distance (see sprdist) to which the automatic re-arrangement of landmark configuration should be carried out

fix

numeric. for gpa method. index of landmarks that should stay fixed. default is NULL, i.e. all semi-landmarks are slid. see Note

mode

when ="search+pred", searching is included in addition to prediction using otosearch. automatically changed to "search+pred" when reland=TRUE

saveresult

logical. whether to save the result

search.plot

logical. whether to plot the search results. used only when reland = TRUE or mode = "search+pred"

...

other arguments passed to agglda

Details

The functions include the otosearch algorithm as a means to guess the semi-landmarks arragement (the four types of arrangements, see reland), so that the user can predict the new, unknown samples even if the side and the direction of the otoliths are unknown. This could be turned off using reland = FALSE to speed up the prediction if the side and direction of the query is known, and is already in the same arrangements as the dataset in project.

Combination of multiple views of otoliths for prediction can be used by setting multiview = TRUE. Under multiview mode, input of multiple project and query can be done by using list. For example, by setting project = list(medial = project_medial, anterior = project_anterior) and query = list(medial = query_medial, anterior = query_anterior). The names of list between project and query should match. Objects in the list for project should be projects created using saveproj. Objects in the list for query should be 3-dimensional array consist of the semi-landmark configurations(for gpa/ nef methods) or matrix containing the shape indices.

Value

matrix of prediction class and posterior probablity.

Note

Currently the method supported are limited to lda and agglda only.

Because sliding semi-landmark method is not supported by otosearch, thus the project used should contain gpa object from non-sliding GPA transformation. Sliding will be performed by otopred instead if gpa is the preferred method and fix = NULL.

See Also

Which this function wraps: otosearch

Methods of classifier: lda, plsda, tree, agglda


jinyung/otolith documentation built on May 19, 2019, 10:36 a.m.