Parameters

Learn about machine learning models' parameters, hyperparameters, and their importance.

Parametric model

Parametric models are functions defined by a fixed set of parameters in machine learning. These are assumed to be able to approximate the underlying pattern of the data. By adjusting the values of the parameters during the training process, these models can learn to fit the data and make accurate predictions on new inputs. Consider this function: f(x1,x2)=2x13x2+7f(x_1,x_2)=2x_1-3x_2+7 with inputs x1x_1 and x2x_2. This function is an instance of a class of functions of the form fw1,w2,w0(x1,x2)=w1x1+w2x2+w0f_{w_1,w_2,w_0}(x_1,x_2)=w_1x_1+w_2x_2+w_0, where w1=2,w2=3w_1=2,w_2=-3, and w0=7w_0=7. Here, w1,w2w_1,w_2, and w0w_0 are the parameters, also known as weights, and any choice of these parameters results in an instance from the function class. Notice that the function f(x1,x2)=2x13x2+7f(x_1,x_2)=2x_1-3x_2+7 is also an instance of the following different function class:

fw1,w2,w3,w4,w0(x1,x2)=w1x1+w2x2+w3x12+w4x22+w0f_{w_1,w_2,w_3,w_4,w_0}(x_1,x_2)=w_1x_1+w_2x_2+w_3x_1^2+w_4x_2^2+w_0

where w1=2,w2=3,w3=0,w4=0w_1=2,w_2=-3,w_3=0,w_4=0, and w0=7w_0=7

Examples

  • fm,c(x)=mx+cf_{m,c}(x)=mx+c is a function class parametrized by mm and cc, and it represents all the lines in 2D.
  • fw1,w2,w3,,wn(x1,x2,x3,,xn)=i=1nwixif_{w_1,w_2,w_3,\dots,w_n}(x_1,x_2,x_3,\dots,x_n)=\sum_{i=1}^nw_ix_i is a class of functions that represents the weighted average of a set of objects xix_i. In this case, all the parameters wiw_i are non-negative and add up to 11.

Note: In general if x\bold x represents the input and w\bold w represents the set of parameters, then fw(x)f_{\bold w}(\bold x) is the representation of the parametric model.

Let’s take a simple example of a line in 2D as a parametric model and implement it. Try to visualize different instances of this class by changing parameters m and c in line 15 of the code.

Get hands-on with 1200+ tech skills courses.