label {Riemann} | R Documentation |
S3 method for mixture model : predict labels
Description
Given a fitted mixture model of K
components, predict labels of
observations accordingly.
Usage
label(object, newdata)
Arguments
object |
a fitted mixture model of |
newdata |
data of |
Value
a length-n
vector of class labels.
Examples
# ---------------------------------------------------- #
# FIT A MODEL & APPLY THE METHOD
# ---------------------------------------------------- #
# Load the 'city' data and wrap as 'riemobj'
data(cities)
locations = cities$cartesian
embed2 = array(0,c(60,2))
for (i in 1:60){
embed2[i,] = sphere.xyz2geo(locations[i,])
}
# Fit a model
k3 = moSN(locations, k=3)
# Evaluate
newlabel = label(k3, locations)
[Package Riemann version 0.1.4 Index]