public class ChiSqTest
extends java.lang.Object
Vectors
, whereas test of independence is conducted
on an input of type Matrix
in which independence between columns is assessed.
We also provide a method for computing the chi-squared statistic between each feature and the
label for an input RDD[LabeledPoint]
, return an Array[ChiSquaredTestResult]
of size =
number of features in the input RDD.
Supported methods for goodness of fit: pearson
(default)
Supported methods for independence: pearson
(default)
More information on Chi-squared test: http://en.wikipedia.org/wiki/Chi-squared_test
Modifier and Type | Class and Description |
---|---|
static class |
ChiSqTest.Method
param: name String name for the method.
|
static class |
ChiSqTest.Method$ |
static class |
ChiSqTest.NullHypothesis$ |
Constructor and Description |
---|
ChiSqTest() |
Modifier and Type | Method and Description |
---|---|
static ChiSqTestResult |
chiSquared(Vector observed,
Vector expected,
java.lang.String methodName) |
static ChiSqTestResult[] |
chiSquaredFeatures(RDD<LabeledPoint> data,
java.lang.String methodName)
Conduct Pearson's independence test for each feature against the label across the input RDD.
|
static ChiSqTestResult |
chiSquaredMatrix(Matrix counts,
java.lang.String methodName) |
protected static void |
initializeLogIfNecessary(boolean isInterpreter) |
protected static boolean |
isTraceEnabled() |
protected static org.slf4j.Logger |
log() |
protected static void |
logDebug(scala.Function0<java.lang.String> msg) |
protected static void |
logDebug(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static void |
logError(scala.Function0<java.lang.String> msg) |
protected static void |
logError(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static void |
logInfo(scala.Function0<java.lang.String> msg) |
protected static void |
logInfo(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static java.lang.String |
logName() |
protected static void |
logTrace(scala.Function0<java.lang.String> msg) |
protected static void |
logTrace(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static void |
logWarning(scala.Function0<java.lang.String> msg) |
protected static void |
logWarning(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
static ChiSqTest.Method |
PEARSON() |
public static ChiSqTest.Method PEARSON()
public static ChiSqTestResult[] chiSquaredFeatures(RDD<LabeledPoint> data, java.lang.String methodName)
data
- (undocumented)methodName
- (undocumented)public static ChiSqTestResult chiSquared(Vector observed, Vector expected, java.lang.String methodName)
public static ChiSqTestResult chiSquaredMatrix(Matrix counts, java.lang.String methodName)
protected static java.lang.String logName()
protected static org.slf4j.Logger log()
protected static void logInfo(scala.Function0<java.lang.String> msg)
protected static void logDebug(scala.Function0<java.lang.String> msg)
protected static void logTrace(scala.Function0<java.lang.String> msg)
protected static void logWarning(scala.Function0<java.lang.String> msg)
protected static void logError(scala.Function0<java.lang.String> msg)
protected static void logInfo(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logDebug(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logTrace(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logWarning(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logError(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static boolean isTraceEnabled()
protected static void initializeLogIfNecessary(boolean isInterpreter)