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

Inverse Distance weighting question #50

Open
RazinReaz opened this issue Sep 29, 2024 · 0 comments
Open

Inverse Distance weighting question #50

RazinReaz opened this issue Sep 29, 2024 · 0 comments

Comments

@RazinReaz
Copy link

Hello,I assume the function over_sampling() of file over_sampling.py is the main logic behind SMOGN. I have an issue with the code

I am reimplementing the code for numpy arrays. When I noticed a problem.

In the smoteR section (line 259 to 310: if neigh in safe_list), while you are calculating the synthetic target value y (line 281 to 306).
there is this code here:

## generate synthetic y response variable by
## inverse distance weighted
 for z in feat_list_num:
        a= abs(data.iloc[i, z] - synth_matrix[i * x_synth + j, z]) / feat_ranges[z]
        b = abs(data.iloc[knn_matrix[i, neigh], z] - synth_matrix[i * x_synth + j, z]) / feat_ranges[z]

You are overwriting the a and b values if I am not mistaken. By my understanding, this will calculate the a,b values of the final numerical feature only.

these two weight values are then used to calculate the target y using sum(weight * data) / sum(weight).
As I understand it, the weights a and b should be a single valued variable. So, your code works. But as I see it, the weights are from only the final feature.

Please let me find the error in the argument I presented. I will be glad. Thank you.

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

1 participant