title: Plotting ROC curve in Python
body: <p>I am trying to plot the ROC curve of a classifier that only uses two features from a dataset. Can anybody tell me how I can solve the error below.</p>
  
  <pre><code>from sklearn.metrics import roc_curve, auc
  from scipy import interp
  from sklearn.cross_validation import StratifiedKFold
  from sklearn.svm import SVC
  
  X_train2 = X_train[:, [0, 1]]
  X_train2
  cv = StratifiedKFold(y_train, n_folds=3, random_state=1)
  
  fig = plt.figure(figsize=(7, 5))
  mean_tpr = 0.0
  mean_fpr = np.linspace(0, 1, 100)
  all_tpr = []
  
  for i, (train, test) in enumerate(cv):
      probas = SVC.fit(X_train2[train], y_train[train]).predict_proba(X_train2[test])
  fpr, tpr, thresholds = roc_curve(y_train[test], probas[:, 1], pos_label=1)
  mean_tpr += interp(mean_fpr, fpr, tpr)
  mean_tpr[0] = 0.0
  roc_auc = auc(fpr, tpr)
  plt.plot(fpr, tpr, lw=1, label='ROC fold %d (area = %0.2f)'% (i+1, roc_auc))
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-163-3eea9731f8d5&gt; in &lt;module&gt;()
        1 from sklearn.svm import SVC
        2 for i, (train, test) in enumerate(cv):
  ----&gt; 3     probas = SVC.fit(X_train2[train], y_train[train]).predict_proba(X_train2[test])
        4 fpr, tpr, thresholds = roc_curve(y_train[test], probas[:, 1], pos_label=1)
        5 mean_tpr += interp(mean_fpr, fpr, tpr)
  
  TypeError: unbound method fit() must be called with SVC instance as first argument (got ndarray instance instead)
  </code></pre>
  
  <p><strong>NEW ERROR</strong>: After making the changes, I got the error below:</p>
  
  <p>Here is the code:</p>
  
  <pre><code>estimator= SVC(C=10)
  for i, (train, test) in enumerate(cv):
      probas = estimator.fit(X_train2[train], y_train[train]).predict_proba(X_train2[test])
  fpr, tpr, thresholds = roc_curve(y_train[test], probas[:, 1], pos_label=1)
  mean_tpr += interp(mean_fpr, fpr, tpr)
  mean_tpr[0] = 0.0
  roc_auc = auc(fpr, tpr)
  plt.plot(fpr, tpr, lw=1, label='ROC fold %d (area = %0.2f)'% (i+1, roc_auc))
  </code></pre>
  
  <p>And here is the Error:</p>
  
  <blockquote>
    <p>AttributeError: predict_proba is not available when  probability=False</p>
  </blockquote>