(self, predict_wx, threshold)
return predict_table
convert a probability table into a predicted class table.
convert a probability table into a predicted class table.
convert a probability table into a predicted class table .
def classify(self, predict_wx, threshold):
        """
        convert a probability table into a predicted class table.
        """

        # predict_wx = self.compute_wx(data_instances, self.model_weights.coef_, self.model_weights.intercept_)

        def predict(x):
            prob = activation.sigmoid(x)
            pred_label = 1 if prob > threshold else 0
            return prob, pred_label

        predict_table = predict_wx.mapValues(predict)
        return predict_table
def classify ( self , predict_wx , threshold ) : # predict_wx = self.compute_wx(data_instances, self.model_weights.coef_, self.model_weights.intercept_) def predict ( x ) : prob = activation . sigmoid ( x ) pred_label = 1 if prob > threshold else 0 return prob , pred_label predict_table = predict_wx . mapValues ( predict ) return predict_table