original_docstring: Returns sigmoid cost function result. Regularization is optional.
  
          :param theta: ndarray; vector of weights.
          :param x: 2D ndarray; training data, examples in rows, features in cols.
          :param y: ndarray; (n, 1) shape.
          :param Lambda: int, float; If value is passed, regularization term will be added.
          :return: float; cost.
          
docstring: Returns sigmoid cost function result. Regularization is optional.
docstring_tokens: Returns sigmoid cost function result . Regularization is optional .
code: def sigmoid_cost(theta, x, y, Lambda=None):
          """Returns sigmoid cost function result. Regularization is optional.
  
          :param theta: ndarray; vector of weights.
          :param x: 2D ndarray; training data, examples in rows, features in cols.
          :param y: ndarray; (n, 1) shape.
          :param Lambda: int, float; If value is passed, regularization term will be added.
          :return: float; cost.
          """
          theta = theta.reshape(1, x.shape[1])
          h = x @ theta.T
          a = MLFuncts.sigmoid(h)
          cost = -(np.sum([y * np.log(a) + (1 - y) * np.log(1 - a)])) / x.shape[0]
          if Lambda:
              cost += MLFuncts.regularize(theta, Lambda, x.shape[0], 'cost')
          return cost
code_tokens: def sigmoid_cost ( theta , x , y , Lambda = None ) : theta = theta . reshape ( 1 , x . shape [ 1 ] ) h = x @ theta . T a = MLFuncts . sigmoid ( h ) cost = - ( np . sum ( [ y * np . log ( a ) + ( 1 - y ) * np . log ( 1 - a ) ] ) ) / x . shape [ 0 ] if Lambda : cost += MLFuncts . regularize ( theta , Lambda , x . shape [ 0 ] , 'cost' ) return cost
short_docstring: Returns sigmoid cost function result.
short_docstring_tokens: Returns sigmoid cost function result .
comment: """Returns sigmoid cost function result. Regularization is optional.
  
          :param theta: ndarray; vector of weights.
          :param x: 2D ndarray; training data, examples in rows, features in cols.
          :param y: ndarray; (n, 1) shape.
          :param Lambda: int, float; If value is passed, regularization term will be added.
          :return: float; cost.
          """