8000 fixed a bug and code cleanup · ebx/mltk@d378b6a · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
fixed a bug and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlou committed Mar 9, 2016
1 parent 2e25037 commit d378b6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/mltk/predictor/evaluation/AUC.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private class DoublePairComparator implements Comparator<DoublePair> {
public int compare(DoublePair o1, DoublePair o2) {
int cmp = Double.compare(o1.v1, o2.v1);
if (cmp == 0) {
cmp = Double.compare(o2.v2, o2.v2);
cmp = Double.compare(o1.v2, o2.v2);
}
return cmp;
}
Expand Down
18 changes: 8 additions & 10 deletions src/mltk/predictor/glm/ElasticNetLearner.java
Original file line number Diff line number Diff line change
Expand Up @@ -1130,11 +1130,10 @@ protected void doOnePassBinomial(double[][] x, double[] theta, double[] y, final
double eta = VectorUtils.dotProduct(rTrain, v);

double newW = w[j] * theta[j] + eta;
double t = tl1;
if (newW > t) {
newW -= t;
} else if (newW < -t) {
newW += t;
if (newW > tl1) {
newW -= tl1;
} else if (newW < -tl1) {
newW += tl1;
} else {
newW = 0;
}
Expand Down Expand Up @@ -1167,11 +1166,10 @@ protected void doOnePassBinomial(int[][] indices, double[][] values, double[] th
}

double newW = w[j] * theta[j] + eta;
double t = tl1;
if (newW > t) {
newW -= t;
} else if (newW < -t) {
newW += t;
if (newW > tl1) {
newW -= tl1;
} else if (newW < -tl1) {
newW += tl1;
} else {
newW = 0;
}
Expand Down

0 comments on commit d378b6a

Please sign in to comment.
0