Search code examples
pythondata-sciencepca

Prince "FAMD object has no attribute 'plot_row_coordinates'"


As far as I can tell, this is the same implementation as every example of this function that I could find. Calling famd.plot_row_coordinates() produces: 'FAMD' object has no attribute 'plot_row_coordinates'. The prior lines run fine.

#FAMD
famd = FAMD(n_components = 10, n_iter = 3, random_state = 101)
famd.fit(df.drop('Target', axis=1)) #leave out response variable 'Target'
famd.eigenvalues_summary

#plot components
famd.transform(df)
famd.plot_row_coordinates(
    df.head(200),
    figsize = (15,10),
    color_labels=['Completion status: {}'.format(t) for t in df['Target']]
)

Solution

  • The 'plot_row_coordinates' function got removed from the package on 22nd of February. You should now either use 'famd.plot' function or plot coordinates yourself, with code looking something like this:

    coordinates = famd.row_coordinates(X)
    x = coordinates[0].astype(np.float)
    y = coordinates[1].astype(np.float)
    plt.plot(x,y)