[ 
https://issues.apache.org/jira/browse/SPARK-11439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15003384#comment-15003384
 ] 

Kai Sasaki commented on SPARK-11439:
------------------------------------

[~nakul02]
It seems to indicate the model in SparkR here. According to this documentation, 
you can create SparkR linear model with `glm`.
https://spark.apache.org/docs/latest/sparkr.html#machine-learning

This will call {{SparkRWrapper#fitRModelFormula}. It returns 
LinearRegressionModel with Pipeline when it receives "gaussian" as second 
parameter.
So in summary we can write the code like this to use {{LinearRegressionModel}} 
in SparkR.
{code}
df <- createDataFrame(sqlContext, iris)
fit <- glm(Sepal_Length ~ Sepal_Width + Species, data = df, family = "gaussian")
summary(fit)
{code}

In my environment, it seems to work.

> Optimization of creating sparse feature without dense one
> ---------------------------------------------------------
>
>                 Key: SPARK-11439
>                 URL: https://issues.apache.org/jira/browse/SPARK-11439
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML
>            Reporter: Kai Sasaki
>            Priority: Minor
>
> Currently, sparse feature generated in {{LinearDataGenerator}} needs to 
> create dense vectors once. It is cost efficient to prevent from generating 
> dense feature when creating sparse features.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to