add new StringSimilarityEncoder transformer - #537
Conversation
Codecov Report
@@ Coverage Diff @@
## main #537 +/- ##
==========================================
+ Coverage 96.84% 96.88% +0.03%
==========================================
Files 89 89
Lines 3332 3400 +68
Branches 670 671 +1
==========================================
+ Hits 3227 3294 +67
Misses 45 45
- Partials 60 61 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Hi @glevv Thank you very much for the contributions and for taking the time to go through my questions. FYI: I made this PR to your repo: There a a few things that we need to look at: As it is, the encoder is failing one of feature-engine's general tests, because you can't add "" in fillna to a categorical variable (encoded as categorical, instead of object). The value "" needs to be added as a category first. See for example how we handle that here: feature_engine/feature_engine/imputation/categorical.py Lines 210 to 216 in 93cb37b The test This test: I do agree that this test might be a bit over the top. But would it be too hard to implement? |
I am not sure what your thoughts are, but I think this PR could be good to go after you merge. Let me know what you think Cheers |
I think for the first one there is an easy solution for SimilarityEncoder - cast column to str before value_counts and fillna. I was doing it in previous iterations but decided to go with the other approach. I can revert it, if it's needed. |
Similarity encoder
Update similarity_encoder.py
closes #530