Answers.Body: <blockquote>
  <p>If I understood correctly, the model is a polynomial equation</p>
  </blockquote>
  <p>No, it's not true that <em>all</em> machine learning (ML) models compute (or represent) a polynomial function. For example, a sigmoid is not a polynomial, but, for example, in a neural network, you can combine many sigmoids to build complicated functions that may not necessarily be polynomials.</p>
  <p>We usually distinguish between <strong>linear</strong> (straight-lines) and <strong>non-linear</strong> <em>functions</em> (rather than polynomials and non-polynomials). In some cases, it is straightforward to visualize the function that your model computes: for example, in the case of <a href="https://en.wikipedia.org/wiki/Linear_regression" rel="nofollow noreferrer">linear regression</a>, once you learned the coefficients (i.e. the slope and y-intercept), you can plot the learned straight-line function. In other cases, for example, in the case of <a href="http://neuralnetworksanddeeplearning.com/" rel="nofollow noreferrer">neural networks</a>, it is not fully clear how to visualize the function that your model computes, given that it is the composition of many non-linear functions (typically, ReLUs, sigmoids or hyperbolic tangents).</p>
  <p>If you are interested in solving problems with polynomials, take a look at <a href="https://en.wikipedia.org/wiki/Polynomial_regression" rel="nofollow noreferrer">polynomial regression</a>.</p>
  <blockquote>
  <p>and its weights are calculated by training the model with data sets.</p>
  </blockquote>
  <p>Yes, in machine learning, we want to find a function that &quot;fits the given data&quot;, and the specific meaning of &quot;fitting the data&quot; depends on the specific machine learning technique.</p>
  <p>For simplicity, let's focus on <strong>supervised</strong> learning, a machine learning technique where we are given a <strong>labelled</strong> dataset, i.e. a dataset of pairs <span class="math-container">$D = \{(x_1, y_1), \dots, (x_N, y_N)\}$</span>, where we assume that <span class="math-container">$f(x_i) = y_i$</span>, for some typically unknown function <span class="math-container">$f$</span>, and <span class="math-container">$y_i$</span>s are the <strong>labels</strong> (the outputs of <span class="math-container">$f$</span>) and <span class="math-container">$x_i$</span> the inputs of <span class="math-container">$f$</span>. The goal is to find function <span class="math-container">$g_{\theta}$</span> that approximates well <span class="math-container">$f$</span>. I will soon describe what the subscript <span class="math-container">$\theta$</span> represents.</p>
  <p>For simplicity, let's <strong>assume</strong> that <span class="math-container">$f$</span> is a linear function (i.e. a straight-line). So, we can define a linear model <span class="math-container">$g_{\theta}$</span> that we can use to find a function that approximates well <span class="math-container">$f$</span>. Here is the linear model</p>
  <p><span class="math-container">$$g_{\theta}(x) = ax + b,$$</span></p>
  <p>where</p>
  <ul>
  <li><span class="math-container">$g_{\theta}(x)$</span> is the output</li>
  <li><span class="math-container">$x$</span> is the input</li>
  <li><span class="math-container">$ax + b$</span> is the linear function (a straight-line)</li>
  <li><span class="math-container">$a$</span> is the slope (a parameter, aka weight)</li>
  <li><span class="math-container">$b$</span> is the <span class="math-container">$y$</span>-intercept (another parameter)</li>
  <li><span class="math-container">$\theta = \{ a, b \}$</span> (the set of parameters of the linear model)</li>
  </ul>
  <p><em>Why is this a model?</em> I call this a model because, depending on the <strong>specific</strong> values of the parameters <span class="math-container">$\theta$</span>, we have different specific functions. So, I am using the term &quot;model&quot; as a synonym for a set of functions, which, in this case, are limited by the definition <span class="math-container">$ax + b$</span> and the specific values that <span class="math-container">$a$</span> and <span class="math-container">$b$</span> (i.e. <span class="math-container">$\theta$</span>) can take.</p>
  <p><em>So, what do we do with this linear model?</em> We want to find a specific set of parameters <span class="math-container">$\hat{\theta}$</span> (note that I use the <span class="math-container">$\hat{ }$</span> to emphasize that this is a specific configuration of the variable <span class="math-container">$\theta$</span>) that corresponds to a linear function (a straight-line) that approximates <span class="math-container">$f$</span> well.  In other words, we need to find the parameters <span class="math-container">$\hat{\theta}$</span>, such that <span class="math-container">$g_\hat{\theta} \approx f$</span>, where <span class="math-container">$\approx$</span> means &quot;approximately computes&quot;.</p>
  <p><em>How do we do that?</em> We typically don't know <span class="math-container">$f$</span>, but we know (or assumed) that <span class="math-container">$f(x_i) = y_i$</span>, so the labeled dataset <span class="math-container">$D$</span> contains information about our unknown function <span class="math-container">$f$</span>. So, the idea is that we can use the dataset <span class="math-container">$D$</span> to find a specific set of parameters <span class="math-container">$\hat{\theta}$</span> that corresponds to some function that approximates <span class="math-container">$f$</span> according to the information in <span class="math-container">$D$</span>.</p>
  <p>This process of finding <span class="math-container">$\hat{\theta}$</span> based on <span class="math-container">$D$</span> is often denoted as &quot;fitting the model to the data&quot;. There different ways of fitting the model to the data that differ in the way they compute some notion of distance between the information in <span class="math-container">$D$</span> and <span class="math-container">$g_{\hat{\theta}}$</span>. I will not explain them here because this answer is already quite long. If you want to know more about it, you should take a book about the topic and read it.</p>
  <blockquote>
  <p>What are some examples of functions that machine learning models compute?</p>
  </blockquote>
  <p>I don't have specific examples, but you can easily try to fit a linear regression model to some labelled data, then plot the function that you found. You could use the Python library <a href="https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html" rel="nofollow noreferrer"><code>sklearn</code></a> to do that.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-15T13:33:27.087Z
