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