Coder Social home page Coder Social logo

Facing issues with json4s package, while saving model. Also not able to create a fat jar due to version conflict between liberaries. about isolation-forest HOT 8 CLOSED

linkedin avatar linkedin commented on May 19, 2024 1
Facing issues with json4s package, while saving model. Also not able to create a fat jar due to version conflict between liberaries.

from isolation-forest.

Comments (8)

sandeep1288 avatar sandeep1288 commented on May 19, 2024 1

Thanks a lot, I'm able to make it working with latest versions of spark.

from isolation-forest.

sandeep1288 avatar sandeep1288 commented on May 19, 2024

Below function threw error:
private def getMetadataToSave(
instance: Params,
spark: SparkSession,
extraMetadata: Option[JObject] = None): String = {

  val uid = instance.uid
  val cls = instance.getClass.getName
  val params = instance.extractParamMap.toSeq
  val jsonParams = render(params.map { case ParamPair(p, v) =>
    p.name -> parse(p.jsonEncode(v))
  }.toList)
  val basicMetadata = ("class" -> cls) ~
    ("timestamp" -> System.currentTimeMillis()) ~
    ("sparkVersion" -> spark.sparkContext.version) ~
    ("uid" -> uid) ~
    ("paramMap" -> jsonParams)
  val metadata = extraMetadata match {
    case Some(jObject) => basicMetadata ~ jObject
    case None => basicMetadata
  }
  val metadataJson = compact(render(metadata))

  metadataJson
}

}

And problem is happening while saving model.

from isolation-forest.

jverbus avatar jverbus commented on May 19, 2024

What version of Spark and Scala are you using?

The recommended versions for the project are:

Scala 2.11.8
Spark 2.3.0

These are the versions used to produce the jars on Bintray.

from isolation-forest.

sandeep1288 avatar sandeep1288 commented on May 19, 2024

I'm using databrick platform, and below is the scala and spark version:
spark-version : 2.4.3
scala-version : 2.11.12

In order to make current iForest working on latest spark version, what are the essential steps which I can follow. There should not be much difference between spark 2.3 and 2.4, apart from json4s.

from isolation-forest.

jverbus avatar jverbus commented on May 19, 2024

It is currently recommended to use Scala 2.11 and Spark 2.3.

You will need to build the isolation-forest library yourself using Spark 2.4 if you want to use it in a Spark 2.4 environment. You will need to change some dependencies in the module-level build.gradle file.

Please try the instructions in this ticket: #1

from isolation-forest.

sandeep1288 avatar sandeep1288 commented on May 19, 2024

Thanks a lot. I'll give it a try.

from isolation-forest.

jverbus avatar jverbus commented on May 19, 2024

@sandeep1288: Cool. Please let me know if it works. Thanks!

from isolation-forest.

sandeep1288 avatar sandeep1288 commented on May 19, 2024

from isolation-forest.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.