numediart / Attention-EEG

MIT License
15 stars 6 forks source link

Cant get the reported result for random forest #17

Open aliosia opened 1 year ago

aliosia commented 1 year ago

Thanks for sharing the code and dataset, I couldn't find the random forest code in the repo, and I tried to train it myself but I couldn't get the accuracy reported in the paper:

RF/Frequential 51.12 / 3.83

RF/Temporal 60.87 / 3.51

My code is like:

participants = np.load('../data/PhyDAA/Dataset/participant.npy')  
labels = np.load('../data/PhyDAA/Dataset/Label.npy')  
freqfeature = np.load('../data/PhyDAA/Dataset/Array/freq_band.npy')  
tempfeature = np.load('../data/PhyDAA/Dataset/Array/hjorth.npy')  
feature = freqfeature.reshape(freqfeature.shape[0], -1)  
feature = tempfeature.reshape(tempfeature.shape[0], -1)  
logo = LeaveOneGroupOut()  
rf = RandomForestClassifier()  
accs = cross_val_score(rf, feature, labels, groups=participants, cv=logo)  
print(accs.mean(), accs.std())  

I get 49% and 53% instead of 51% and 60%. Do you have any idea? maybe setting wrong the RF parameters :? Also the deviations are much more than the reported ones.

aliosia commented 1 year ago

I have also tried using standard scaler and balanced accuracy but still I couldn't get the same result.