Description Usage Arguments Details Value Note See Also Examples
Fits a Von Neumann entropy penalized distance metric learning model.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
(required if no formula is given as the principal argument.) a matrix or data frame or Matrix containing the explanatory variables. |
... |
arguments passed to or from other methods. |
formula |
A formula of the form |
data |
Data frame from which variables specified in |
grouping |
(required if no formula principal argument is given.) a factor specifying the class for each observation. |
prior |
the prior probabilities of class membership. If unspecified, the class proportions for the training set are used. If present, the probabilities should be specified in the order of the factor levels. |
tol |
A tolerance to decide if a matrix is singular; it will be used to modify
the scatter matrices by stabilizing eignevalues less that |
subset |
An index vector specifying the cases to be used in the training sample. (NOTE: If given, this argument must be named.) |
na.action |
A function to specify the action to be taken if |
The function fits a Von Neumann Entropy penalized distance metric learning problem to identify informative features and directions of maximam dissimilarity in the multi class case. The method automatically finds the optimal value of the entropy tuning parameter by maximizing the Fisher Information. The method can be used for sinlge class case to identify informative directions as well as multi class case to identiy directions of maximum dissimilarity. In the multi class case, optimal solution is an optimally scaled lda for maximum separability between classes that can results in more accurate classification. These direction are refered to as FENN directions.
Specifying the prior
will affect the classification unless over-ridden in predict.fenn
.
An object of class "fenn"
containing the following components:
prior |
The prior probabilities used. |
counts |
The group counts. |
means |
The group means. |
X.S |
The matrix of projections into similarity directions. Same as average within class covariance matrices. |
X.D |
The matrix of projections into dissimilarity directions. Same as |
X_D_neg_1_2 |
The matrix |
S_1_2 |
The learned optimal transformation that should be applied to tilde transformed data points. |
X_tilde_S |
The hamiltonian generated from data points. |
informative.dims |
The index of informative directions in the optimal space. Can be used for dimension reduction. |
muVec |
The automatically selected path of |
best.mu |
The the optimal (temperature) parameter obtained by maximizing Fisher Information. |
E |
The average Energy for an automatically selected path of |
dE |
The Fisher Information of |
scaling |
The weights (eigenvalues) of maximum dissimilarity directions (eigenvectors of |
x.tilde |
The tilde transformed data. |
x.fenn |
The |
N |
The number of observations used. |
groupings |
The class variable of original data points. |
call |
The (matched) function call. |
This function may be called giving either a formula and optional data frame, or a matrix and
grouping factor as the first two arguments. All other arguments are optional, but subset=
and
na.action=
, if required, must be fully named.
If a formula is given as the principal argument the object may be modified using update()
in
the usual way.
1 2 3 4 5 6 7 8 9 10 11 12 13 | Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]),
Sp = rep(c("s","c","v"), rep(50,3)))
train <- sample(1:150, 75)
table(Iris$Sp[train])
## your answer may differ
## c s v
## 22 23 30
z <- fenn(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train)
predict(z, Iris[-train, ])$class
## [1] s s s s s s s s s s s s s s s s s s s s s s s s s s s c c c
## [31] c c c c c c c v c c c c v c c c c c c c c c c c c v v v v v
## [61] v v v v v v v v v v v v v v v
(z1 <- update(z, . ~ . - Petal.W.))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.