Question: python got this error '

python

got this error

'<' not supported between instances of 'str' and 'int'

when i manually assign class weights in logistic regression

weights = {0:0.1, 1:1} X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.15, random_state = 0) lr = LogisticRegression(solver='newton-cg',class_weight=weights)

when i use class_weight='balanced' there is no error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!