In [9]:
import json
import numpy as np
import os, sys
sys.path.append('../classification')
import classify_nested
from sklearn.feature_selection import f_classif
from sklearn.feature_selection import SelectKBest
In [8]:
X = np.random.randn(40).reshape(10,4)
y = np.array([np.random.random_integers(2)-1 for i in range(10)])
print(X)
print(y)
print(classify_nested.customScore(X,y))
print(f_classif(X,y))
In [ ]:
selector = SelectKBest(k=2)
selector.fit