def testProjectionNegativeFromNegative(self): cone = ConeEstimatorBase(2) projected = cone.project([[1.,-0.5]],[0]) self.assertAlmostEqual(projected, [1.,-0.5])
def testProjectionPositiveFromNegativeEpsilon(self): cone = ConeEstimatorBase(2, epsilon=0.5) projected = cone.project([[1.,-0.9]],[1]) self.assertAlmostEqual(projected, [1,-0.5])
def testProjectionPositiveFromPositive(self): cone = ConeEstimatorBase(2) projected = cone.project([[1.,1.]],[1]) self.assertAlmostEqual(projected, [1.,1.])