Multiple Correspondence Analysis Using Prince in Python - Cannot Get Library to Run

1.1k views Asked by At

I have been trying to use the prince package in Python to perform Multiple Correspondence Analysis. I read online that individuals are having difficulty using this package but I am running into a different error than the other posts on Stack Overflow.

I am using Anaconda. Please see below for all computer program specifications

import prince
pca = prince.PCA(n_components=2,n_iter=3,rescale_with_mean=True,
             rescale_with_std=True,copy=True,check_input=True,engine='auto',
             random_state=42)

When I do this, I get the error

  TypeError: __init__() got an unexpected keyword argument 'n_iter'

Python: 3.8.5

Ipython: 7.19.0

jupyter core : 4.6.3

jupyter-notebook : 6.1.4

qtconsole : 4.7.7

ipython : 7.19.0

ipykernel : 5.3.4

jupyter client : 6.1.7

jupyter lab : 2.2.6

nbconvert : 6.0.7

ipywidgets : 7.5.1

nbformat : 5.0.8

traitlets : 5.0.5

Can anyone offer suggestions on how to perform MCA in Python?

I would appreciate any assistance. I have also tried the mca package but to no avail. My ultimate goal is to create an MCA plot. Thank you for your time and assistance.

1

There are 1 answers

0
Kelly Brower On BEST ANSWER

n_iter is not a defined parameter.

From https://github.com/kormilitzin/Prince/blob/master/prince/pca.py for the full documentation

def __init__(self, dataframe, n_components=2, scaled=True, supplementary_rows=None,
                 supplementary_columns=None, plotter='mpl'):