# Understanding Linear and Nonlinear Functions

In the Machine Learning Fundamentals course, we explored the machine learning workflow using the k-nearest neighbors algorithm. We chose the k-nearest neighbors algorithm because building the intuition for how the algorithm works doesn’t require much mathematics. While the algorithm is easy to grasp, we can’t use it for larger datasets because the model itself is represented using the entire training set.

In most of the machine learning techniques we’ll learn about next, the model is represented as a mathematical function. This mathematical function approximates the underlying function that describes how the features are related to the target attribute.

Before we learn about linear regression models for machine learning, we’ll need to understand some key ideas from calculus. Calculus provides a framework for understanding how mathematical functions behave. Calculus helps us:

• Understand the steepness at various points on a curve.
• Find the extreme points in a function.
• Determine the optimal function that best represents a dataset.

In this lesson, you will learn the basics of slope, an important calculus concept for machine learning. You will explore what linear functions are, as well as learning about the slope and y-intercept. After learning about linear functions, you will learn about nonlinear functions and how the concept of slope can be applied to nonlinear functions.

As you work through each concept, you’ll get to apply what you’ve learned from within your browser so that there’s no need to use your own machine to do the exercises. The Python environment inside of this course includes answer checking so you can ensure that you’ve fully mastered each concept before learning the next concept.

## Objectives

• How to decompose a linear equation into slope and y-intercept.
• The intuition behind slope.

## Lesson Outline

1. Why Learn Calculus?
2. Linear Function
3. Slope and y-intercept
4. Math Behind Slope
5. Nonlinear function
6. Secant Lines
7. Secant Lines And Slope
8. Tangent Line
9. Next Steps
10. Takeaways