public class ChiSqSelectorModel extends java.lang.Object implements VectorTransformer, Saveable
param: selectedFeatures list of indices to select (filter). Must be ordered asc
Constructor and Description |
---|
ChiSqSelectorModel(int[] selectedFeatures) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
formatVersion()
Current version of model save/load format.
|
protected boolean |
isSorted(int[] array) |
static ChiSqSelectorModel |
load(SparkContext sc,
java.lang.String path) |
void |
save(SparkContext sc,
java.lang.String path)
Save this model to the given path.
|
int[] |
selectedFeatures() |
Vector |
transform(Vector vector)
Applies transformation on a vector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transform, transform
public static ChiSqSelectorModel load(SparkContext sc, java.lang.String path)
public int[] selectedFeatures()
protected boolean isSorted(int[] array)
public Vector transform(Vector vector)
transform
in interface VectorTransformer
vector
- vector to be transformed.public void save(SparkContext sc, java.lang.String path)
Saveable
This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using Loader.load
.
protected java.lang.String formatVersion()
Saveable
formatVersion
in interface Saveable