Spark: Learn Spark In A DAY! - The Ultimate Crash Course to Learning the Basics of Spark In No Time (Spark, Spark Course, Spark Development, Spark Books, Spark for Beginners) by Acodemy

Spark: Learn Spark In A DAY! - The Ultimate Crash Course to Learning the Basics of Spark In No Time (Spark, Spark Course, Spark Development, Spark Books, Spark for Beginners) by Acodemy

Author:Acodemy [Acodemy]
Language: eng
Format: epub
Published: 2015-08-03T18:30:00+00:00


// Model building

val count = 40

val model = LinearRegressionWithSGD.train(data, count)

// While using the test data - one can evaluate model to find out test error.

val predictedVals = data.map { modelElement =>

val predictedValue = model.predict(modelElement.features)

(modelElement.label, predictedValue)

}

val MeanSquareError = predictedVals.map{ case(w, pow) => math.pow((w - pow), 2)}.reduce(_ + _)/predictedVals.count

Support Vector Machines (SVM) Algorithm

Implementation of SVM algorithm in Spark REPL environment is as below.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.