#NEWLINE# @ matrix_args #NEWLINE# def cf_lr( theta , X , y ) : #NEWLINE# #INDENT# theta = theta . T #NEWLINE# m = len ( y ) #NEWLINE# Z = sigmoid ( ( X * theta ) ) #NEWLINE# J = ( ( ( ( - y . T ) * np . log ( Z ) ) - ( ( 1 - y ) . T * np . log ( ( 1 - Z ) ) ) ) / m ) #NEWLINE# return J [ ( 0 , 0 ) ]