Commit 6902eda
committed
[SPARK-17315][FOLLOW-UP][SPARKR][ML] Fix print of Kolmogorov-Smirnov test summary
## What changes were proposed in this pull request?
apache#14881 added Kolmogorov-Smirnov Test wrapper to SparkR. I found that ```print.summary.KSTest``` was implemented inappropriately and result in no effect.
Running the following code for KSTest:
```Scala
data <- data.frame(test = c(0.1, 0.15, 0.2, 0.3, 0.25, -1, -0.5))
df <- createDataFrame(data)
testResult <- spark.kstest(df, "test", "norm")
summary(testResult)
```
Before this PR:

After this PR:

The new implementation is similar with [```print.summary.GeneralizedLinearRegressionModel```](https://github.com/apache/spark/blob/master/R/pkg/R/mllib.R#L284) of SparkR and [```print.summary.glm```](https://svn.r-project.org/R/trunk/src/library/stats/R/glm.R) of native R.
BTW, I removed the comparison of ```print.summary.KSTest``` in unit test, since it's only wrappers of the summary output which has been checked. Another reason is that these comparison will output summary information to the test console, it will make the test output in a mess.
## How was this patch tested?
Existing test.
Author: Yanbo Liang <[email protected]>
Closes apache#15139 from yanboliang/spark-17315.1 parent c133907 commit 6902eda
2 files changed
+11
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1404 | 1406 | | |
1405 | 1407 | | |
1406 | 1408 | | |
1407 | 1409 | | |
1408 | 1410 | | |
1409 | | - | |
| 1411 | + | |
1410 | 1412 | | |
1411 | 1413 | | |
1412 | 1414 | | |
1413 | | - | |
| 1415 | + | |
1414 | 1416 | | |
1415 | | - | |
1416 | | - | |
| 1417 | + | |
| 1418 | + | |
1417 | 1419 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
| 763 | + | |
770 | 764 | | |
771 | 765 | | |
772 | 766 | | |
| |||
775 | 769 | | |
776 | 770 | | |
777 | 771 | | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
| 772 | + | |
785 | 773 | | |
786 | 774 | | |
787 | 775 | | |
0 commit comments