You misunderstood how train_test_split
works, if you read the docs properly, you can't miss the example:
X_train, X_test, y_train, y_test = train_test_split(...)
Your code:
x_train,y_train,x_test,y_test=train_test_split(x,y,test_size=0.2,random_state=2020)
needs to be changed in this way:
x_train, x_test, y_train, y_test=train_test_split(x,y,test_size=0.2,random_state=2020)
The rest of the code will then run.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…