New answers tagged


class_weight does not influence the composition of the batches. Instead, it applies a weight to the loss function that depends on the weight of the class.


predict_proba method will return a numpy array of shape (n_samples,2) with the probability of Y == 1 and Y == 0 but you need to pass only the probability of Y == 1 for roc calculation so: from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression X, y = load_iris(return_X_y=True) clf = LogisticRegression(solver="liblinear&...


Sentiment detection can be ambiguous & sometimes ill-defined. So only once you know your data is cleanly labeled, balanced & well pre-processed, I would then continue to re-modeling. Detecting neutrals via thresholding off from a binary classifier is interesting but won't give you much lift because neutrals aren't necessarily the "absence of&...

Top 50 recent answers are included