Skip to content

Instantly share code, notes, and snippets.

@danared danared/mongospark
Created Jun 24, 2016

Embed
What would you like to do?
package example
import org.apache.log4j.{Level, Logger}
import org.apache.spark.ml.evaluation.RegressionEvaluator
import org.apache.spark.ml.recommendation.ALS
import org.apache.spark.ml.tuning.{ParamGridBuilder, TrainValidationSplit}
import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}
import com.mongodb.spark.MongoSpark
import com.mongodb.spark.config.{ReadConfig, WriteConfig}
/**
* Represents a Users movie rating
*/
case class UserMovieRating(user_id: Int, movie_id: Int, rating: Double)
object MovieRecommendation {
/**
* Run this main method to see the output of this quick example or copy the code into the spark shell
*
* @param args takes an optional single argument for the connection string
* @throws Throwable if an operation fails
*/
def main(args: Array[String]): Unit = {
}
/**
* Gets or creates the Spark Context
*/
def getSparkContext(): SparkContext = {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.