title: Is it possible to predict just one row from my data set?
body: <p>I have a dataset that looks like the table below. I would like, on clicking on the link button to predict according to the Label field. So, my question is, as I want to just predict one row of my dataset, How can I split my data into training and testing set according to this code from sci-kit-learn?</p>
  
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=random_state, test_size=test_size)
  </code></pre>
  
  <p>Below is my view to give you an idea of what I would like to do.</p>
  
  <pre><code>def prediction_view(request):
  template='index.html'
  .
  .
  .
  train=Pull_Requests.objects.all()
  
  
      features_col = ['Comments', 'LC_added', 'LC_deleted', 'Commits', 'Changed_files', 'Evaluation_time','First_status','Reputation'] # This also test
          class_label=['Label']
      X = train[features_col].dropna() # This also test
      # y = train.Label # This also test
      y=train[class_label]
  
      random_state = 0
      test_size=request.POST.get('test_size')
  
      X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=random_state, test_size=test_size)
      clf = tree.DecisionTreeClassifier()
      clf = clf.fit(X_train, y_train)
      y_pred = clf.predict(X_test)
  
      classification_report={'accuracy':Accuracy, 'pricision':Precision, 'recall':Recall, 'f1_score':F1_meseaure}
      importance_features={'importances_feautre':importances_feautres}
      data={
          'new_data':new_data,
          'classification_report':classification_report,
          'importance_feature':importance_features,
          'features':features_col,
               }
  return render(request,template,data)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vSxUX.png" rel="nofollow noreferrer">Dataset sample</a>:
  <img src="https://i.stack.imgur.com/vSxUX.png" alt="Dataset sample"></p>