Learn R Programming

evclust (version 2.0.3)

nnevclus_mb: NN-EVCLUS algorithm (minibatch version)

Description

nnevclus_mb computes a credal partition from a dissimilarity matrix using the NN-EVCLUS algorithm. Training is done using mini-batch gradient descent with the RMSprop optimization algorithm.

Usage

nnevclus_mb(
  x,
  foncD = function(x) as.matrix(dist(x)),
  c,
  type = "simple",
  n_H,
  nbatch = 10,
  alpha0 = 0.9,
  fhat = NULL,
  lambda = 0,
  y = NULL,
  Is = NULL,
  nu = 0,
  disp = TRUE,
  options = list(Niter = 1000, epsi = 0.001, rho = 0.9, delta = 1e-08, Dtmax = 100, print
    = 5),
  param0 = list(V0 = NULL, W0 = NULL, beta0 = NULL)
)

Value

The output credal partition (an object of class "credpart"). In addition to the usual attributes, the output credal partition has the following attributes:

Kmat

The matrix of degrees of conflict. Same size as D.

trace

Trace of the algorithm (values of the loss function).

param

The network parameters as a list with components V, W and beta.

Arguments

x

nxp matrix of p attributes observed for n objects.

foncD

A function to compute distances.

c

Number of clusters

type

Type of focal sets ("simple": empty set, singletons and Omega; "full": all \(2^c\) subsets of \(\Omega\); "pairs": \(\emptyset\), singletons, \(\Omega\), and all or selected pairs).

n_H

Size or the hidden layer.

nbatch

Number of mini-batches.

alpha0

Order of the quantile to normalize distances. Parameter d0 is set to the alpha0-quantile of distances. Default: 0.9.

fhat

Vector of outputs from a one-class SVM for novelty detection (optional)

lambda

Regularization coefficient (default: 0)

y

Optional vector of class labels for a subset of the training set (for semi-supervised learning).

Is

Vector of indices corresponding to y (for semi-supervised learning).

nu

Coefficient of the supervised error term (default: 0).

disp

If TRUE, intermediate results are displayed.

options

Parameters of the optimization algorithm (Niter: maximum number of iterations; epsi, rho, delta: parameters of RMSprop; Dtmax: the algorithm stops when the loss has not decreased in the last Dtmax iterations; print: number of iterations between two displays).

param0

Optional list of initial network parameters (see details).

#'

Author

Thierry Denoeux.

Details

This is a neural network version of kevclus. The neural net has one layer of ReLU units and a softmax output layer (see Denoeux, 2020). The network is trained in mini-batch mode using the RMSprop algorithm. The inputs are a feature vector x, an optional distance matrix D, and an optional vector of one-class SVM outputs fhat, which is used for novelty detection. Part of the output belief mass is transfered to the empty set based on beta[1]+beta[2]*fhat, where beta is an additional parameter vector. The network can be trained in fully unsupervised mode or in semi-supervised mode (with class labels for a subset of the learning instances). The output is a credal partition (a "credpart" object), with a specific field containing the network parameters (U, V, W, beta).

References

T. Denoeux. NN-EVCLUS: Neural Network-based Evidential Clustering. Information Sciences, Vol. 572, Pages 297-330, 2021.

See Also

nnevclus, predict.credpart, kevclus, kcevclus, harris

Examples

Run this code
if (FALSE) {
## Unsupervised learning
data(fourclass)
x<-scale(fourclass[,1:2])
y<-fourclass[,3]
svmfit<-ksvm(~.,data=x,type="one-svc",kernel="rbfdot",nu=0.2,kpar=list(sigma=0.2))
fhat<-predict(svmfit,newdata=x,type="decision")
clus<-nnevclus_mb(x,foncD=function(x) as.matrix(dist(x)),c=4,type='pairs',
n_H=10,nbatch=10,alpha0=0.9,fhat=fhat)
plot(clus,x)
## semi-supervised learning
Is<-sample(400,100)
clus<-nnevclus_mb(x,foncD=function(x) as.matrix(dist(x)),c=4,type='pairs',
n_H=10,nbatch=10,alpha0=0.9,fhat=fhat,lambda=0, y=y[Is],Is=Is,nu=0.5)
plot(clus,x)
}

Run the code above in your browser using DataLab