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 pd
import 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')
0

There are 0 answers