SHARE
TWEET

Untitled

a guest Oct 21st, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2. import numpy as np
  3. import pprint as pp
  4. from scipy.stats import kstest
  5.  
  6. results_dic = {}
  7.  
  8. features = np.loadtxt('inne.txt', dtype=float, delimiter="  ")
  9. df = pd.DataFrame(features)
  10. #print(df)
  11. #print(df.shape)
  12.  
  13. class1 = np.loadtxt('klasa.txt', dtype=float)
  14. #class_df = pd.DataFrame(class1)
  15. #print(class1)
  16.  
  17. for feature, values in df.iteritems():
  18.     result = kstest(feature, class1)
  19.     results_dic[feature] = result
  20.  
  21. ranking = sorted([(feature, result) for feature, result in results_dic.items()], key = lambda z: z[1][0], reverse = True)
  22. pp.pprint(ranking)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top