function metricname = mapToMetricName(lossname,reverseMap)%
% utility function to map loss function name to Metric name and vice versa

%   Copyright 2020 The MathWorks, Inc.

if nargin == 1
    reverseMap = false;
end

lossnames = {'binodeviance' 'classifedge' 'classiferror' ...
    'exponential' 'hinge' 'quadratic' 'logit' 'mincost' ...
    'mse' 'epsiloninsensitive'};
metricnames = {'BinomialDeviance' 'ClassificationEdge' 'ClassificationError' ...
    'ExponentialLoss' 'HingeLoss' 'QuadraticLoss' 'LogitLoss' 'MinimalCost' ...
    'MeanSquaredError' 'EpsilonInsensitiveLoss'};

if reverseMap
    idx = ismember(metricnames,lossname);
    metricname = lossnames{idx};
else
    idx = ismember(lossnames,lossname);
    metricname = metricnames{idx};
end
end
