Skip to content

Commit 26b2640

Browse files
authored
Merge pull request #121 from metarank/fix/remove-circe
remove unused json parser from catboost
2 parents 88e778f + 740ef9f commit 26b2640

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

build.sbt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ libraryDependencies ++= Seq(
2121
"org.scalatest" %% "scalatest-propspec" % scalatestVersion % Test,
2222
"org.scalactic" %% "scalactic" % scalatestVersion % Test,
2323
"org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % Test,
24-
("com.github.pathikrit" %% "better-files" % "3.9.2").cross(CrossVersion.for3Use2_13),
24+
"com.github.pathikrit" %% "better-files" % "3.9.2",
2525
"org.slf4j" % "slf4j-api" % slf4jversion,
2626
"org.slf4j" % "slf4j-simple" % slf4jversion % Test,
2727
"org.apache.commons" % "commons-math3" % "3.6.1",
@@ -31,10 +31,7 @@ libraryDependencies ++= Seq(
3131
"com.opencsv" % "opencsv" % "5.7.1",
3232
"org.scala-lang.modules" %% "scala-collection-compat" % "2.9.0",
3333
"io.github.metarank" % "catboost4j" % "1.1.1-1",
34-
"ai.catboost" % "catboost-prediction" % "1.1.1",
35-
"io.circe" %% "circe-core" % circeVersion,
36-
"io.circe" %% "circe-generic" % circeVersion,
37-
"io.circe" %% "circe-parser" % circeVersion
34+
"ai.catboost" % "catboost-prediction" % "1.1.1"
3835
)
3936

4037
sonatypeProfileName := "io.github.metarank"

src/main/scala/io/github/metarank/ltrlib/booster/CatboostBooster.scala

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ package io.github.metarank.ltrlib.booster
22

33
import ai.catboost.CatBoostModel
44
import better.files.File
5-
import io.circe.Decoder
65
import io.github.metarank.ltrlib.booster.Booster.BoosterFactory
7-
import io.circe.generic.semiauto._
8-
import io.github.metarank.ltrlib.booster.CatboostBooster.CatTrainJson.{Iteration, Meta}
96
import io.github.metarank.ltrlib.output.LibSVMOutputFormat
107
import ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl.{TVector_TString, native_impl}
118

@@ -44,27 +41,6 @@ case class CatboostBooster(booster: CatBoostModel, bytes: Array[Byte]) extends B
4441

4542
object CatboostBooster extends BoosterFactory[String, CatboostBooster, CatboostOptions] {
4643

47-
case class CatTrainJson(meta: Meta, iterations: List[Iteration])
48-
49-
object CatTrainJson {
50-
case class Meta(test_sets: List[String], test_metrics: List[TestMetric], learn_metrics: List[TestMetric])
51-
52-
case class TestMetric(best_value: String, name: String)
53-
54-
case class Iteration(
55-
learn: List[Double],
56-
passed_time: Double,
57-
remaining_time: Double,
58-
iteration: Int,
59-
test: List[Double]
60-
)
61-
62-
implicit val metaDecoder: Decoder[Meta] = deriveDecoder[Meta]
63-
implicit val tmDecoder: Decoder[TestMetric] = deriveDecoder[TestMetric]
64-
implicit val itDecoder: Decoder[Iteration] = deriveDecoder[Iteration]
65-
implicit val ctDecoder: Decoder[CatTrainJson] = deriveDecoder[CatTrainJson]
66-
}
67-
6844
override def apply(string: Array[Byte]): CatboostBooster = {
6945
val cb = CatBoostModel.loadModel(new ByteArrayInputStream(string))
7046
CatboostBooster(cb, string)

0 commit comments

Comments
 (0)