How to do power curve fitting in Python?
<p>There is a question about exponential curve fitting, but I didn't find any materials on how to create a power curve fitting, like this:</p>

<pre><code>y = a*x^b
</code></pre>

<p>There is a way to do this in Excel, but is it possible in Python?</p>

<p>Just take logarithms:</p>

<pre><code>y = ax^b
log(y) = log(a) + b*log(x)
</code></pre>

<p>and use a linear fit for the pair <code>log(x)</code> and <code>log(y)</code>. It will result on a line with slope <code>b</code> and intercept <code>log(a)</code>, just take exponential to obtain the parameter <code>a</code>.</p>

python scikit-learn regression