Class ChiSqSelectorModel

Object
org.apache.spark.mllib.feature.ChiSqSelectorModel
All Implemented Interfaces:
Serializable, VectorTransformer, Saveable, scala.Serializable

public class ChiSqSelectorModel extends Object implements VectorTransformer, Saveable
Chi Squared selector model.

param: selectedFeatures list of indices to select (filter).

See Also:
  • Constructor Details

    • ChiSqSelectorModel

      public ChiSqSelectorModel(int[] selectedFeatures)
  • Method Details

    • load

      public static ChiSqSelectorModel load(SparkContext sc, String path)
    • selectedFeatures

      public int[] selectedFeatures()
    • transform

      public Vector transform(Vector vector)
      Applies transformation on a vector.

      Specified by:
      transform in interface VectorTransformer
      Parameters:
      vector - vector to be transformed.
      Returns:
      transformed vector.
    • save

      public void save(SparkContext sc, String path)
      Description copied from interface: Saveable
      Save this model to the given path.

      This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/

      The model may be loaded using Loader.load.

      Specified by:
      save in interface Saveable
      Parameters:
      sc - Spark context used to save model data.
      path - Path specifying the directory in which to save this model. If the directory already exists, this method throws an exception.