Linear Systems
Learn about linear systems and their applications in data science.
Now that we’re familiar with linear functions and linear combinations, let’s dive into the process of using these concepts to define real-life systems as mathematical systems.
Linear modeling
We often come across data consisting of several attributes of interest to us. For example, the records of COVID-19 patients contain many attributes worth recording, including confirmation data, fever level, blood cell counts, medicine in use, and so on. One important attribute is the survival rate, which may depend on the other attributes. If we think that there are attributes in numeric form that are represented as vectors or arrays, then a typical record looks like the following: . The corresponding attribute, survival, can be denoted with having either the values, or , corresponding to “did not survive” and “survived,” respectively. If there’s a linear relationship between and , then there exists a linear function with parameters that maps to : . Although we don’t know if the linear relationship holds, we know that if it does, then: .
Linear equation
An equation of the form is called linear in if and are given. For example, with , if we think of the record to be represented as , and we assume that the patient survived, say, , then the above equation becomes
Example 1: One linear equation
For what values of and , ?
Solution: There are several solutions to this problem. For example, if we set , then . Also, if we set , then . So, and are two solutions. In general, if we set , then . So, for every choice of , we have a solution .
The following code prints k solutions to every equation in variables w1
and w2
, provided that x1
isn’t zero.
Get hands-on with 1400+ tech skills courses.