Skip to content
Snippets Groups Projects
Commit 050c20cc authored by actuaryzhang's avatar actuaryzhang Committed by gatorsmile
Browse files

[SPARK-19386][SPARKR][FOLLOWUP] fix error in vignettes

## What changes were proposed in this pull request?

Current version has error in vignettes:
```
model <- spark.bisectingKmeans(df, Sepal_Length ~ Sepal_Width, k = 4)
summary(kmeansModel)
```

`kmeansModel` does not exist...

felixcheung wangmiao1981

Author: actuaryzhang <actuaryzhang10@gmail.com>

Closes #16799 from actuaryzhang/sparkRVignettes.
parent 48aafeda
No related branches found
No related tags found
No related merge requests found
...@@ -744,10 +744,10 @@ predictions <- predict(rfModel, df) ...@@ -744,10 +744,10 @@ predictions <- predict(rfModel, df)
`spark.bisectingKmeans` is a kind of [hierarchical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) using a divisive (or "top-down") approach: all observations start in one cluster, and splits are performed recursively as one moves down the hierarchy. `spark.bisectingKmeans` is a kind of [hierarchical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) using a divisive (or "top-down") approach: all observations start in one cluster, and splits are performed recursively as one moves down the hierarchy.
```{r} ```{r, warning=FALSE}
df <- createDataFrame(iris) df <- createDataFrame(iris)
model <- spark.bisectingKmeans(df, Sepal_Length ~ Sepal_Width, k = 4) model <- spark.bisectingKmeans(df, Sepal_Length ~ Sepal_Width, k = 4)
summary(kmeansModel) summary(model)
fitted <- predict(model, df) fitted <- predict(model, df)
head(select(fitted, "Sepal_Length", "prediction")) head(select(fitted, "Sepal_Length", "prediction"))
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment