You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multinomial logistic regression against three classes
582
-
```{r, warning=FALSE}
583
-
df <- createDataFrame(iris)
581
+
```{r}
582
+
t <- as.data.frame(Titanic)
583
+
training <- createDataFrame(t)
584
584
# Note in this case, Spark infers it is multinomial logistic regression, so family = "multinomial" is optional.
585
-
model <- spark.logit(df, Species ~ ., regParam = 0.056)
585
+
model <- spark.logit(training, Class ~ ., regParam = 0.07815179)
586
586
summary(model)
587
587
```
588
588
@@ -609,11 +609,12 @@ MLPC employs backpropagation for learning the model. We use the logistic loss fu
609
609
610
610
`spark.mlp` requires at least two columns in `data`: one named `"label"` and the other one `"features"`. The `"features"` column should be in libSVM-format.
611
611
612
-
We use iris data set to show how to use `spark.mlp` in classification.
613
-
```{r, warning=FALSE}
614
-
df <- createDataFrame(iris)
612
+
We use Titanic data set to show how to use `spark.mlp` in classification.
613
+
```{r}
614
+
t <- as.data.frame(Titanic)
615
+
training <- createDataFrame(t)
615
616
# fit a Multilayer Perceptron Classification Model
`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.
771
772
772
-
```{r, warning=FALSE}
773
-
df <- createDataFrame(iris)
774
-
model <- spark.bisectingKmeans(df, Sepal_Length ~ Sepal_Width, k = 4)
773
+
```{r}
774
+
t <- as.data.frame(Titanic)
775
+
training <- createDataFrame(t)
776
+
model <- spark.bisectingKmeans(training, Class ~ Survived, k = 4)
Copy file name to clipboardExpand all lines: R/run-tests.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ FAILED=0
23
23
LOGFILE=$FWDIR/unit-tests.out
24
24
rm -f $LOGFILE
25
25
26
-
SPARK_TESTING=1 $FWDIR/../bin/spark-submit --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" --conf spark.hadoop.fs.default.name="file:///"$FWDIR/pkg/tests/run-all.R 2>&1| tee -a $LOGFILE
26
+
SPARK_TESTING=1 $FWDIR/../bin/spark-submit --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" --conf spark.hadoop.fs.defaultFS="file:///"$FWDIR/pkg/tests/run-all.R 2>&1| tee -a $LOGFILE
0 commit comments