Package smile.feature.imputation
Class KMedoidsImputer
java.lang.Object
smile.feature.imputation.KMedoidsImputer
- All Implemented Interfaces:
Serializable,Function<smile.data.Tuple,,smile.data.Tuple> smile.data.transform.Transform
Missing value imputation by K-Medoids clustering. The k-medoids algorithm
is an adaptation of the k-means algorithm. Rather than calculate the mean
of the items in each cluster, a representative item, or medoid, is chosen
for each cluster at each iteration. The missing values of an instance are
replaced the corresponding ones of the nearest medoid.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsmile.data.Tupleapply(smile.data.Tuple x) static KMedoidsImputerfit(smile.data.DataFrame data, smile.math.distance.Distance<smile.data.Tuple> distance, int k) Fits the missing value imputation values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface smile.data.transform.Transform
andThen, apply, compose
-
Constructor Details
-
KMedoidsImputer
Constructor.- Parameters:
kmedoids- the K-Medoids clustering.
-
-
Method Details
-
apply
public smile.data.Tuple apply(smile.data.Tuple x) -
fit
public static KMedoidsImputer fit(smile.data.DataFrame data, smile.math.distance.Distance<smile.data.Tuple> distance, int k) Fits the missing value imputation values.- Parameters:
data- the training data.k- the number of clusters.distance- the lambda of distance measure.- Returns:
- the imputer.
-