【问题标题】:Multiple Correspondence Analysis Using Prince in Python - Cannot Get Library to Run在 Python 中使用 Prince 进行多重对应分析 - 无法让库运行
【发布时间】:2021-05-04 18:22:38
【问题描述】:

我一直在尝试使用 Python 中的 Prince 包来执行多重对应分析。我在网上看到有人在使用这个包时遇到了困难,但我遇到的错误与 Stack Overflow 上的其他帖子不同。

我正在使用 Anaconda。请参阅下面的所有计算机程序规范

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)

当我这样做时,我得到了错误

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

Python:3.8.5

Ipython:7.19.0

jupyter 核心:4.6.3

jupyter 笔记本:6.1.4

qtconsole:4.7.7

ipython:7.19.0

ipykernel:5.3.4

jupyter 客户端:6.1.7

jupyter 实验室:2.2.6

nbconvert : 6.0.7

ipywidgets:7.5.1

nb 格式:5.0.8

特质:5.0.5

谁能提供有关如何在 Python 中执行 MCA 的建议?

如有任何帮助,我将不胜感激。我也尝试过 mca 包,但无济于事。我的最终目标是创建一个 MCA 情节。感谢您的时间和帮助。

【问题讨论】:

    标签: python mca


    【解决方案1】:

    n_iter 不是定义的参数。

    来自https://github.com/kormilitzin/Prince/blob/master/prince/pca.py 的完整文档

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-17
      • 1970-01-01
      • 1970-01-01
      • 2016-04-23
      • 2021-11-24
      • 2021-10-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多