1 year ago

#377454

test-img

Des0lat0r

Spark Java: How can we access the p Values in UnivariateFeatureSelector

I am using Spark 3.1.3 and I am trying to take the pValues from the result dataframe of UnivariateFeatureSelector.

UnivariateFeatureSelector selector = new UnivariateFeatureSelector()
            .setFeatureType("continuous")
            .setLabelType("categorical")
            .setSelectionMode("fdr")
            .setSelectionThreshold(0.25)
            .setFeaturesCol("inten")
            .setLabelCol("group")
            .setOutputCol("selfeat");

UnivariateFeatureSelectorModel ufsmodel = selector.fit(expaftervector);
Dataset<Row> result = ufsmodel.transform(expaftervector);

I checked the methods it offers but I can only get the indices of the selected features.

System.out.println("Selected Features");
System.out.println(Arrays.toString(ufsmodel.selectedFeatures()));

Is there any way I can get the pValues of the selected features?

java

dataframe

apache-spark-mllib

anova

p-value

0 Answers

Your Answer

Accepted video resources