The two things, i.e. using class_weight=balanced
, and the specific accuracy measure (balanced or not) you will choose to assess your results, are actually irrelevant between them.
Starting from the latter: classification performance metrics like the accuracy (in any version) are not involved in any way in model fitting - only the loss does; you may find my answer in Loss & accuracy - Are these reasonable learning curves? useful in clarifying the relation between these two quantities (although the discussion there is about Keras, the rationale is in fact generally applicable). The exact performance metric to choose depends on your actual business problem, and it is not actually part of the modelling problem. Moreover, as already said, it will not affect the training in any way.
Employing class_weight
, on the other hand, will affect how the algorithm weights the samples belonging to different classes for computing the loss during training, and that's all; it is neither applicable during inference (when the classes are actually unknown), nor it has anything to do with how (i.e. using what metric) we will do our performance assessment (which, again, is part of the business problem and not the modelling).
All in all, all combinations are in principle valid here: using class_weight='balanced'
(alone or possibly combined with sample_weight
) or not with either of the two versions of the accuracy (simple or balanced). Or, to answer the question as posed in the title - it can, but it doesn't need to.
Speaking of sample_weight
: if you choose to use it with the fit()
method of Logistic Regression, and you furthermore choose to use the balanced accuracy (which requires a sample_weight
argument), it would certainly sound reasonable to use common values for both; but again, this is just that - a reasonable approach, not a rule or a strict requirement, and you should feel free not to do so if you have reasons not to.
Let me explicitly clarify that what is said above stems from very fundamental principles; it is thus generally applicable, and it has nothing specifically to do with any scikit-learn internals.