danielhomola / mifs

Parallelized Mutual Information based Feature Selection module.
BSD 3-Clause "New" or "Revised" License
289 stars 110 forks source link

Are you sure y is categorical? It has more than 5 levels. #10

Closed limited-root closed 7 years ago

limited-root commented 7 years ago

after i changed my OS from mint 17 to 18.1, i started getting this error. my framework using mutual information for feature selection in training dataset of malware analysis. i checked all dependencies for sklearn and all are satisfied with right version. i use sklearn 0.18.1 . i get like 11 MI, but then i get this: Indices of selected features : 29,32,333,360,18,25,330,0,317,31,24 Saved to disk file named Selected_features_indexes.csv in current folder Selected features. OK.......... Fetching relevant/selected features..................... Fetched relevant/selected features..................... /usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20. "This module will be removed in 0.20.", DeprecationWarning) Reading training data....Wait Read training data having dimestions =(4832, 12) Preprocessing and spliting data using cross valiation /usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py:429: DataConversionWarning: Data with input dtype int64 was converted to float64 by StandardScaler. warnings.warn(msg, _DataConversionWarning) Encoding class labels...................... ['Backdoor', 'CleanWare', 'DangerousObject', 'Email-Worm', 'Hoax', 'Net-Worm', 'Packed', 'Trojan', 'Trojan-Downloader', 'Trojan-Dropper', 'Trojan-FakeAV', 'Trojan-GameThief', 'Trojan-PSW', 'Trojan-Ransom', 'Trojan-Spy', 'Virus', 'Worm'] total no of classes in dataset=17 Training dataset has samples=(3381, 11) Test dataset has samples=(1450, 11) Training the MLP classifier.....wait Traceback (most recent call last): File "trainMLP.py", line 54, in my_mlp.MLP_classify( ) File "/home/android/Desktop/framework/TrainMLP ok/MLP_classify.py", line 81, in MLP_classify MLPclf = MLPClassifier(algorithm='sgd', alpha=1e-5, hidden_layer_sizes=(500,), random_state=1, learning_rate='adaptive', max_iter =2500, verbose=False) TypeError: init() got an unexpected keyword argument 'algorithm'

danielhomola commented 7 years ago

I don't know if this is related at all to MIFS.. can you be less verbose and more precise? what is your problem? can you provide a reproducible example where MIFS breaks?

paulperry commented 7 years ago

Maybe my problem is related. I get :

File "/Users/name/anaconda3/lib/python3.5/site-packages/mifs/mifs.py", line 314
    print 'Are you sure y is categorical? It has more than 5 levels.'

So it looks like the code is not python 3 compatible. FWIW

danielhomola commented 7 years ago

Yepp. There are two pull requests currently that you can clone and you'll have a version that works for P3.