Skip to content
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

Question? #2

Closed
Njzjhd opened this issue Jan 22, 2021 · 18 comments
Closed

Question? #2

Njzjhd opened this issue Jan 22, 2021 · 18 comments

Comments

@Njzjhd
Copy link

Njzjhd commented Jan 22, 2021

Hi JingweiTOO,

Thank you for your hard works on Python version of the wrapper feature selection.
For feature selection, shouldn't cross-validation be added when the fitness function is calculated.
How should the fitness function change if for regression problems? I would like to give some hints or code.

@JingweiToo
Copy link
Owner

Hi,

The example is using holdout validation. If you want to use k-fold cross-validation, then you may change the code in fitness function. Also, you may change the fitness function for regression problem such as replace the KNN with logistic regression but also need to change the error to mean square error.

@Njzjhd
Copy link
Author

Njzjhd commented Jan 22, 2021 via email

@hanamthang
Copy link

Hi,

The example is using holdout validation. If you want to use k-fold cross-validation, then you may change the code in fitness function. Also, you may change the fitness function for regression problem such as replace the KNN with logistic regression but also need to change the error to mean square error.

The Logistic Regression you mentioned is only for binary problem, right?

Since error appear when I attempt to apply to continuous variables.

`in check_classification_targets(y)
167 if y_type not in ['binary', 'multiclass', 'multiclass-multioutput',
168 'multilabel-indicator', 'multilabel-sequences']:
--> 169 raise ValueError("Unknown label type: %r" % y_type)
170
171

ValueError: Unknown label type: 'continuous'`

Just want to confirm that your codes are not for continuous variable at the moment.

@JingweiToo
Copy link
Owner

Hi,

My bad, the logistic regression is applied for binary classification but not to the regression. You may refer to other regression algorithms such as support vector regression, decision tree regression and linear regression.

@kangwenhao
Copy link

How to select the feature of regression model with this toolbox

@JingweiToo
Copy link
Owner

JingweiToo commented Mar 10, 2021 via email

@Njzjhd
Copy link
Author

Njzjhd commented Mar 10, 2021 via email

@kangwenhao
Copy link

Can you be specific? I am changing pso.py Or demo_ PSO.py

@Njzjhd
Copy link
Author

Njzjhd commented Mar 10, 2021 via email

@Njzjhd
Copy link
Author

Njzjhd commented Mar 10, 2021 via email

@kangwenhao
Copy link

具体怎么改适应度函数了?在回归里那个 c是什么啊?

@kangwenhao
Copy link

进行回归时,您需要更改适应度函数并将分类器替换为回归模型。另外,将误差率替换为均方误差。

On Wed, Mar 10, 2021 at 3:44 PM kangwenhao @.***> wrote: How to select the feature of regression model with this toolbox — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHKG2G4NI2A7NNWUIEU57U3TC4PNTANCNFSM4WNZVHRA .
具体怎么改适应度函数了?在回归里那个c是什么啊?

@kangwenhao
Copy link

进行回归时,您需要更改适应度函数并将分类器替换为回归模型。另外,将误差率替换为均方误差。

On Wed, Mar 10, 2021 at 3:44 PM kangwenhao @.***> wrote: How to select the feature of regression model with this toolbox — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHKG2G4NI2A7NNWUIEU57U3TC4PNTANCNFSM4WNZVHRA .

How to change the fitness function? What is that in the return?

@Njzjhd
Copy link
Author

Njzjhd commented Mar 10, 2021 via email

@kangwenhao
Copy link

我想我知道您要怎么做。但是对于算法的实现,目前我主要使用python。Matlab对我来说太难了。------------------&nbsp;原始邮件&nbsp; ------------------发件人:“ JingweiToo / Wrapper -Feature-Selection-Toolbox-Python“ @.> ;; 发送时间:&nbsp; 2021年3月10日(星期三)下午4:04 @.> ;; *** @ *** @ &gt ;; 主题:Re:[JingweiToo / Wrapper-Feature-Selection-Toolbox-Python]有问题吗?(#2…在2021年3月10日,星期三,3:44 PM kangwenhao @。*** &gt; 写道:如何使用此工具箱选择回归模型的功能-之所以收到此评论,是因为您发表了评论。直接回复此电子邮件,在GitHub < #2(评论)&gt;上查看,或退订https://github.com/notifications/unsubscribe-auth/AHKG2G4NI2A7NNWUIEU57U3TC4PNTANCNFSM4WNZVHRA。如何更改健身功能?回报是什么?—您收到此消息是因为您创建了线程。直接回复此电子邮件,在GitHub上查看或取消订阅。

I use python, too。I need to do feature selection of regression model。But I am a cainiao, I will not change.

@Njzjhd
Copy link
Author

Njzjhd commented Mar 10, 2021 via email

@Njzjhd
Copy link
Author

Njzjhd commented Mar 10, 2021 via email

@fatima24-a
Copy link

Hi,
How can we check which features are selected because code just show selected features number. If we want to show which features are selected then how to show it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants