Here's my problem scenario:- I have to come up with a power equation as a function of frequency. The plot fits well with a higher order polynomial (4th or 6th) :-

$$Power = \theta_0 + \theta_1 fr^1 + \ldots + \theta_6*fr^6$$

(This is from MS Excel's trend line for a scattered plot) Frequency (x axis) ranges within fixed limits $f_1$ to $f_2$ and I have data from $100$ different devices for this kind of frequency sweep.

With this limited data set what would be a good ML model to train and generalize the coefficients that would work for any unseen device?

Thanks in advance!


While I can't share the exact data-set here but let me share some info about the data- $fr$ ranges from $4060(f_1)$ to $4165(f_2)$; I have an option to go granular i.e step size of $+1$ .. currently I am going $+5$

Visualizing the data frame

Where $Pij$ is the power value for the $i$th device and $j$th frequency sample Question: Shall I treat each device as an example and each frequency as a feature? In that case the problem becomes multi-variate and I don't want that. I want the equation to remain exactly as stated above. The more desired option is to treat each frequency as an example, then how do I treat each of the $100$ devices? definitely not as features.. How to model the problem space into a feature vector $X$ and ans vector $Y$ and param vector $\theta$?

  • $\begingroup$ I am still a little confused. Is the $fr$ column numerical data? Based on what you have written, I have to assume it is. What does P0_21 represent? is this the power value? If not, where is the Power value that will be used to derive the $\theta$? $\endgroup$
    – Skiddles
    Commented Nov 30, 2018 at 13:05
  • 1
    $\begingroup$ Here I meant to say $Pij$ is the power value for the $i$th device and $j$th frequency sample $\endgroup$
    – Zakir
    Commented Nov 30, 2018 at 19:11

1 Answer 1


Your question is not very specific. I am assuming that you are looking for the full solution (Language, package, function, template). So with that in mind I'll point you to the following question: Polynomial regression using scikit-learn

Half way down the answers is a solution by Salvador Dali for:

Language: Python
Function: linear_model.LinearRegression()
  • $\begingroup$ Thanks for your response .. I guess my question was not very clear - I will update the question for detailed insights $\endgroup$
    – Zakir
    Commented Nov 30, 2018 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.