/*
 * Copyright [2013-2015] eBay Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ml.shifu.shifu.core;

/**
 * @author xiaobzheng
 * 
 */
public class ConvergeJudger {

    public static boolean isConverged(Double train_err, Double test_err, Double threshold) {
        return (train_err + test_err) / 2 <= threshold ? true : false;
    }

}


@@ -637,16 +637,74 @@
 .core;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 /**%0A * @
@@ -760,16 +760,114 @@
 dger %7B%0A%0A
+    private static final Logger log = LoggerFactory.getLogger(ConvergeJudger.class);%0A            %0A
     publ
@@ -963,14 +963,23 @@
     
-return
+Double avgErr =
  (tr
@@ -1001,16 +1001,90 @@
 err) / 2
+;%0A        log.info(%22Average err now is: %22 + avgErr);%0A        return avgErr
  %3C= thre

add log information showing average error when call isConverged()