pyepo.metric.metrics ==================== .. py:module:: pyepo.metric.metrics .. autoapi-nested-parse:: Metrics for SKlearn model Functions --------- .. autoapisummary:: pyepo.metric.metrics.SPOError pyepo.metric.metrics.makeSkScorer pyepo.metric.metrics.makeAutoSkScorer Module Contents --------------- .. py:function:: SPOError(pred_cost: numpy.ndarray, true_cost: numpy.ndarray, optmodel: pyepo.model.opt.optModel) -> float Normalized true regret of predicted costs over a dataset. Solves each instance at the predicted and the true cost and returns :math:`\sum_i l_i / \sum_i |z^*(\mathbf{c}_i)|`; instances with near-zero true optima inflate the ratio. :param pred_cost: predicted costs of shape (num_data, num_cost) :param true_cost: true costs of shape (num_data, num_cost) :param optmodel: a PyEPO optimization model :returns: normalized regret :rtype: float .. py:function:: makeSkScorer(optmodel: pyepo.model.opt.optModel) -> Callable A function to create sklearn scorer :param optmodel: optimization model :returns: callable object that returns a scalar score; less is better. :rtype: scorer .. py:function:: makeAutoSkScorer(optmodel: pyepo.model.opt.optModel) -> Callable A function to create Auto-SKlearn scorer :param optmodel: optimization model :returns: callable object that returns a scalar score; less is better. :rtype: scorer