Package org.apache.spark.mllib.feature
Class ChiSqSelectorModel
Object
org.apache.spark.mllib.feature.ChiSqSelectorModel
- All Implemented Interfaces:
Serializable
,VectorTransformer
,Saveable
,scala.Serializable
Chi Squared selector model.
param: selectedFeatures list of indices to select (filter).
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChiSqSelectorModel
load
(SparkContext sc, String path) void
save
(SparkContext sc, String path) Save this model to the given path.int[]
Applies transformation on a vector.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.spark.mllib.feature.VectorTransformer
transform, transform
-
Constructor Details
-
ChiSqSelectorModel
public ChiSqSelectorModel(int[] selectedFeatures)
-
-
Method Details
-
load
-
selectedFeatures
public int[] selectedFeatures() -
transform
Applies transformation on a vector.- Specified by:
transform
in interfaceVectorTransformer
- Parameters:
vector
- vector to be transformed.- Returns:
- transformed vector.
-
save
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
.
-