Created
January 30, 2022 12:05
-
-
Save sunilkumardash9/8f17862aea2559b814378332ee3338e3 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 cost_func(self,theta): | |
z = dot(X,theta) | |
cost0 = y.T.dot(log(self.sigmoid(z))) | |
cost1 = (1-y).T.dot(log(1-self.sigmoid(z))) | |
cost = -(sum(cost1 + cost0))/len(y) | |
return cos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment