EpistasisLab / EpistasisLab/scikit-rebate

TuRF value error

Open
#52 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
420
Forks
72
Avg merge
3m
Merged PRs (30d)
3

Description

Hello,

I am currently trying to use TuRF to get my feature importance scores, and my code is almost the same as the example code in the docs:

```
from skrebate.turf import TuRF

# Take x & y from dataframes
X = x.values
Y = y.values

# Take feature names as header
header = x.columns

# Implement TuRF with ReliefF as algorithm
tf = TuRF(core_algorithm="ReliefF", n_features_to_select=2, pct=0.5,verbose=True)
tf.fit(X, Y, header)

# Output

Created distance array in 0.03900003433227539 seconds.
Feature scoring under way ...
Completed scoring in 12.943000078201294 seconds.
Created distance array in 0.02700018882751465 seconds.
Feature scoring under way ...
Completed scoring in 6.190999984741211 seconds.
Created distance array in 0.004999876022338867 seconds.
Feature scoring under way ...
Completed scoring in 3.2160000801086426 seconds.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
1 tf = TuRF(core_algorithm="ReliefF", n_features_to_select=2, pct=0.5,verbose=True)
----> 2 tf.fit(X, Y, header)

C:\ProgramData\Anaconda3\lib\site-packages\skrebate\turf.py in fit(self, X, y, headers)
164 self.feature_importances_.append(low_score - reduction * self._lost[i]) #append discounted score as a marker of when the feature was removed.
165 else: #Feature made final cut
--> 166 score_index = self.headers.index(i)
167 self.feature_importances_.append(core_fit.feature_importances_[score_index])
168

ValueError: 'mean_surface_score' is not in list
```

A very odd error in my opinion since I am certain all feature names are in the header. Anyone knows the solution to this error? Unfortunately i cannot supply my data but it is just a dataframe with about 150 samples, a certain number of features as columns and one column with the labels (X does not contain this column).

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.