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

[FEATURE]: Mahalanobis Distance Kennard-Stone (MDKS) Sampler #129

Closed
JacksonBurns opened this issue Jun 9, 2023 · 2 comments · Fixed by #149
Closed

[FEATURE]: Mahalanobis Distance Kennard-Stone (MDKS) Sampler #129

JacksonBurns opened this issue Jun 9, 2023 · 2 comments · Fixed by #149
Labels
enhancement New feature or request

Comments

@JacksonBurns
Copy link
Owner

Is your feature request related to a problem? Please describe.

Better interpolative splits for Artificial Neural Networks in particular with Mahalanobis Distance Kennard-Stone here.

Use-cases/examples of this new feature

See linked paper for specific examples, but is reported to generally provide data splits for ANN applications.

Desired solution/workflow

Using the base implementation of the Kennard-Stone sampler, implement this.

Discussion

Unforunately without re-writing the Mahalanobis distance method to accept pre-computed pairwise distances this method will scale at least O(n^3)

@JacksonBurns JacksonBurns added the enhancement New feature or request label Jun 9, 2023
@JacksonBurns
Copy link
Owner Author

This can actually be achieved with something like this:

_, _, _, indexes_train, indexes_val, indexes_test = train_val_test_split(
    responses,
    train_size=0.8,
    val_size=0.1,
    test_size=0.1,
    sampler="kennard_stone",
    random_state=42,
    hopts={"metric": "mahalanobis"},
    return_indices=True,
)

...and it's not terribly slow.

@JacksonBurns
Copy link
Owner Author

I have confirmed that the Mahalanobis distance is working as intended, although the example above should use sampler="spxy" since (despite the name) MDKS is derived from SPXY (which is itself derived from Kennard Stone). We can just add a row in the README samplers table saying that you can achieve this sampling using SPXY.

kspieks added a commit that referenced this issue Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant