Incompatibility between SynthCity and scikit_learn 1.4? With workaround and possible fix. #248
MarkJacksonRG
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I think there's an incompatibility between
synthcity
and the new 1.4 version ofscikit_learn
? I've added this as an issue too #249Problem
I tried running the 'load and run a tabular generator' bit from the docs and got an error.
OneHotEncoder.__init__() got an unexpected keyword 'sparse'
Click to view screenshot of code and error:
The OneHotEncoder docs say
sparse
was renamed tosparse_output
. The new parameter was introduced inscikit_learn
1.2 and the old one removed inscikit_learn
1.4.Workaround:
I fixed my local installation by downgrading scikit_learn to 1.3.2.
pip install --upgrade scikit_learn==1.3.2
Possible fix?
I checked the stack trace and I think it might be possible to fix it with a one-line change. I haven't actually tried it! I'm not setup as a contributor.
Change
sparse
tosparse_output
in line 63 intabular_encoder.py
: I.e. this linecat_encoder_params: dict = dict(handle_unknown="ignore", sparse=False)
I thought I would flag it here in case it's something the community want to fix. I think you'd need to require scikit_learn 1.2 and greater.
Thanks for the great library!
Beta Was this translation helpful? Give feedback.
All reactions