Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MACHINE LEARNING QUESTION, USE JUPYTER LAB, NO AI PLZ: import this: import sys from packaging import version import sklearn import matplotlib.pyplot as plt import numpy
MACHINE LEARNING QUESTION, USE JUPYTER LAB, NO AI PLZ:
import this:
import sys
from packaging import version
import sklearn
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import adddummyfeature
import numpy as np
from sklearn import metrics #Import scikitlearn metrics module for accuracy calculation
from sklearn.modelselection import traintestsplit
from sklearn.metrics import confusionmatrix, ConfusionMatrixDisplay
from sklearn.datasets import makeblobs
printSklearn package",sysversioninfo
printSklearn package",sklearn.version
assert sysversioninfo
#assert version.parsesklearnversion version.parse
pltrcfont size
pltrcaxes labelsize titlesize
pltrclegend fontsize
pltrcxtick labelsize
pltrcytick labelsize
Questions:
# Q Gradient Descent
## Write a gradient descent method that finds the minimum for this function:
$fxxx$
def fx:
returnxx x
X nplinspace
y fx for x in X
pltfigurefigsize
pltplotX y linewidth
pltxlabelr$x$
pltylabelr$fx$
pltgrid
pltshow
## Plot fx vs iteration
## Use these initial parameters
eta # learning rate
nepochs
theta
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started