Skip to content

Commit df56cbf

Browse files
committed
update test script
1 parent dba0de7 commit df56cbf

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/main/resources/param_tuning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
|5|0.1|0.5|0.01|0.5||400|3.97 ~ 3.57|3.789|na|
2020
|5|0.1|0.7|0.01|0.7|0.8|400|3.97 ~ 3.57|3.788|3.937|
2121
|5|0.01|0.7|0.01|0.7|0.8|400|3.99 ~ 3.80|3.741|3.884|
22-
|5|0.03|0.5|0.05|0.7| |400|3.99 ~ 3.732 |3.746 | |
23-
|5|0.03|0.5|0.03|0.7| |500| | | |
22+
|5|0.01|0.5|0.05|0.7| |400|3.99 ~ 3.79 |3.739|3.886 |
23+
|5|0.03|0.5|0.05|0.7| |400|3.99 ~ 3.702 |3.740|3.888|
2424
|5|0.1|1|0.05|0.5|1|400|3.97 ~ 3.57|3.78|na|
2525
|5|0.5|1|0.05|0.5|1|400|3.89 ~ 3.30|4.19|na|
2626
|5|0.05|1|0.01|0.7|1|400|3.98 ~ 3.67 |3.754 |na|

src/main/scala/com/hyzs/spark/ml/ModelPrediction.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,17 @@ object ModelPrediction {
205205
} else if (goal == "Regression"){
206206
val xgbParam = Map(
207207
"max_depth" -> 5,
208-
"alpha" -> 0.03f,
208+
"alpha" -> 0.05f,
209209
"subsample" -> 0.7,
210210
//"colsample_bytree" -> 0.7,
211211
//"min_child_weight" -> 0.5,
212212
"objective" -> "reg:linear",
213213
//"top_k" -> "13",
214214
"booster" -> "gbtree",
215-
"eta" -> 0.03f,
215+
"eta" -> 0.01f,
216216
"gamma" -> 0.5,
217217
"eval_metric" -> "rmse",
218-
"num_round" -> 500)
218+
"num_round" -> 400)
219219
val xgbReg = new XGBoostRegressor(xgbParam)
220220
.setFeaturesCol("features").setLabelCol("label")
221221

src/test/scala/ScalaTest.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import org.scalatest.FunSuite
22

33
import scala.annotation.tailrec
44
import java.io._
5+
56
import com.hyzs.spark.ml.ModelEvaluation._
67
import com.hyzs.spark.utils.BaseUtil
78
import com.hyzs.spark.utils.BaseUtil._
89
import org.apache.spark.sql.Row
910

11+
import scala.concurrent.Future
1012
import scala.io.Source
1113
import scala.util.Random
1214
/**
@@ -260,7 +262,13 @@ class ScalaTest extends FunSuite{
260262
println(res)
261263
}
262264

265+
import concurrent.ExecutionContext.Implicits.global
263266
test("actor test"){
267+
var i,j = 0
268+
(0 to 10000).foreach(_ => Future{i = i +1})
269+
(0 to 10000).foreach(_ => j = j+1)
270+
Thread.sleep(1000)
271+
println(s"i:$i, j:$j")
264272

265273
}
266274

0 commit comments

Comments
 (0)