Having tried Stephen with my example, I also ran into an error:
ValueError: each row of data needs 5 entries, only 2 entries given
Here is a more explicit example that I tested to work in sage 4.7.
sage: l=[4*i^2+7*i+134+random() for i in xrange(100)] sage: var('a,b,c,x') (a, b, c, x) sage: model=a*x^2+b*x+c sage: find_fit(zip(xrange(100),l),model,variables=[x]) [a == 4.0000723084513217, b == 6.9904742307159697, c == 134.74698715254667]
Apparently you will need the variables = [x] to pass sage which of a, b, c and x corresponds to the variable in your model.
source share