Using pyspark 2.1,I am trying to find some predicted result and the code is given below
restultSet=testingData.map(lambda p: (p.label, linearModel.predict(p.features))).collect()
Now the output of restultSet is in list and it looks like below
[(2.0, array([ 2.09078012])), (2.0, array([ 2.09078012])), (2.0, array([ 2.09078012])), (1.0, array([ 2.09078012])), (2.0, array([ 2.09078012])), (1.0, array([ 2.09078012]))]
When I am have give type(restultSet) it is showing me below result
I am struggling to convert from list to dataframe
I tried to use below snippets it didn't work . Please help
restultSet.toDF()