Answers.LastActivityDate: 2020-09-15T14:23:14.770Z
Answers.LastEditDate: 2020-09-15T14:23:14.770Z
Answers.UserDisplayName: nbro
Body: <p>My simple understanding of AI is that it is based on a mathematical model of a problem. If I understood correctly, the model is a polynomial equation and its weights are calculated by training the model with data sets.</p>
  <p>I am interested to see a few example polynomial equations (trained models) which are used in certain problem areas. I tried to search it, but so far could not find any simple answers.</p>
  <p>Can anyone list a few examples here?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-15T12:13:50.633Z
Comments.Text: Hello. Welcome to AI SE! Can you please cite the article, paper or book that says that "the model is a polynomial equation". We need more context to answer this question properly.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-15T13:11:20.400Z
Comments.Text: It's just my simple understanding. For example there will be a polynomial equation (hyperplane) that will classify the labelled data-set into n-groups.
Comments.UserDisplayName: scico111
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-15T13:43:17.860Z
Comments.Text: I have changed a little bit your question to make it more acceptable. Let me know if this version is still consistent with your original question.
Comments.UserDisplayName: nbro
Tags: <machine-learning><training><datasets><models><weights>
Title: What are some examples of functions that machine learning models compute?
UserDisplayName: scico111
ThreadText: # What are some examples of functions that machine learning models compute?
  
  (Asked by: username_0 on 2020-09-15)
  
  My simple understanding of AI is that it is based on a mathematical model of a problem. If I understood correctly, the model is a polynomial equation and its weights are calculated by training the model with data sets.
  
  I am interested to see a few example polynomial equations (trained models) which are used in certain problem areas. I tried to search it, but so far could not find any simple answers.
  
  Can anyone list a few examples here?
  
  **Tags:** machine-learning, training, datasets, models, weights
  > **Comments:**
  > **username_1**: Hello. Welcome to AI SE! Can you please cite the article, paper or book that says that "the model is a polynomial equation". We need more context to answer this question properly.  
  > **username_0**: It's just my simple understanding. For example there will be a polynomial equation (hyperplane) that will classify the labelled data-set into n-groups.  
  > **username_1**: I have changed a little bit your question to make it more acceptable. Let me know if this version is still consistent with your original question.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-15. Score: 2 | Accepted answer
  
  > If I understood correctly, the model is a polynomial equation
  
  No, it's not true that *all* machine learning (ML) models compute (or represent) a polynomial function. For example, a sigmoid is not a polynomial, but, for example, in a neural network, you can combine many sigmoids to build complicated functions that may not necessarily be polynomials.
  
  We usually distinguish between **linear** (straight-lines) and **non-linear** *functions* (rather than polynomials and non-polynomials). In some cases, it is straightforward to visualize the function that your model computes: for example, in the case of [linear regression](https://en.wikipedia.org/wiki/Linear_regression), once you learned the coefficients (i.e. the slope and y-intercept), you can plot the learned straight-line function. In other cases, for example, in the case of [neural networks](http://neuralnetworksanddeeplearning.com/), it is not fully clear how to visualize the function that your model computes, given that it is the composition of many non-linear functions (typically, ReLUs, sigmoids or hyperbolic tangents).
  
  If you are interested in solving problems with polynomials, take a look at [polynomial regression](https://en.wikipedia.org/wiki/Polynomial_regression).
  
  > and its weights are calculated by training the model with data sets.
  
  Yes, in machine learning, we want to find a function that "fits the given data", and the specific meaning of "fitting the data" depends on the specific machine learning technique.
  
  For simplicity, let's focus on **supervised** learning, a machine learning technique where we are given a **labelled** dataset, i.e. a dataset of pairs $D = \{(x\_1, y\_1), \dots, (x\_N, y\_N)\}$, where we assume that $f(x\_i) = y\_i$, for some typically unknown function $f$, and $y\_i$s are the **labels** (the outputs of $f$) and $x\_i$ the inputs of $f$. The goal is to find function $g\_{\theta}$ that approximates well $f$. I will soon describe what the subscript $\theta$ represents.
  
  For simplicity, let's **assume** that $f$ is a linear function (i.e. a straight-line). So, we can define a linear model $g\_{\theta}$ that we can use to find a function that approximates well $f$. Here is the linear model
  
  $$g\_{\theta}(x) = ax + b,$$
  
  where
  
  * $g\_{\theta}(x)$ is the output
  * $x$ is the input
  * $ax + b$ is the linear function (a straight-line)
  * $a$ is the slope (a parameter, aka weight)
  * $b$ is the $y$-intercept (another parameter)
  * $\theta = \{ a, b \}$ (the set of parameters of the linear model)
  
  *Why is this a model?* I call this a model because, depending on the **specific** values of the parameters $\theta$, we have different specific functions. So, I am using the term "model" as a synonym for a set of functions, which, in this case, are limited by the definition $ax + b$ and the specific values that $a$ and $b$ (i.e. $\theta$) can take.
  
  *So, what do we do with this linear model?* We want to find a specific set of parameters $\hat{\theta}$ (note that I use the $\hat{ }$ to emphasize that this is a specific configuration of the variable $\theta$) that corresponds to a linear function (a straight-line) that approximates $f$ well. In other words, we need to find the parameters $\hat{\theta}$, such that $g\_\hat{\theta} \approx f$, where $\approx$ means "approximately computes".
  
  *How do we do that?* We typically don't know $f$, but we know (or assumed) that $f(x\_i) = y\_i$, so the labeled dataset $D$ contains information about our unknown function $f$. So, the idea is that we can use the dataset $D$ to find a specific set of parameters $\hat{\theta}$ that corresponds to some function that approximates $f$ according to the information in $D$.
  
  This process of finding $\hat{\theta}$ based on $D$ is often denoted as "fitting the model to the data". There different ways of fitting the model to the data that differ in the way they compute some notion of distance between the information in $D$ and $g\_{\hat{\theta}}$. I will not explain them here because this answer is already quite long. If you want to know more about it, you should take a book about the topic and read it.
  
  > What are some examples of functions that machine learning models compute?
  
  I don't have specific examples, but you can easily try to fit a linear regression model to some labelled data, then plot the function that you found. You could use the Python library [`sklearn`](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html) to do that.
  
  
  ---
  
  