Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help; iris-train
#2
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.

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
Reply


Messages In This Thread
Need help; iris-train - by Karin - Apr-11-2019, 09:42 AM
RE: Need help; iris-train - by scidam - Apr-11-2019, 11:46 AM
RE: Need help; iris-train - by Karin - Apr-12-2019, 02:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is my train and test accuracy so low? python420 0 2,067 Dec-08-2019, 08:51 PM
Last Post: python420
  Partitioning when splitting data into train and test-dataset Den0st 0 1,992 Dec-07-2019, 08:31 PM
Last Post: Den0st
  How to define train set and test set Raj 6 7,922 Mar-08-2018, 01:04 PM
Last Post: Raj

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020