-1

I am trying to clean my data in python using sklearn.neighbors.KNeighborsClassifier. In the fit function of classifier I have provide training data in the form of a DataTable generated by Pandas from a csv file.

The fit function throws an error

could not convert string to float : "training data's first cell value".

How can I use the training data of tabular form of strings?

I am working on Kaggle Titanic dataset.

Patrick Trentin
  • 7,126
  • 3
  • 23
  • 40
Zeshan Khan
  • 294
  • 2
  • 15

1 Answers1

1

You have to define a metrics for your classifier. Otherwise, the clustering does not have a clue, what he has to do with strings. Look at this thread, which is probably the same:

https://stackoverflow.com/a/35283104/2151532

loose11
  • 607
  • 6
  • 31