Skip to content
Sign upLog in
← Back to Community

sklearn error

Profile icon
Leroy01010

the package isn't working if you have the solution please tell me

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
AbhayShukla8
Profile icon
retronbv
Profile icon
AmarachiAnyanwu
Profile icon
Leroy01010
Comments
hotnewtop
Profile icon
Coder100

Hello. I found your error!
image


You forgot a parenthesis.
Fixed code:

from sklearn import datasets from sklearn.model_selection import train_test_split iris = datasets.load_iris() features = iris.data labels = iris.target features_train, features_test, labels_train, labels_test, = train_test_split(features, labels, test_size=.5) print(features_train)
Profile icon
Leroy01010

thanks


@Coder100

Profile icon
Muffinlavania

@Leroy01010
i thought you asked about the package...

Profile icon
Leroy01010

sorry i didn't explain it properly

@Muffinlavania

Profile icon
Muffinlavania

@Leroy01010

image

f in chat

Profile icon
Leroy01010

XP

@Muffinlavania

Profile icon
Coder100

no problem! :D

@Leroy01010

Profile icon
Muffinlavania

It works for me, you just have to wait a minute for everything to update and install

Profile icon
Leroy01010
Profile icon
Muffinlavania

@Leroy01010
yes, just hit run and it works for me

image


Then more

image

Then it runs