Functions, the base of Calculus
By: Adrià Serra
Tags: Machine Learning, Calculus, Deep Learning, Data Science, Mathematics

CALCULUS FOR DATA SCIENCE AND MACHINE LEARNING

Functions, the base of Calculus

What most machine learning models want to maximize or minimize

The most important concept of mathematics are the functions, most of the modern mathematics are focused on the study of functions, and machine learning is not different.

The first approach to the definition of function

As first provisional definition, we can say that a function is a rule that assigns each of certain real numbers a real number.

Some examples of functions are:

The rule that assigns each odd number the value 2.

f(x) = 3x + 1.

f(x) = (3x² + 2x) / (x + 1) , except for x = -1.

As you can see in these examples, a function is any rules that map some numbers to other numbers.

The domain of a function

The domain of a function is the set of all the independent variable values where the function returns a value.

In the case of our last example f(x) = (3x² + 2x) / (x + 1), the domain is all the real numbers except -1.

We expressed that this function does not belong to the domain x = -1, but as this range of values can be extracted from the function itself, we can skip this information. It’s compulsory to give this information only when it does not comes with the function definition.

Types of functions

We can divide some of the basic functions into distinct groups.

Polynomial functions

A function is polynomial if there exist some real numbers a_0, … a_n that makes the next function domain is all x:

polynomial function self-generated.

In these functions, x is the maximum exponent value, and it’s called the grade of the function.

Rational Functions

This function has the form p/q where p and q are polynomial functions, and q is not a function with the only values of 0.

An example can be:

Rational function example, self-generated.

Constant function

A function that returns the same value for all x, defined as f(x)=c, where c is a constant value.

Sum, Product and Quotient functions

Given two functions f and g, we can express these operations between them as:

Sum, product, and quotient functions, self-generated.

And we know how the domain of these functions can be obtained from the domain of the original functions as:

The domain of the sum is the sum of the domains.

The domain of the multiplication is the intersection of the domains.

The domain of the quotient is the intersection of the domains minus the values of x that makes g(x) =0.

Composition Function

Given two functions f and g, we define f∘ g as the composition of f and g,

Composition functions, self-generated.

The domain of this function is, x is in the domain of g, and g(x) is in the domain of f.

An example of a composition is:

Example of a composition function, self-generated.

The rigorous definition of Function and Domain

After this introduction to functions, we can well define what is a function and what is the domain of a function:

Function

A function is a collection of pairs of numbers with the following property: of (a,b) and (a,c) are both in the collection then b=c; in other words, the collection mist not contain two different pairs with the same first element.

The domain of a function

If f is a function, the domain of f is the set of all a for which there is some b such that (a,b) is in f. If a is in the domain of f, it follows from the definition of a function that there is a unique number b such that (a,b) is in f. The unique b is denoted by f(x).

Summary

This is the first post of the calculus series, in it we introduced what is a function and some operations between them. Functions are one of the pillars of mathematics. Machine learning techniques try to optimize functions to find the minimum error, and here is where calculus gets involved.