nowafter defining the loss function our prime goal is to minimize the loss function it can be done with the help of fitting the weights which means by increasing or decreasing the weights with the help of derivatives of the loss function each weightwe would be able to know what parameters should have high weight and what should have smaller weight the following gradient descent equation tells us how loss would change if we modified the parametersj( ( (xyj implementation in python now we will implement the above concept of binomial logistic regression in python for this purposewe are using multivariate flower dataset named 'iriswhich have classes of instances eachbut we will be using the first two feature columns every class represents type of iris flower firstwe need to import the necessary libraries as followsimport numpy as np import matplotlib pyplot as plt import seaborn as sns from sklearn import datasets nextload the iris dataset as followsiris datasets load_iris( iris data[:: (iris target ! we can plot our training data followsplt figure(figsize=( )plt scatter( [ = ][: ] [ = ][: ]color=' 'label=' 'plt scatter( [ = ][: ] [ = ][: ]color=' 'label=' 'plt legend()