-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hybrid-Recursive Feature Elimination #47
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
Thank you for your interest in our project. We glad that you found the RFE hybrid method which is not implemented yet.
Here I left some comments on your code and, kindly ask you to write tests to it.
Thank you)
ITMO_FS/hybrid/hybrid_rfe.py
Outdated
for f in features[:int(len(Xij) / 2)]: | ||
Xk[-1].append(Xij[f]) | ||
|
||
svm = SVC(kernel='linear') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you start to initialise some models, but you should set them as parameter (list of models, for example) and add it as a parameter into the init function.
ITMO_FS/hybrid/hybrid_rfe.py
Outdated
from sklearn.ensemble import GradientBoostingClassifier | ||
|
||
|
||
def hybrid_rfe(X_input, y_input, m=None, weighted=True, k=5, feature_names=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are creating a hybrid RFE you should create it as class
ITMO_FS/hybrid/hybrid_rfe.py
Outdated
features_best = features | ||
|
||
X_result = [] | ||
for Xi in X_input: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be done via list comprehension (https://www.w3schools.com/python/python_lists_comprehension.asp)
ITMO_FS/hybrid/hybrid_rfe.py
Outdated
svm.fit(Xk, yk) | ||
rf.fit(Xk, yk) | ||
gbm.fit(Xk, yk) | ||
score = (svm.score(Xk, yk) + rf.score(Xk, yk) + gbm.score(Xk, yk)) / 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use this mean function as parameter
No description provided.