def _to_bigdl_metric(metric): metric = metric.lower() if metric == "accuracy" or metric == "acc": return metrics.Accuracy() elif metric == "top5accuracy" or metric == "top5acc": return metrics.Top5Accuracy() elif metric == "mae": from bigdl.optim.optimizer import MAE return MAE() elif metric == "auc": return metrics.AUC() elif metric == "treennaccuracy": return TreeNNAccuracy() else: raise TypeError("Unsupported metric: %s" % metric)
def to_bigdl_metric(metric): metric = metric.lower() if metric == "accuracy" or metric == "acc": return metrics.Accuracy() elif metric == "top5accuracy" or metric == "top5acc": return metrics.Top5Accuracy() elif metric == "mae": return MAE() elif metric == "auc": return metrics.AUC() elif metric == "loss": return Loss() elif metric == "treennaccuracy": return TreeNNAccuracy() else: raise TypeError("Unsupported metric: %s" % metric)