Skip to content

Commit

Permalink
Code Readme
Browse files Browse the repository at this point in the history
Added the readme.md file of the code and also more description in the methods of the classes.
  • Loading branch information
ansegura7 committed Jun 1, 2019
1 parent d250cc9 commit 4e04b1e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 8 deletions.
40 changes: 40 additions & 0 deletions code/README.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
6 changes: 3 additions & 3 deletions code/RS_CF_LastFm/src/edu/uniandes/mine/rs/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<RecommendedItem> recommendations) {

if (recommendations != null) {
Expand Down Expand Up @@ -95,7 +95,7 @@ public static void saveItemList(Integer userID, List<RecommendedItem> recommenda
}
}

// Show an audit message into a console
// Show an audit message in the console
public static void showMessage(String msg) {

if (debug) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4e04b1e

Please sign in to comment.