Skip to content

Instantly share code, notes, and snippets.

View ramv's full-sized avatar

Ram Viswanadha ramv

View GitHub Profile
@ramv
ramv / SimilarityDimSum.java
Created April 28, 2017 21:34
Similarity Analysis
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.mllib.linalg.Vector;
import org.apache.spark.mllib.linalg.Vectors;
import org.apache.spark.mllib.linalg.distributed.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.Tuple2;
import java.io.Serializable;
@ramv
ramv / SimilarityAnalysis.java
Created April 28, 2017 21:27
Similarity Analysis Example
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.api.java.function.PairFunction;
import org.apache.spark.mllib.recommendation.Rating;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.RowFactory;
import org.apache.spark.sql.SQLContext;
@ramv
ramv / MovieLensALS.java
Last active February 1, 2016 07:33
Java Implementation of ALS Recommender for Movie Lens Data
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaDoubleRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.DoubleFlatMapFunction;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.ml.recommendation.ALS;
import org.apache.spark.ml.recommendation.ALSModel;
import org.apache.spark.mllib.recommendation.Rating;
import org.apache.spark.sql.DataFrame;
14/04/10 05:23:18 INFO HttpBroadcast: Broadcast server started at http://10.141.141.10:59928
14/04/10 05:23:18 INFO SparkEnv: Registering MapOutputTracker
14/04/10 05:23:18 INFO HttpFileServer: HTTP File server directory is /tmp/spark-04b4e211-7f83-4fc3-8306-a78eddfa7b8c
14/04/10 05:23:18 INFO HttpServer: Starting HTTP Server
14/04/10 05:23:18 INFO SparkUI: Started Spark Web UI at http://10.141.141.10:4040
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007faa9f3fef01, pid=17779, tid=140369475073792
#
@ramv
ramv / kirby.conf
Created March 6, 2014 23:49
Kirby NGINX configuration
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){