-
Notifications
You must be signed in to change notification settings - Fork 38
Weighted EVREG feature selection algorithm #39
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
base: develop
Are you sure you want to change the base?
Conversation
|
|
||
| def weighted_evidential_regression(X, y, alpha=0.01, num_epochs=1000, p=2, k=None, radius=5.0): | ||
| """ | ||
| Calculates anova measure for each feature. |
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.
Anova?
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.
Fixed
| np.sum([__y_derivative(X, i, weights, p, radius, y) for i in range(X.shape[0])], axis=0) | ||
|
|
||
|
|
||
| def weighted_evidential_regression(X, y, alpha=0.01, num_epochs=1000, p=2, k=None, radius=5.0): |
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.
Does it a filter algorithm?
Not embedded one?
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.
Yes it is more of an embedded method, but it fits better the pipeline of univariate filter, as it needs cutting rule and provides feature metric that can be used as a rank.
� Conflicts: � ITMO_FS/filters/univariate/__init__.py
LastShekel
left a comment
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.
Delete pandas from requirements
| return sum(abs((first - second) * weights) ** p) ** (1.0 / p) | ||
|
|
||
|
|
||
| def __rbf(distance, radius): |
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.
Its probably better to put these functions into utils or somewhere
| self.k = int(0.1 * X.shape[0]) | ||
| if self.k < 1: | ||
| self.k = X.shape[0] - 1 | ||
| print(self.k) |
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 go to log or get deleted
| >>> y = np.array([1, 2, 3, 4, 5], dtype=np.integer) | ||
| >>> weighted_ev_reg = WeightedEvReg(cutting_rule=('K best', 2), num_epochs=100) | ||
| >>> weighted_ev_reg.fit(X, y) | ||
| >>> print(weighted_ev_reg.selected_features_) |
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.
do not print this
and check this test with pytest
Pull Request Template
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests or set link to that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Just a basic run unit test - test_weighted_evreg in univariate_filter_test.
Checklist: