Skip to content

Commit

Permalink
Set Default Algorithm Name
Browse files Browse the repository at this point in the history
  • Loading branch information
guoguibing committed Jun 30, 2014
1 parent b0db377 commit 25aa3ab
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 29 deletions.
3 changes: 0 additions & 3 deletions librec/src/main/java/librec/ext/AR.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public class AR extends Recommender {
public AR(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

// Association rules recommender
algoName = "AR";

// cannot predict ratings, but only order preferences
isRankingPred = true;
}
Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/ext/NMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class NMF extends IterativeRecommender {
public NMF(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "NMF";

// no need to update learning rate
lRate = -1;
}
Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/ext/PD.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public class PD extends Recommender {

public PD(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "PD";
}

@Override
Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/ext/PRankD.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public class PRankD extends RankSGD {
public PRankD(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "PRankD";
isRankingPred = true;
}

Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/ext/SlopeOne.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public class SlopeOne extends Recommender {

public SlopeOne(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "SlopeOne";
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions librec/src/main/java/librec/intf/Recommender.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public Recommender(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold)
numRates = trainMatrix.size();
globalMean = trainMatrix.sum() / numRates;

// class name as the default algorithm name
algoName = this.getClass().getSimpleName();

// fold info
foldInfo = fold > 0 ? " fold [" + fold + "]" : "";

Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/ranking/BPRMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class BPRMF extends IterativeRecommender {
public BPRMF(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "BPRMF";
isRankingPred = true;
initByNorm = false;

Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/ranking/CLiMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public class CLiMF extends IterativeRecommender {

public CLiMF(SparseMatrix rm, SparseMatrix tm, int fold) {
super(rm, tm, fold);

algoName = "CLiMF";
}

@Override
Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/ranking/RankALS.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class RankALS extends IterativeRecommender {
public RankALS(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "RankALS";
isRankingPred = true;
}

Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/ranking/RankSGD.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class RankSGD extends IterativeRecommender {
public RankSGD(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "RankSGD";
isRankingPred = true;
}

Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/ranking/WRMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class WRMF extends IterativeRecommender {
public WRMF(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "WRMF";
isRankingPred = true; // item recommendation

alpha = cf.getDouble("WRMF.alpha");
Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/rating/BiasedMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class BiasedMF extends IterativeRecommender {

public BiasedMF(SparseMatrix rm, SparseMatrix tm, int fold) {
super(rm, tm, fold);

algoName = "BiasedMF";
}

protected void initModel() {
Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/rating/ItemKNN.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public class ItemKNN extends Recommender {
public ItemKNN(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "ItemKNN";
knn = cf.getInt("num.neighbors");
}

Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/rating/PMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class PMF extends IterativeRecommender {
public PMF(SparseMatrix rm, SparseMatrix tm, int fold) {
super(rm, tm, fold);

algoName = "PMF";

// disable bold driver
isBoldDriver = false;

Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/rating/RSTE.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public class RSTE extends SocialRecommender {
public RSTE(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "RSTE";

initByNorm = false;
alpha = cf.getDouble("RSTE.alpha");
}
Expand Down
2 changes: 0 additions & 2 deletions librec/src/main/java/librec/rating/RegSVD.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public class RegSVD extends IterativeRecommender {

public RegSVD(SparseMatrix rm, SparseMatrix tm, int fold) {
super(rm, tm, fold);

algoName = "RegSVD";
}

@Override
Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/rating/SoRec.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class SoRec extends SocialRecommender {
public SoRec(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "SoRec";
initByNorm = false;
}

Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/rating/SoReg.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class SoReg extends SocialRecommender {
public SoReg(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "SoReg";
initByNorm = false;
}

Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/rating/SocialMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class SocialMF extends SocialRecommender {
public SocialMF(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "SocialMF";
initByNorm = false;
}

Expand Down
1 change: 0 additions & 1 deletion librec/src/main/java/librec/rating/UserKNN.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public class UserKNN extends Recommender {
public UserKNN(SparseMatrix trainMatrix, SparseMatrix testMatrix, int fold) {
super(trainMatrix, testMatrix, fold);

algoName = "UserKNN";
knn = cf.getInt("num.neighbors");
}

Expand Down

0 comments on commit 25aa3ab

Please sign in to comment.