You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2015/06/04 13:27:38 UTC

[jira] [Resolved] (SPARK-8096) use csv data to build a classification model,how to convert dataframe field to label and features

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

Sean Owen resolved SPARK-8096.
------------------------------
    Resolution: Invalid

https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark

user@spark.apache.org is the place for questions.

> use csv data to build a classification model,how to convert dataframe field to label and features
> -------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-8096
>                 URL: https://issues.apache.org/jira/browse/SPARK-8096
>             Project: Spark
>          Issue Type: Bug
>            Reporter: bofei.xiao
>
> 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
> Q:how to convert the dataframe to RDD[LabelPoint]
> thanks!



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

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