Apr-11-2019, 11:46 AM
To solve this, we need to know content of the file "iris.csv". It seems that it hasn't been properly loaded or has column names
differ from those you are used in line #7.
It would be better, if you passed numpy arrays to scikit-learn classifiers (not data frames), e.g.
differ from those you are used in line #7.
It would be better, if you passed numpy arrays to scikit-learn classifiers (not data frames), e.g.
X = csv[[...column names go here...]].values # gets numpy array y = csv["grouping variable name goes here"].values # gets numpy array # you need to encode grouping variable y, e.g. using LabelEncoder from scikit-learn. # you probably need to do column-wise scaling of your data, # e.g. using StandardScaler or Pandas facilities. # do splitting, training and testing with X, y and scikit-learn