train.lda: train.lda

View source: R/train.R

train.ldaR Documentation

train.lda

Description

Provides a wrapping function for the lda.

Usage

train.lda(formula, data, ..., subset, na.action)

Arguments

formula

A formula of the form groups ~ x1 + x2 + ... That is, the response is the grouping factor and the right hand side specifies the (non-factor) discriminators.

data

An optional data frame, list or environment from which variables specified in formula are preferentially to be taken.

...

Arguments passed to or from other methods.

subset

An index vector specifying the cases to be used in the training sample. (NOTE: If given, this argument must be named.)

na.action

Function to specify the action to be taken if NAs are found. The default action is for the procedure to fail. An alternative is na.omit, which leads to rejection of cases with missing values on any required variable. (NOTE: If given, this argument must be named.)

Value

A object lda.prmdt with additional information to the model that allows to homogenize the results.

Note

The parameter information was taken from the original function lda.

See Also

The internal function is from package lda.

Examples


len <- nrow(iris)
sampl <- sample(x = 1:len,size = len*0.20,replace = FALSE)
ttesting <- iris[sampl,]
ttraining <- iris[-sampl,]
model.lda <- train.lda(Species~.,ttraining)
model.lda
prediction <- predict(model.lda,ttesting)
prediction


traineR documentation built on Nov. 10, 2023, 1:15 a.m.

Related to train.lda in traineR...