Update of /cvsroot/jboost/jboost/src/jboost/booster
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22919
Modified Files:
BrownBoost.java
Log Message:
Added pos and neg values for m_s
Index: BrownBoost.java
===================================================================
RCS file: /cvsroot/jboost/jboost/src/jboost/booster/BrownBoost.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** BrownBoost.java 23 Oct 2007 22:45:40 -0000 1.8
--- BrownBoost.java 13 Dec 2007 07:21:05 -0000 1.9
***************
*** 28,33 ****
--- 28,41 ----
protected double m_s;
+ /** In case we ever want to make BrownBoost cost sensitive. Also useful for Yaba. */
+ protected double m_poss;
+ protected double m_negs;
+
/** The potential loss of each example at the begining of the game. */
protected double m_initialPotential;
+
+ /** The potential loss of each example at the begining of the game. */
+ protected double m_posInitialPotential;
+ protected double m_negInitialPotential;
/** The last value of alpha */
***************
*** 468,471 ****
--- 476,507 ----
+
+ /** output AdaBoost contents as a human-readable string */
+ public String toString() {
+ String s=
+ "BrownBoost. No of examples = "
+ + m_numExamples
+ + ", m_epsilon = "
+ + m_epsilon;
+ s += "\nindex\tmargin\tweight\told weight\tlabel\n";
+ NumberFormat f= new DecimalFormat("0.00");
+ for (int i= 0; i < m_numExamples; i++) {
+ s += " "
+ + i
+ + " \t "
+ + f.format(m_margins[i])
+ + " \t "
+ + f.format(m_weights[i])
+ + " \t "
+ + f.format(m_oldWeights[i])
+ + " \t"
+ + f.format(m_sampleWeights[i]) + "\t\t"
+ + m_labels[i]
+ + "\n";
+ }
+ return s;
+ }
+
+
/**
* BrownBag is identical to BinaryBag, except for the method used to
***************
*** 608,615 ****
*/
public Prediction[] getPredictions(Bag[] bags, int[][] exampleIndex) {
! boolean bagsAreWeightless = true;
for (int i=0; i < bags.length; i++) {
if (!bags[i].isWeightless()) {
! bagsAreWeightless = false;
}
}
--- 644,652 ----
*/
public Prediction[] getPredictions(Bag[] bags, int[][] exampleIndex) {
!
! boolean allBagsAreWeightless = true;
for (int i=0; i < bags.length; i++) {
if (!bags[i].isWeightless()) {
! allBagsAreWeightless = false;
}
}
***************
*** 624,628 ****
* any more iterations.
*/
! if (bagsAreWeightless || m_s < 0) {
for (int i=0; i < bags.length; i++) {
p[i] = getZeroPred();
--- 661,665 ----
* any more iterations.
*/
! if (allBagsAreWeightless || m_s < 0) {
for (int i=0; i < bags.length; i++) {
p[i] = getZeroPred();
|