question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OneHotEncoder constructor returning TypeError on fit function

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ankur-chouragadecommented, Mar 2, 2020

Getting the following error, even when I installed 0.6.3 release TypeError: SparseDataFrame() takes no arguments

1reaction
MaxHalfordcommented, Jan 15, 2020

Hello! Try installing version 0.6.3. I’m actually going to delete releases 0.6.4 and 0.6.5 and upload a new version with some fixes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found