Skip to content

Commit

Permalink
[jvm-packages] fix errors in example (dmlc#3719)
Browse files Browse the repository at this point in the history
* add back train method but mark as deprecated

* fix scalastyle error

* add back train method but mark as deprecated

* add back train method but mark as deprecated

* add back train method but mark as deprecated

* fix scalastyle error

* fix scalastyle error

* fix scalastyle error

* instrumentation

* use log console

* better measurement

* fix erros in example

* update histmaker
  • Loading branch information
CodingCat authored Sep 22, 2018
1 parent 3b5a1f3 commit 79d854c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object SparkMLlibPipeline {

def main(args: Array[String]): Unit = {

if (args.length != 1) {
if (args.length != 3) {
println("Usage: SparkMLlibPipeline input_path native_model_path pipeline_model_path")
sys.exit(1)
}
Expand Down Expand Up @@ -79,6 +79,8 @@ object SparkMLlibPipeline {
"num_workers" -> 2
)
)
booster.setFeaturesCol("features")
booster.setLabelCol("classIndex")
val labelConverter = new IndexToString()
.setInputCol("prediction")
.setOutputCol("realLabel")
Expand All @@ -94,6 +96,8 @@ object SparkMLlibPipeline {

// Model evaluation
val evaluator = new MulticlassClassificationEvaluator()
evaluator.setLabelCol("classIndex")
evaluator.setPredictionCol("prediction")
val accuracy = evaluator.evaluate(prediction)
println("The model accuracy is : " + accuracy)

Expand Down
2 changes: 1 addition & 1 deletion src/tree/updater_histmaker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HistMaker: public BaseMaker {
}

protected:
/*! \brief a single histogram */
/*! \brief a single histogram */
struct HistUnit {
/*! \brief cutting point of histogram, contains maximum point */
const bst_float *cut;
Expand Down

0 comments on commit 79d854c

Please sign in to comment.