###Transform RDD to DataFrame in Spark
from pyspark.sql import Row
import os
rdd = sc.textFile('C:/Users/chao.huang.ctr/spark-playground//class.txt')
def transform(x):
args = x.split()
funcs = [str, str, int, float, float]
return [z(y) for z, y in zip(funcs, args)]
varnames = Row("name", "sex", "age", "height", "weight")
df = rdd.map(transform).map(lambda x: varnames(*x)).toDF()
for x in df.collect():
print x
Does the Logistic regression in PySpark MLLIB model working for multiclasses classification ?