Conversation
LastShekel
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
It is better to use this mean function as parameter
No description provided.