From 4e04b1e711506ea76269d8e1d4574c223a4ad5d4 Mon Sep 17 00:00:00 2001 From: ansegura7 Date: Sat, 1 Jun 2019 12:35:29 -0500 Subject: [PATCH] Code Readme Added the readme.md file of the code and also more description in the methods of the classes. --- code/README.md | 40 +++++++++++++++++++ .../uniandes/mine/rs/LastfmRecommender.java | 4 +- .../src/edu/uniandes/mine/rs/Utilities.java | 6 +-- .../mine/rs/test/LastfmValidation.java | 4 +- .../pom.properties | 2 +- 5 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 code/README.md diff --git a/code/README.md b/code/README.md new file mode 100644 index 0000000..a82f359 --- /dev/null +++ b/code/README.md @@ -0,0 +1,40 @@ +# Recommender Systems for Last.fm + +## Authors +- Created by Andrés Segura Tinoco +- Created on May 29, 2019 + +## Program Description +The program has 4 classes. Each of them is described below: + +File class: **LastfmRecommender.java** +- Description: Program Main Class of Lastfm Recommender. +- Main methods: + - **main**: Input function of the main class. + - **userRecommendation**: Function that makes the recommendation by users. + - **itemRecommendation**: Function that makes the recommendation by items. + - **getUserBasedItems**: Returns recommended items using User-based similarity methods. + - **getItemBasedItems**: Returns recommended items using Item-based similarity methods. + +File class: **Utilities.java** +- Description: This class contains static utility functions. +- Main methods: + - **createDataModel**: Function that create a data model if file exists. + - **showItemList**: Show the list of recommended items in the console. + - **saveItemList**: Save into a plain file the list of recommended items. + - **showMessage**: Show an audit message in the console. + +File class: **LastfmValidation.java** +- Description: Main class to calculate the accuracy of the models. +- Main methods: + - **main**: Input function of the main class. + +File class: **CFRecommenderBuilder.java** +- Description: Collaborative Filtering Recommender builder. Classes container. +- Main classes: + - **UserJaccardRecommender**: Interface User-based Recommender with Jaccard similarity. + - **UserCosineRecommender**: Interface User-based Recommender with Cosine similarity. + - **UserPearsonRecommender**: Interface User-based Recommender with Pearson similarity. + - **ItemJaccardRecommender**: Interface Item-based Recommender with Jaccard similarity. + - **ItemCosineRecommender**: Interface Item-based Recommender with Cosine similarity. + - **ItemPearsonRecommender**: Interface Item-based Recommender with Pearson similarity. diff --git a/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/LastfmRecommender.java b/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/LastfmRecommender.java index 8660936..90b038b 100644 --- a/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/LastfmRecommender.java +++ b/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/LastfmRecommender.java @@ -18,10 +18,10 @@ import org.apache.mahout.cf.taste.similarity.ItemSimilarity; import org.apache.mahout.cf.taste.similarity.UserSimilarity; -// Program Main Class of Lastfm Recommender +// Program Main class of Lastfm Recommender public class LastfmRecommender { - // Main function + // Input function of the main class public static void main(String[] args) throws IOException, TasteException { Utilities.showMessage("Start process"); diff --git a/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/Utilities.java b/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/Utilities.java index 41b5cb2..35ed45f 100644 --- a/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/Utilities.java +++ b/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/Utilities.java @@ -20,7 +20,7 @@ public class Utilities { public final static boolean debug = true; public final static String separator = "|"; - // Function that create data mode if file exists + // Function that create a data model if file exists public static DataModel createDataModel(String filename) { DataModel model = null; @@ -41,7 +41,7 @@ public static DataModel createDataModel(String filename) { return model; } - // Show into a console the list of recommended items + // Show the list of recommended items in the console public static void showItemList(Integer userID, List recommendations) { if (recommendations != null) { @@ -95,7 +95,7 @@ public static void saveItemList(Integer userID, List recommenda } } - // Show an audit message into a console + // Show an audit message in the console public static void showMessage(String msg) { if (debug) { diff --git a/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/test/LastfmValidation.java b/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/test/LastfmValidation.java index 5c3b787..770f4af 100644 --- a/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/test/LastfmValidation.java +++ b/code/RS_CF_LastFm/src/edu/uniandes/mine/rs/test/LastfmValidation.java @@ -10,14 +10,14 @@ import edu.uniandes.mine.rs.Utilities; -// Test Main Class +// Main class to calculate the accuracy of the models public class LastfmValidation { // Class constants private final static double trainSize = 0.80; private static double testSize = (1 - trainSize); - // Main function + // Input function of the main class public static void main(String[] args) throws IOException, TasteException { Utilities.showMessage("Start process"); String rsType = "USER"; diff --git a/code/RS_CF_LastFm/target/classes/META-INF/maven/uniandes.edu.co.labsrs/uniandes.edu.co.labsrs.mahout/pom.properties b/code/RS_CF_LastFm/target/classes/META-INF/maven/uniandes.edu.co.labsrs/uniandes.edu.co.labsrs.mahout/pom.properties index b0176d2..b783992 100644 --- a/code/RS_CF_LastFm/target/classes/META-INF/maven/uniandes.edu.co.labsrs/uniandes.edu.co.labsrs.mahout/pom.properties +++ b/code/RS_CF_LastFm/target/classes/META-INF/maven/uniandes.edu.co.labsrs/uniandes.edu.co.labsrs.mahout/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Wed May 29 11:54:12 COT 2019 +#Sat Jun 01 12:20:03 COT 2019 version=1.0-SNAPSHOT groupId=uniandes.edu.co.labsrs m2e.projectName=RS_CF_LastFm