EMNearestMeanClassifierSSLR: General Interface for EMNearestMeanClassifier model In SSLR: Semi-Supervised Classification, Regression and Clustering Methods

Description

model from RSSL package Semi-Supervised Nearest Mean Classifier using Expectation Maximization

Expectation Maximization applied to the nearest mean classifier assuming Gaussian classes with a spherical covariance matrix.

Starting from the supervised solution, uses the Expectation Maximization algorithm (see Dempster et al. (1977)) to iteratively update the means and shared covariance of the classes (Maximization step) and updates the responsibilities for the unlabeled objects (Expectation step).

Usage

 1 EMNearestMeanClassifierSSLR(method = "EM", scale = FALSE, eps = 1e-04)

Arguments

 method character; Currently only "EM" scale Should the features be normalized? (default: FALSE) eps Stopping criterion for the maximinimization

References

Dempster, A., Laird, N. & Rubin, D., 1977. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society. Series B, 39(1), pp.1-38.

Examples

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 library(tidyverse) library(tidymodels) library(caret) library(SSLR) data(breast) set.seed(1) train.index <- createDataPartition(breast\$Class, p = .7, list = FALSE) train <- train.index,] test <- -train.index,] cls <- which(colnames(breast) == "Class") #% LABELED labeled.index <- createDataPartition(breast\$Class, p = .2, list = FALSE) train[-labeled.index,cls] <- NA m <- EMNearestMeanClassifierSSLR() %>% fit(Class ~ ., data = train) #Accesing model from RSSL model <- m\$model #Accuracy predict(m,test) %>% bind_cols(test) %>% metrics(truth = "Class", estimate = .pred_class)

SSLR documentation built on July 22, 2021, 9:08 a.m.