Code Monkey home page Code Monkey logo

Comments (4)

mindcrusher11 avatar mindcrusher11 commented on August 10, 2024

name := "SparkKnn"

version := "1.0"

scalaVersion := "2.10.5"

libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.6.0",
"org.apache.spark" %% "spark-sql" % "1.6.0",
"org.apache.spark" %% "spark-mllib" % "1.6.0",
"io.snappydata" % "snappy-spark-mllib_2.10" % "1.6.2-1",
"saurfang"%"spark-knn"%"0.1.0"
)

spDependencies += "saurfang/spark-knn:0.1.0"

sparkComponents +="mllib"

sparkVersion := "1.6.0"

my sbt configuration

from spark-knn.

mindcrusher11 avatar mindcrusher11 commented on August 10, 2024

object SparkKnn {

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

//val conf = new SparkConf().set("spark.serializer", "org.apache.spark.serializer.KryoSerializer").setMaster("local[4]")
val conf = configure("Popularity")
val sc = new SparkContext(conf)

val sqlContext = new org.apache.spark.sql.SQLContext(sc)

// this is used to implicitly convert an RDD to a DataFrame.
import sqlContext.implicits._
val training = MLUtils.loadLibSVMFile(sc, "/home/gaur/svmdata").toDF().select("features","label")

training.show()

val knn = new KNNRegression().setTopTreeSize(500 / 5).setK(3)

val knnModel = knn.fit(training)

//val predicted = knnModel.transform(training)

//predicted.show()

}

def configure(appName: String = "Sparkling Water Demo"): SparkConf = {
val conf = new SparkConf().setAppName(appName)
conf.setIfMissing("spark.master", sys.env.getOrElse("spark.master", "local[*]"))
conf
}
}

from spark-knn.

mindcrusher11 avatar mindcrusher11 commented on August 10, 2024

till show it is working fine it may be version issue but which version shall I use I checked in project folder 1.6.0 spark-core dependency is being used so i changed it to 1.6.0 but still iam getting same issue

from spark-knn.

mindcrusher11 avatar mindcrusher11 commented on August 10, 2024

with spark submit jar option it is working fine

from spark-knn.

Related Issues (20)

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.