[ 
https://issues.apache.org/jira/browse/SPARK-8096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

bofei.xiao reopened SPARK-8096:
-------------------------------

I'm sorry i haven't express my question clearly!

> how to convert dataframe field to LabelPoint
> --------------------------------------------
>
>                 Key: SPARK-8096
>                 URL: https://issues.apache.org/jira/browse/SPARK-8096
>             Project: Spark
>          Issue Type: Bug
>            Reporter: bofei.xiao
>
> how to convert the dataframe to RDD[LabelPoint]
> dataframe with fields target,age,sex,height
> i want to cast target as label,"age,sex,height" as features vector
> I faced this problem in the following circumstance:
> --------------------------------------------------
> given i have a csv file data.csv
> target,age,sex,height
> 1,18,1,170
> 0,25,1,165
> .....
> now,i want build a decisitin model
> step 1:load csv data as dataframe
> val data= sqlContext.load("com.databricks.spark.csv",:Map("path" -> 
> "data.csv", "header" -> "true")
> step 2:build a decisiontree model
> but decisiontree need a RDD[LabelPoint] input
> thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to