Created
January 30, 2022 12:04
-
-
Save sunilkumardash9/8c91bdf0436d9ef86be2751acf5be688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fit(self,X,y,alpha=0.001,iter=400): | |
weights,X = self.initialize(X) | |
cost_list = np.zeros(iter,) | |
for i in range(iter): | |
weights = weights-alpha*dot(X.T,self.sigmoid(dot(X,weights))-np.reshape(y,(len(y),1))) | |
cost_list[i] = cost(weights) | |
self.weights = weights | |
return cost_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment