I am trying t perform pca from a spark application using PySpark API on a python script. I doing This way:
pca = PCA(k=3, inputCol="features", outputCol="pcaFeatures")
PCAmodel = pca.fit(data)
when I run those two code line in the pyspark shell it work and return good results, but in an application script, I am getting the type of error:
PCA() got an unexpected keyword argument 'k'
PS: In both case I am using Spark 2.2.0
where is the problem? why it does work in the PySpark shell and not for the application?