#NEWLINE# def lr_accuracy( X , y , theta ) : #NEWLINE# #INDENT# theta = theta [ : , np . newaxis ] #NEWLINE# temp = sigmoid ( np . dot ( X , theta ) ) . ravel ( ) #NEWLINE# p = np . zeros ( len ( X ) ) #NEWLINE# p [ ( temp >= 0.5 ) ] = 1 #NEWLINE# return ( np . mean ( ( p == y . ravel ( ) ) ) * 100 )