Learn practical skills, build real-world projects, and advance your career

Notebook imports and packages

import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from sympy import symbols, diff
from math import log
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error

!pip install jovian --upgrade --quiet
import jovian

jovian.commit(project= '03 Gradient Descent')

%matplotlib inline 

Example 1 - A simple cost function

f(x)=x2+x+1f(x) = x^2+x + 1

# Cost fucntion 

def f(x):
    return x**2 + x + 1
# Make data 

x_1 = np.linspace(-3,3,500)