Class KMedoidsImputer

java.lang.Object
smile.feature.imputation.KMedoidsImputer
All Implemented Interfaces:
Serializable, Function<smile.data.Tuple,smile.data.Tuple>, smile.data.transform.Transform

public class KMedoidsImputer extends Object implements 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
    Constructor
    Description
    KMedoidsImputer(CLARANS<smile.data.Tuple> kmedoids)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    smile.data.Tuple
    apply(smile.data.Tuple x)
     
    fit(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, wait

    Methods inherited from interface java.util.function.Function

    andThen, compose

    Methods inherited from interface smile.data.transform.Transform

    andThen, apply, compose
  • Constructor Details

    • KMedoidsImputer

      public KMedoidsImputer(CLARANS<smile.data.Tuple> kmedoids)
      Constructor.
      Parameters:
      kmedoids - the K-Medoids clustering.
  • Method Details

    • apply

      public smile.data.Tuple apply(smile.data.Tuple x)
      Specified by:
      apply in interface Function<smile.data.Tuple,smile.data.Tuple>
    • 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.