def metrics(self, weights=None):
        """Computes various popular regression metrics for the results.

        The computed metrics are:

        -   Mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
        -   Root mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
        -   Mean absolute error: :func:`sklearn:sklearn.metrics.mean_absolute_error`
        -   Median absolute error: :func:`sklearn:sklearn.metrics.median_absolute_error`
        -   R^2 score: :func:`sklearn:sklearn.metrics.r2_score`
        -   Explained variance score: :func:`sklearn:sklearn.metrics.explained_variance_score`
        -   Max error: :func:`sklearn:sklearn.metrics.max_error`
        -   Support: the number of examples

        Also includes any custom metrics from :attr:`custom_metrics`.

        Args:
            weights (None): an optional list of weights for each example

        Returns:
            a dict
        """
        yt = self.ytrue
        yp = self.ypred
        w = weights

        if yt.size > 0:
            mse = skm.mean_squared_error(yt, yp, sample_weight=w)
            rmse = np.sqrt(mse)
            mae = skm.mean_absolute_error(yt, yp, sample_weight=w)
            median_absolute_error = skm.median_absolute_error(yt, yp)
            r2_score = skm.r2_score(yt, yp, sample_weight=w)
            ev_score = skm.explained_variance_score(yt, yp, sample_weight=w)
            max_error = skm.max_error(yt, yp)
            support = len(yt)
        else:
            mse = 0.0
            rmse = 0.0
            mae = 0.0
            median_absolute_error = 0.0
            r2_score = 0.0
            ev_score = 0.0
            max_error = 0.0
            support = 0

        metrics = {
            "mean_squared_error": mse,
            "root_mean_squared_error": rmse,
            "mean_absolute_error": mae,
            "median_absolute_error": median_absolute_error,
            "r2_score": r2_score,
            "explained_variance_score": ev_score,
            "max_error": max_error,
            "support": support,
        }

        metrics.update(self._get_custom_metrics())

        return metrics
Computes various popular regression metrics for the results.

        The computed metrics are:

        -   Mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
        -   Root mean squared error: :func:`sklearn:sklearn.metrics.mean_squared_error`
        -   Mean absolute error: :func:`sklearn:sklearn.metrics.mean_absolute_error`
        -   Median absolute error: :func:`sklearn:sklearn.metrics.median_absolute_error`
        -   R^2 score: :func:`sklearn:sklearn.metrics.r2_score`
        -   Explained variance score: :func:`sklearn:sklearn.metrics.explained_variance_score`
        -   Max error: :func:`sklearn:sklearn.metrics.max_error`
        -   Support: the number of examples

        Also includes any custom metrics from :attr:`custom_metrics`.

        Args:
            weights (None): an optional list of weights for each example

        Returns:
            a dict
        
fiftyone/utils/eval/regression.py