intel-analytics / analytics-zoo

Distributed Tensorflow, Keras and PyTorch on Apache Spark/Flink & Ray
https://analytics-zoo.readthedocs.io/
Apache License 2.0
11 stars 3 forks source link

need more metrics(mse, ridge) for regression #1132

Open songhappy opened 5 years ago

songhappy commented 5 years ago

Currently, it only has "mae" for regression, "mse" and "ridge" are needed at least.

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 == "loss":
        return Loss()
    elif metric == "treennaccuracy":
        return TreeNNAccuracy()
    else:
        raise TypeError("Unsupported metric: %s" % metric)
hkvision commented 5 years ago

Seems that in BigDL only MAE is wrapped as a metrics.

hkvision commented 5 years ago

Also, we may need to add some other metrics like the one used by crf for nlp-architect integration.

yangw1234 commented 5 years ago

Maybe enable user to create custom metrics (similar to cusomloss except some metrics may require a custom reducer)?