mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 22:06:22 +02:00
add the regression benchmark
This commit is contained in:
parent
f221a3b1fa
commit
60aa865631
7 changed files with 310 additions and 2 deletions
21
benchmarks/regression/evaluation.py
Normal file
21
benchmarks/regression/evaluation.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright (c) 2015, Zhenwen Dai
|
||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||
|
||||
import abc
|
||||
import numpy as np
|
||||
|
||||
class Evaluation(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@abc.abstractmethod
|
||||
def evaluate(self, gt, pred):
|
||||
"""Compute a scalar for access the performance"""
|
||||
return None
|
||||
|
||||
class RMSE(Evaluation):
|
||||
"Rooted Mean Square Error"
|
||||
name = 'RMSE'
|
||||
|
||||
def evaluate(self, gt, pred):
|
||||
return np.sqrt(np.square(gt-pred).astype(np.float).mean())
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue