title: sklearn LabelEncoder : TypeError : '<' not supported between instances of 'int' and 'str'
body: <p>I want to text classification using KNN algorithm. And I have data with .csv extension.
  <a href="https://i.stack.imgur.com/aTZch.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aTZch.png" alt="enter image description here"></a></p>
  
  <p>If I print with this code, the data looks like this:</p>
  
  <pre><code># Preprocessing
  
  X = np.array(dataset.iloc[:, :1])
  y = np.array(dataset['Class'])
  
  print("Data variabel X : ", X)
  print("Data variabel y : ", y)
  </code></pre>
  
  <p><strong>Output :</strong></p>
  
  <pre><code>[['pada awalnya aku memandang gadis itu nani namanya']['dua buah melon yang subur segar']]['Pornografi''Non-Pornografi']
  </code></pre>
  
  <p>And I split for Train and Test:</p>
  
  <pre><code># Train Test Split
  
  from sklearn.model_selection import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20)
  
  # loading library
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.preprocessing import LabelEncoder
  
  # Feature Scaling
  lb = LabelEncoder()  
  lb.fit(X_train)
  
  X_train = lb.transform(X_train)  
  X_test = lb.transform(X_test)
  
  print("X_train : ", X_train)
  print("X_test : ", X_test)
  
  # instantiate learning model (k = 3)
  knn = KNeighborsClassifier(n_neighbors=3)
  
  # fitting the model
  knn.fit([[X_train, y_train]], [y])
  
  # predict the response
  pred = knn.predict(X_test)
  
  # evaluate accuracy
  print (accuracy_score(y_test, pred))
  </code></pre>
  
  <p>I got error message : </p>
  
  <pre><code>    &lt;ipython-input-223-7d80eb4ea7d1&gt; in &lt;module&gt;()
        8 
        9 X_train = lb.transform(X_train)
  ---&gt; 10 X_test = lb.transform(X_test)
       11 
       12 print("X_train : ", X_train)
  TypeError: '&lt;' not supported between instances of 'int' and 'str'
  </code></pre>
  
  <p>Whats wrong with my code?</p>