# How to find the chi square value of all features

I have extracted a set of features for a classification task and I used the SVM classifier. How can I find the top k predictive features and their discriminative power (chi square) value?

Here is a tutorial on the website of scikit-learn that shows you how to compute chi².

Copying from the mentioned website:

>>> from sklearn.datasets import load_iris
>>> from sklearn.feature_selection import SelectKBest
>>> from sklearn.feature_selection import chi2