# Getting wrong ch2 values from sklearn chi2

I have a feature vector table which looks like this- This a table with 156 columns or features.I want to apply feature selection algorithm to this before applyinh my classification model.

This is what I am using-

dataset = pd.read_csv('.csv')
X = dataset.iloc[:, 1:157].values
y = dataset.iloc[:,0].values

##normalize

scaler = MinMaxScaler()
scaler.fit(X)
MinMaxScaler(copy=True, feature_range=(0, 1))

X_normalized = scaler.transform(X)

##feature selection

sel = SelectKBest(chi2, k='all')

sel.fit_transform(X_normalized, y)

print(sel.scores_)


this is the result of print(sel.scores_) I am getting- As can be seen they are not all between 0 and 1.

I a referring this research paper as my source-  I don't know what is your source that said that value of chi-square should be between 0 and 1. Imagine as in that equation in the picture say two terms t and c always co-occur, meaning D(t|~c)=0 (number of documents with no c but t in them) and D(c|~t)=0 (number of documents with c in them but no t). This means the equation in the snap reduces down to
$\chi^2(t, c) = N*(AD)^2/A^2D^2 = N$.
After reading your comment, I understood you are confused regarding the 'normalised' part. A normalised value does not always mean a scaled value between 0 and 1. Normalised value does mean a value that is scaled appropriately for comparing and in my opinion, the denominator gives that comparable effect. The type of normalisation that you are associating this situation to is feature scaling. Check out normalization.
• I am still unable to find the part in the paper where it mentions that the value should be less than 1. Can you point me to it? Jun 10 '18 at 13:27