Created
July 5, 2022 18:08
-
-
Save a-agmon/398d955e061522b2dd6ff4223fcdb2b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ml.dmlc.xgboost4j.LabeledPoint | |
import ml.dmlc.xgboost4j.scala.{Booster, DMatrix, XGBoost} | |
// Load model from binary file | |
object Classifier { | |
var model: Option[Booster] = None | |
def Init(modelFile:String): Unit = { | |
if (model.isEmpty) { | |
model = Some(XGBoost.loadModel(modelFile)) | |
logger.info(s"Model loaded from $modelFile") | |
} | |
} | |
//..... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment