mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 05:46:24 +02:00
replace np.float by float
This commit is contained in:
parent
a0ced629d3
commit
a6d78d79aa
3 changed files with 256 additions and 173 deletions
|
|
@ -4,18 +4,19 @@
|
|||
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'
|
||||
|
||||
name = "RMSE"
|
||||
|
||||
def evaluate(self, gt, pred):
|
||||
return np.sqrt(np.square(gt-pred).astype(np.float).mean())
|
||||
|
||||
return np.sqrt(np.square(gt - pred).astype(float).mean())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue