def kolmogorov_smirnov_normality_test(X,y):
"""
Performs the one sample Kolmogorov-Smirnov test, testing wheter the feature values of each class are drawn from a normal distribution
Keyword arguments:
X -- The feature vectors
y -- The target vector
"""
kolmogorov_smirnov={}
# print kolmogorov_smirnov
for feature_col in xrange(len(X[0])):
kolmogorov_smirnov[feature_col]=values=[]
for class_index in xrange(2):
values.append(stats.kstest(X[y==class_index,feature_col], 'norm'))
#debug
for f in xrange(23):
print kolmogorov_smirnov[f]
return kolmogorov_smirnov
feature_selection.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录