title: Type error during training of Decision Tree model in Python?
body: <p>I have code and error like below, where is the mistake ? What can I do? when i use this code for other model everything was good:</p>
  <pre><code>X_DT = data_modelling.loc[:, data.columns != &quot;wine_type&quot;]
  y_DT = data_modelling.loc[:, data.columns == &quot;wine_type&quot;]
  
  #Loop to find optimal train / test split
  for k in range(1, 10):
      X_train_DT, X_test_DT, y_train_DT, y_test_DT = train_test_split(X_DT,
                                                                      y_DT,
                                                                      test_size = 0.1*k,
                                                                      random_state = 777)
      
      
      DT = DecisionTreeClassifier(criterion = &quot;gini&quot;,
                                  splitter = &quot;random&quot;,
                                  max_depth = 12,
                                  min_samples_split = 2,
                                  min_samples_leaf = 3,
                                  max_features = sqrt)
      DT.fit(X = X_train_DT, y = y_train_DT)
      
      prediction_train_DT = DT.predict(X_train_DT)
      #Prediction on test dataset
      prediction_test_DT = DT.predict(X_test_DT)
      
      #Printing results
      print(f&quot;test: {k/10}, Train AUC:&quot;, round(roc_auc_score(y_train_DT, prediction_train_DT), 3),
            &quot;Test AUC:&quot;, round(roc_auc_score(y_test_DT, prediction_test_DT), 3))
  </code></pre>
  <p>and mistake:
  TypeError: '&gt;' not supported between instances of 'numpy.ufunc' and 'float'</p>
  <p>screen of error :
  <a href="https://i.stack.imgur.com/Ym6A1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ym6A1.png" alt="enter image description here" /></a></p>