# Return to Question

2 keyword spelling, title clarification

# Does Chi squared test When used for feature selection, does the chi-squared test require the features to be nonnegative?

sciki learnscikit-learn says chi squared test used for feature selection in classification problems and implemented by sklearn.feature_selection.chi2 requires the feature which it tests with the outcome to be nonnegative.

As I understand from Wikipedia, the chi squared independence test test independence between two discrete random variables with finite ranges from their joint samples. So the random variables can be categorical, positive, or nonnegative, as long as they are discrete and have finite ranges, i.e. we can create a contingency table from their joint samples.

So what features can the chi squared feature selection in sciki learnscikit-learn apply to?

Thanks.

# Does Chi squared test used for feature selection require the features to be nonnegative?

sciki learn says chi squared test used for feature selection in classification problems and implemented by sklearn.feature_selection.chi2 requires the feature which it tests with the outcome to be nonnegative.

As I understand from Wikipedia, the chi squared independence test test independence between two discrete random variables with finite ranges from their joint samples. So the random variables can be categorical, positive, or nonnegative, as long as they are discrete and have finite ranges, i.e. we can create a contingency table from their joint samples.

So what features can the chi squared feature selection in sciki learn apply to?

Thanks.

# When used for feature selection, does the chi-squared test require the features to be nonnegative?

scikit-learn says chi squared test used for feature selection in classification problems and implemented by sklearn.feature_selection.chi2 requires the feature which it tests with the outcome to be nonnegative.

As I understand from Wikipedia, the chi squared independence test test independence between two discrete random variables with finite ranges from their joint samples. So the random variables can be categorical, positive, or nonnegative, as long as they are discrete and have finite ranges, i.e. we can create a contingency table from their joint samples.

So what features can the chi squared feature selection in scikit-learn apply to?

Thanks.

1

# Does Chi squared test used for feature selection require the features to be nonnegative?

sciki learn says chi squared test used for feature selection in classification problems and implemented by sklearn.feature_selection.chi2 requires the feature which it tests with the outcome to be nonnegative.

As I understand from Wikipedia, the chi squared independence test test independence between two discrete random variables with finite ranges from their joint samples. So the random variables can be categorical, positive, or nonnegative, as long as they are discrete and have finite ranges, i.e. we can create a contingency table from their joint samples.

So what features can the chi squared feature selection in sciki learn apply to?

Thanks.