0.9/ Mahout-Distribution-0.9.zip Ml-100k.zip: Download Latest

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Documentation on

Mahout-Itembased recommender

Open Eclipse.
Open File NewJavaProject.
Give Project name as ItemRecommender.
Now create a Library folder to store our jar files
and library files, and create a new folder to add our
Data.
All the Libraries we need is Apache Mahout
Libraries -https://mahout.apache.org/general/downloads.html
Download Latest --0.9/-- mahout-distribution-0.9.zip
-download this Zipfile.
From http://grouplens.org/datasets/movielens/--ml100k.zip download this Zipfile.
From http://slf4j.org/download.html -- slf4j1.7.6.zip download this Zipfile.
From https://code.google.com/p/guava-libraries/ -- guava16.0.1.jar download this Zipfile.
From http://commons.apache.org/proper/commonsmath/download_math.cgi -- commons-math3-3.2-bin.zip

download this Zipfile.


Now add below files to library folder.
1. Commons-math3-3.2.jar
2. guava 15.0.jar
3. mahout-core-0.9.jar, mahout-integration-0.9.jar,
mahout-math-0.9.jar
4. slf4j-api-1.7.6.jar, slf4j-nop-1.7.6.jar
We need to build the path for all library folder jar
files

under the refrences libraries.


Now add DATA sets from Grouplens site to Data
folder which we created in our JavaProject.
Part A:
Converting Tab separated file into csv File: The Dataset is u.data file which is in tab
separated format .We are now converting it to
Comma(,) separated i.e., to .csv and then we are
running Itembased recommender engine for a
specific Items or for all Items which we desire.
Now create a New Package as
com.convertmovielens and New Class as
MovieDataConvert for Itemrecommender.
Code :

Outputs:

Part B:
1.Using PearsonCorrelationSimilarity Metric:
For PearsonCorrelationSimilarity Metric use
ItemSimilarity sim = new PearsonCorrelationSimilarity(dm);

2.Using EuclidianDistanceSimilarity Metric:


For EuclidianDistanceSimilarity Metric use

ItemSimilarity sim = new EuclidianDistanceSimilarity(dm); .


3.Using TanimotoCoefficientSimilarity Metric:
For TanimotoCoefficientSimilarity Metric use

ItemSimilarity sim = new TanimotoCoefficientSimilarity(dm); .


4.Using LogLikelihoodSimilarity Metric:
For EuclidianDistanceSimilarity Metric use

ItemSimilarity sim = new LogLikelihoodSimilarity(dm);

Outputs:
Pearson
Correlation Similarity
Metric

Euclidian
Distance
Similarity Metric

Tanimoto
Coefficient
Similarity Metric

LogLikelihoodSimila
rity Metric

1,757,1.0
1,341,1.0
2,75,1.0
2,74,1.0
3,344,1.0
3,115,1.0
4,643,1.0
4,360,1.0
5,34,1.0
5,6,1.0

1,757,1.0
1,711,1.0
2,359,1.0
2,308,1.0
3,377,1.0
3,344,1.0
4,814,1.0
4,711,1.0
5,533,1.0
5,314,1.0

1,50,0.5825688
1,121,0.5537919
2,233,0.53614455
2,231,0.4918033
3,17,0.2638889
3,123,0.2576687
4,385,0.46830985
4,202,0.46407187
5,218,0.35978836
5,672,0.31304348

1,117,0.9953521
1,151,0.9953065
2,403,0.9964998
2,233,0.9964557
3,405,0.99037176
3,235,0.9893157
4,56,0.99627966
4,174,0.99601305
5,218,0.99432045
5,98,0.9922024

You might also like