[jvm-packages] fix errors in example (#3719)

* 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
This commit is contained in:
Nan Zhu 2018-09-22 16:39:38 -07:00 committed by GitHub
parent 3b5a1f389a
commit 79d854c695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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)
}
@ -79,6 +79,8 @@ object SparkMLlibPipeline {
"num_workers" -> 2
)
)
booster.setFeaturesCol("features")
booster.setLabelCol("classIndex")
val labelConverter = new IndexToString()
.setInputCol("prediction")
.setOutputCol("realLabel")
@ -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)

View File

@ -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;