OneHotEncoder constructor returning TypeError on fit function
See original GitHub issueThis one’s been dragging me through the mud. I just installed prince to make use of the MCA, but I consistently get the following error when calling the fit() function:
TypeError: __init__() got an unexpected keyword argument 'categories'
I’m pulling the example directly from the mca section of the README. I’ve tried manipulating one_hot.py directly, but nothing seems to yield any results. Here is the problematic snippet:
mca = prince.MCA(
n_components=2,
n_iter=3,
copy=True,
check_input=True,
engine='auto',
random_state=42
)
mca = mca.fit(test_df) # errors here
mca.fit()
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
sklearn.preprocessing.OneHotEncoder
This creates a binary column for each category and returns a sparse matrix or dense array (depending on the sparse_output parameter).
Read more >scikit learn - Issue with OneHotEncoder for categorical features
If you read the docs for OneHotEncoder you'll see the input for fit is "Input array of type int". So you need to...
Read more >OneHot/OrdinalEncoder categories broken for dtype='S' #19677
For OrdinalEncoder and OneHotEncoder, the fit(X) method fails if two ... TypeError: ufunc 'isnan' not supported for the input types.
Read more >Use ColumnTransformer in SciKit instead of LabelEncoding ...
As you can see from the snippet above, we'll name the transformer simply “encoder.” We're using the OneHotEncoder() constructor to provide a new...
Read more >How to Fix FutureWarning Messages in scikit-learn
Most functions available in the scikit-learn API have one or more arguments that let you customize the behavior of the function.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Getting the following error, even when I installed
0.6.3releaseTypeError: SparseDataFrame() takes no argumentsHello! Try installing version
0.6.3. I’m actually going to delete releases0.6.4and0.6.5and upload a new version with some fixes.