Skip to content

Conversation

@Top1Miami
Copy link
Contributor

@Top1Miami Top1Miami commented Jan 8, 2021

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.

  • New method (set a link to paper then)
  • This change requires a documentation update

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@Top1Miami Top1Miami changed the title Develop Weighted EVREG feature selection algorithm Jan 8, 2021
@LastShekel LastShekel changed the base branch from master to develop January 9, 2021 11:08
@LastShekel LastShekel self-requested a review January 10, 2021 18:48

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anova?

Copy link
Contributor Author

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):
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

@LastShekel LastShekel left a 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):
Copy link
Collaborator

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)
Copy link
Collaborator

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_)
Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

2 participants