June 2018
Intermediate to advanced
276 pages
6h 26m
English
Chi-square is used to determine if a subset data matches a population. The values should be in categories. In other words, the chi-square test is used to check the correlations and associations between the different categories or classes.
The formula for the chi-square test is as follows:

The following is an example of chi-square using scikit-learn, delivered by Jason Brownlee, PhD:
import pandasimport numpyfrom sklearn.feature_selection import SelectKBestfrom sklearn.feature_selection import chi2# load dataurl = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv"names = ['preg', 'plas', ...
Read now
Unlock full access