Skip to content

Commit

Permalink
[ML-82] [Tests] Add NaiveBayes test and refactors (#83)
Browse files Browse the repository at this point in the history
* ignore failed ALS tests, will fix later

* Rename Intel***Suite to MLlib***Suite
Add MLlibNaiveBayesSuite

* nit

* turn on ci

* turn on ci
  • Loading branch information
xwu99 authored Jun 23, 2021
1 parent 279980e commit 1df57db
Show file tree
Hide file tree
Showing 10 changed files with 982 additions and 99 deletions.
8 changes: 5 additions & 3 deletions dev/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ for SparkVer in ${SupportedSparkVersions[*]}; do
# Build test with profile
$GITHUB_WORKSPACE/dev/ci-build.sh $SparkVer

mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.clustering.IntelKMeansSuite test
mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.feature.IntelPCASuite test
# mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.recommendation.IntelALSSuite test
mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.clustering.MLlibKMeansSuite test
mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.feature.MLlibPCASuite test
mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.recommendation.MLlibALSSuite test
mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.classification.MLlibNaiveBayesSuite test
mvn --no-transfer-progress -P$SparkVer -Dtest=none -DwildcardSuites=org.apache.spark.ml.regression.MLlibLinearRegressionSuite test
done

# Yarn cluster test without profile
Expand Down
100 changes: 100 additions & 0 deletions examples/data/sample_libsvm_data.txt

Large diffs are not rendered by default.

Empty file modified examples/data/sample_linear_regression_data.txt
100755 → 100644
Empty file.
150 changes: 150 additions & 0 deletions examples/data/sample_multiclass_classification_data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
1 1:-0.222222 2:0.5 3:-0.762712 4:-0.833333
1 1:-0.555556 2:0.25 3:-0.864407 4:-0.916667
1 1:-0.722222 2:-0.166667 3:-0.864407 4:-0.833333
1 1:-0.722222 2:0.166667 3:-0.694915 4:-0.916667
0 1:0.166667 2:-0.416667 3:0.457627 4:0.5
1 1:-0.833333 3:-0.864407 4:-0.916667
2 1:-1.32455e-07 2:-0.166667 3:0.220339 4:0.0833333
2 1:-1.32455e-07 2:-0.333333 3:0.0169491 4:-4.03573e-08
1 1:-0.5 2:0.75 3:-0.830508 4:-1
0 1:0.611111 3:0.694915 4:0.416667
0 1:0.222222 2:-0.166667 3:0.423729 4:0.583333
1 1:-0.722222 2:-0.166667 3:-0.864407 4:-1
1 1:-0.5 2:0.166667 3:-0.864407 4:-0.916667
2 1:-0.222222 2:-0.333333 3:0.0508474 4:-4.03573e-08
2 1:-0.0555556 2:-0.833333 3:0.0169491 4:-0.25
2 1:-0.166667 2:-0.416667 3:-0.0169491 4:-0.0833333
1 1:-0.944444 3:-0.898305 4:-0.916667
2 1:-0.277778 2:-0.583333 3:-0.0169491 4:-0.166667
0 1:0.111111 2:-0.333333 3:0.38983 4:0.166667
2 1:-0.222222 2:-0.166667 3:0.0847457 4:-0.0833333
0 1:0.166667 2:-0.333333 3:0.559322 4:0.666667
1 1:-0.611111 2:0.0833333 3:-0.864407 4:-0.916667
2 1:-0.333333 2:-0.583333 3:0.0169491 4:-4.03573e-08
0 1:0.555555 2:-0.166667 3:0.661017 4:0.666667
2 1:0.166667 3:0.186441 4:0.166667
2 1:0.111111 2:-0.75 3:0.152542 4:-4.03573e-08
2 1:0.166667 2:-0.25 3:0.118644 4:-4.03573e-08
0 1:-0.0555556 2:-0.833333 3:0.355932 4:0.166667
0 1:-0.277778 2:-0.333333 3:0.322034 4:0.583333
2 1:-0.222222 2:-0.5 3:-0.152542 4:-0.25
2 1:-0.111111 3:0.288136 4:0.416667
2 1:-0.0555556 2:-0.25 3:0.186441 4:0.166667
2 1:0.333333 2:-0.166667 3:0.355932 4:0.333333
1 1:-0.611111 2:0.25 3:-0.898305 4:-0.833333
0 1:0.166667 2:-0.333333 3:0.559322 4:0.75
0 1:0.111111 2:-0.25 3:0.559322 4:0.416667
0 1:0.833333 2:-0.166667 3:0.898305 4:0.666667
2 1:-0.277778 2:-0.166667 3:0.186441 4:0.166667
0 1:-0.666667 2:-0.583333 3:0.186441 4:0.333333
1 1:-0.666667 2:-0.0833334 3:-0.830508 4:-1
1 1:-0.166667 2:0.666667 3:-0.932203 4:-0.916667
0 1:0.0555554 2:-0.333333 3:0.288136 4:0.416667
1 1:-0.666667 2:-0.0833334 3:-0.830508 4:-1
1 1:-0.833333 2:0.166667 3:-0.864407 4:-0.833333
0 1:0.0555554 2:0.166667 3:0.491525 4:0.833333
0 1:0.722222 2:-0.333333 3:0.728813 4:0.5
2 1:-0.166667 2:-0.416667 3:0.0508474 4:-0.25
2 1:0.5 3:0.254237 4:0.0833333
0 1:0.111111 2:-0.583333 3:0.355932 4:0.5
1 1:-0.944444 2:-0.166667 3:-0.898305 4:-0.916667
2 1:0.277778 2:-0.25 3:0.220339 4:-4.03573e-08
0 1:0.666667 2:-0.25 3:0.79661 4:0.416667
0 1:0.111111 2:0.0833333 3:0.694915 4:1
0 1:0.444444 3:0.59322 4:0.833333
2 1:-0.0555556 2:0.166667 3:0.186441 4:0.25
1 1:-0.833333 2:0.333333 3:-1 4:-0.916667
1 1:-0.555556 2:0.416667 3:-0.830508 4:-0.75
2 1:-0.333333 2:-0.5 3:0.152542 4:-0.0833333
1 1:-1 2:-0.166667 3:-0.966102 4:-1
1 1:-0.333333 2:0.25 3:-0.898305 4:-0.916667
2 1:0.388889 2:-0.333333 3:0.288136 4:0.0833333
2 1:0.277778 2:-0.166667 3:0.152542 4:0.0833333
0 1:0.333333 2:0.0833333 3:0.59322 4:0.666667
1 1:-0.777778 3:-0.79661 4:-0.916667
1 1:-0.444444 2:0.416667 3:-0.830508 4:-0.916667
0 1:0.222222 2:-0.166667 3:0.627119 4:0.75
1 1:-0.555556 2:0.5 3:-0.79661 4:-0.916667
1 1:-0.555556 2:0.5 3:-0.694915 4:-0.75
2 1:-1.32455e-07 2:-0.25 3:0.254237 4:0.0833333
1 1:-0.5 2:0.25 3:-0.830508 4:-0.916667
0 1:0.166667 3:0.457627 4:0.833333
2 1:0.444444 2:-0.0833334 3:0.322034 4:0.166667
0 1:0.111111 2:0.166667 3:0.559322 4:0.916667
1 1:-0.611111 2:0.25 3:-0.79661 4:-0.583333
0 1:0.388889 3:0.661017 4:0.833333
1 1:-0.722222 2:0.166667 3:-0.79661 4:-0.916667
1 1:-0.722222 2:-0.0833334 3:-0.79661 4:-0.916667
1 1:-0.555556 2:0.166667 3:-0.830508 4:-0.916667
2 1:-0.666667 2:-0.666667 3:-0.220339 4:-0.25
2 1:-0.611111 2:-0.75 3:-0.220339 4:-0.25
2 1:0.0555554 2:-0.833333 3:0.186441 4:0.166667
0 1:-0.166667 2:-0.416667 3:0.38983 4:0.5
0 1:0.611111 2:0.333333 3:0.728813 4:1
2 1:0.0555554 2:-0.25 3:0.118644 4:-4.03573e-08
1 1:-0.666667 2:-0.166667 3:-0.864407 4:-0.916667
1 1:-0.833333 2:-0.0833334 3:-0.830508 4:-0.916667
0 1:0.611111 2:-0.166667 3:0.627119 4:0.25
0 1:0.888889 2:0.5 3:0.932203 4:0.75
2 1:0.222222 2:-0.333333 3:0.220339 4:0.166667
1 1:-0.555556 2:0.25 3:-0.864407 4:-0.833333
0 1:-1.32455e-07 2:-0.166667 3:0.322034 4:0.416667
0 1:-1.32455e-07 2:-0.5 3:0.559322 4:0.0833333
1 1:-0.611111 3:-0.932203 4:-0.916667
1 1:-0.333333 2:0.833333 3:-0.864407 4:-0.916667
0 1:-0.166667 2:-0.333333 3:0.38983 4:0.916667
2 1:-0.333333 2:-0.666667 3:-0.0847458 4:-0.25
2 1:-0.0555556 2:-0.416667 3:0.38983 4:0.25
1 1:-0.388889 2:0.416667 3:-0.830508 4:-0.916667
0 1:0.444444 2:-0.0833334 3:0.38983 4:0.833333
1 1:-0.611111 2:0.333333 3:-0.864407 4:-0.916667
0 1:0.111111 2:-0.416667 3:0.322034 4:0.416667
0 1:0.166667 2:-0.0833334 3:0.525424 4:0.416667
2 1:0.333333 2:-0.0833334 3:0.152542 4:0.0833333
0 1:-0.0555556 2:-0.166667 3:0.288136 4:0.416667
0 1:-0.166667 2:-0.416667 3:0.38983 4:0.5
1 1:-0.611111 2:0.166667 3:-0.830508 4:-0.916667
0 1:0.888889 2:-0.166667 3:0.728813 4:0.833333
2 1:-0.277778 2:-0.25 3:-0.118644 4:-4.03573e-08
2 1:-0.222222 2:-0.333333 3:0.186441 4:-4.03573e-08
0 1:0.333333 2:-0.583333 3:0.627119 4:0.416667
0 1:0.444444 2:-0.0833334 3:0.491525 4:0.666667
2 1:-0.222222 2:-0.25 3:0.0847457 4:-4.03573e-08
1 1:-0.611111 2:0.166667 3:-0.79661 4:-0.75
2 1:-0.277778 2:-0.166667 3:0.0508474 4:-4.03573e-08
0 1:1 2:0.5 3:0.830508 4:0.583333
2 1:-0.333333 2:-0.666667 3:-0.0508475 4:-0.166667
2 1:-0.277778 2:-0.416667 3:0.0847457 4:-4.03573e-08
0 1:0.888889 2:-0.333333 3:0.932203 4:0.583333
2 1:-0.111111 2:-0.166667 3:0.0847457 4:0.166667
2 1:0.111111 2:-0.583333 3:0.322034 4:0.166667
0 1:0.333333 2:0.0833333 3:0.59322 4:1
0 1:0.222222 2:-0.166667 3:0.525424 4:0.416667
1 1:-0.555556 2:0.5 3:-0.830508 4:-0.833333
0 1:-0.111111 2:-0.166667 3:0.38983 4:0.416667
0 1:0.888889 2:-0.5 3:1 4:0.833333
1 1:-0.388889 2:0.583333 3:-0.898305 4:-0.75
2 1:0.111111 2:0.0833333 3:0.254237 4:0.25
0 1:0.333333 2:-0.166667 3:0.423729 4:0.833333
1 1:-0.388889 2:0.166667 3:-0.762712 4:-0.916667
0 1:0.333333 2:-0.0833334 3:0.559322 4:0.916667
2 1:-0.333333 2:-0.75 3:0.0169491 4:-4.03573e-08
1 1:-0.222222 2:1 3:-0.830508 4:-0.75
1 1:-0.388889 2:0.583333 3:-0.762712 4:-0.75
2 1:-0.611111 2:-1 3:-0.152542 4:-0.25
2 1:-1.32455e-07 2:-0.333333 3:0.254237 4:-0.0833333
2 1:-0.5 2:-0.416667 3:-0.0169491 4:0.0833333
1 1:-0.888889 2:-0.75 3:-0.898305 4:-0.833333
1 1:-0.666667 2:-0.0833334 3:-0.830508 4:-1
2 1:-0.555556 2:-0.583333 3:-0.322034 4:-0.166667
2 1:-0.166667 2:-0.5 3:0.0169491 4:-0.0833333
1 1:-0.555556 2:0.0833333 3:-0.762712 4:-0.666667
1 1:-0.777778 3:-0.898305 4:-0.916667
0 1:0.388889 2:-0.166667 3:0.525424 4:0.666667
0 1:0.222222 3:0.38983 4:0.583333
2 1:0.333333 2:-0.0833334 3:0.254237 4:0.166667
2 1:-0.388889 2:-0.166667 3:0.186441 4:0.166667
0 1:-0.222222 2:-0.583333 3:0.355932 4:0.583333
1 1:-0.611111 2:-0.166667 3:-0.79661 4:-0.916667
1 1:-0.944444 2:-0.25 3:-0.864407 4:-0.916667
1 1:-0.388889 2:0.166667 3:-0.830508 4:-0.75
Loading

0 comments on commit 1df57db

Please sign in to comment.