Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_maths/test_fit_function.py   cogent(Download)
from numpy.random import rand
from cogent.util.unit_test import TestCase, main
from cogent.maths.fit_function import fit_function
 
__author__ = "Antonio Gonzalez Pena"
        y_noise = y + rand(len(x))
 
        params = fit_function(x, y_noise, f, 1, 5)
 
        self.assertFloatEqual(params, exp_params , .5)
        y_noise = y + rand(len(y))
 
        params = fit_function(x, y_noise, f, 2, 5)
 
        self.assertFloatEqual(params, exp_params , .5)
        y_noise = y + rand(len(y))
 
        params = fit_function(x, y_noise, f, 2, 5)
 
        self.assertFloatEqual(params, exp_params , .5)

src/p/y/pycogent-HEAD/tests/test_maths/test_fit_function.py   pycogent(Download)
from numpy.random import rand
from cogent.util.unit_test import TestCase, main
from cogent.maths.fit_function import fit_function
 
__author__ = "Antonio Gonzalez Pena"
        y_noise = y + rand(len(x))
 
        params = fit_function(x, y_noise, f, 1, 5)
 
        self.assertFloatEqual(params, exp_params , .5)
        y_noise = y + rand(len(y))
 
        params = fit_function(x, y_noise, f, 2, 5)
 
        self.assertFloatEqual(params, exp_params , .5)
        y_noise = y + rand(len(y))
 
        params = fit_function(x, y_noise, f, 2, 5)
 
        self.assertFloatEqual(params, exp_params , .5)