Above is my dataframe, after performing PCA to my features: I want to plot the PCA features (i.e. values ) with hue as Article, in Pyspark
I tried the following code,
def abc(x):
lst = x['values']
return lst[0], lst[1], lst[2]
pca_df['col1'], pca_df['col2'], pca_df['col3'] = pca_df.map(lambda x: abc(x.select('PCA_features')))
I am getting the below error:
AttributeError: 'DataFrame' object has no attribute 'map'
Can someone help me in extracting the features in columns like feature1, feature2, feature3, in the dataframe along with the articles, so that I can plot it. Or suggest if there is some other way to do the same.