I'm using the package Prince to perform a FAMD on data that consists of mixed data (so both categorical and non-categorical).
My code is the following:
famd = prince.FAMD(n_components=10, n_iter=3, copy=True, check_input=True, engine='auto', random_state=42)
famd = famd.fit(df_pca)
Which gives as output
Explained inertia
[0.08057161 0.05946225 0.03875787 0.03203083 0.02978785 0.02868602
0.02499968 0.02416245 0.02207422 0.02055546]
I have already tried df = pd.DataFrame(pca.components_, columns=list(dfPca.columns))
as mentioned in PCA on sklearn - how to interpret pca.components_ . Next to that I have attempted to implement the solution offered by user seralouk with some minor changes to make it fit the Prince FAMD.
n_pcs = len(inertia)
most_important = [inertia[i].argmax() for i in range(n_pcs)]
initial_feature_names = df_pca.columns
most_important_names = [initial_feature_names[most_important[i]] for i in range(n_pcs)]
dic = {'PC{}'.format(i): most_important_names[i] for i in range(n_pcs)}
pca_results = pd.DataFrame(dic.items())
However this does not appear to work for the Prince FAMD. Are there any ways to link the output of the FAMD to the original variable names?