Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

I am trying to plot a Multiple Correspondence Analysis Object Plot to fit the dataset to coordinates using PYTHON

$
0
0

Below is the Python code that keeps giving me an error:

AttributeError: 'MCA' object has no attribute 'plot_coordinates'

I have tried everything to get it corrected my final resolution is to come to StackOverflow for Help. Thanks

#import pandas as pdimport prince    X = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/balloons/adult+stretch.data')    X.columns = ['Color', 'Size', 'Action', 'Age', 'Inflated']    print(X.head())    mca = prince.MCA()    mca = mca.fit(X) # same as calling ca.fs_r(1)    mca1 = mca.transform(X) # same as calling ca.fs_r_sup(df_new) for *another* test set.    print(mca1)    ax = mca.plot_coordinates(         X=X,         ax=None,         figsize=(6, 6),         show_row_points=True,         row_points_size=10,         show_row_labels=False,         show_column_points=True,         column_points_size=30,         show_column_labels=False,         legend_n_cols=1         )    ax.get_figure().savefig('./mca_coordinates.svg')

Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>