title: SVM stuck in optimization
body: <p>I am running a random search in a SVC in sklearn.
  My data set has been normalized, resampled and I applied PCA to it, resulting in 20k rows with 80 columns.
  If I run a single SVM with cross validation, it takes longer than other algorithms (which is acceptable), but it evaluates.
  But when I try to optimize the algorithm using random search or other tuning method, SVM evaluates some solutions and gets stuck in execution.</p>
  
  <pre><code>Fitting 3 folds for each of 100 candidates, totalling 300 fits
  [Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.
  [Parallel(n_jobs=-1)]: Done  25 tasks      | elapsed: 19.9min
  [Parallel(n_jobs=-1)]: Done 146 tasks      | elapsed: 116.3min
  </code></pre>
  
  <p>The last entry was made 10 hours ago.
  I know the file is executing because my processing unit is being 100% used and the terminal shows me the:</p>
  
  <pre><code>.................................................................................
  </code></pre>
  
  <p>The number of dots increase, which should mean the code is still running, but never is debugged in the terminal, as if it was stuck in some calculationg loop. And when I try to evaluate a single SVC in the parameter instances that got stuck in the tuning, they evaluate normally.</p>
  
  <p>Has anyone encountered this error? </p>
  
  <p>My idea is that the SVC implementation is somewhat storing past evaluations and  the memory gets an overflow from these past evaluations, but the algorithm doesnt identify this error and continues trying to run. But in the documentation I didnt find anything that could help me.</p>
  
  <hr>
  
  <p>EDIT 1</p>
  
  <p>As said, after the importation, missing data handling, normalization, PCA and resampling, I run a randomsearch with a SVM as classifier.
  I let this snippet run for 2 hours and (I think) I got the error. The console just shows that the evaluations are happening, but the only entries are dots.</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import pandas as pd
  from sklearn.model_selection import RandomizedSearchCV
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.svm import SVC
  
  
  for _ in range(1):
      X_train = np.random.rand(20000,40)
      y_train = np.random.randint(0, 2, size=20000)
      # X_train = pd.DataFrame(X_train)
  
      #print(X_train)
  
      clf = SVC(verbose=3)
      gs = RandomizedSearchCV(
          clf,
          param_distributions={
              'C': 10. ** np.arange(-3, 4),
              'gamma': 10. ** np.arange(-4, 2),
              'kernel': ['rbf', "linear"],
              'class_weight':['balanced', None]
          },
          n_iter=25,
          cv=3,
          scoring="accuracy",
          verbose=3,
          n_jobs=-1
      )
  
      gs.fit(X_train, y_train)
      print(gs.cv_results_)
  
  print("finishes")
  </code></pre>
  
  <p>The last terminal entries were:</p>
  
  <pre><code>[LibSVM][CV]  kernel=linear, gamma=0.001, class_weight=balanced, C=0.1, score=0.4913017396520696, total=  54.3s
  [CV] kernel=linear, gamma=0.001, class_weight=balanced, C=0.1 ........
  .................................[LibSVM][CV]  kernel=rbf, gamma=0.0001, class_weight=balanced, C=1000.0, score=0.49324932493249324, total= 1.1min
  [CV] kernel=linear, gamma=0.001, class_weight=balanced, C=0.1 ........
  ...........................................................................................
  Warning: using -h 0 may be faster
  *..*
  optimization finished, #iter = 14179
  obj = -1306.242506, rho = 0.343782
  nSV = 13094, nBSV = 10655
  Total nSV = 13094
  ..................................
  Warning: using -h 0 may be faster
  *.*
  optimization finished, #iter = 14339
  obj = -1309.955423, rho = -0.341516
  nSV = 13131, nBSV = 11572
  Total nSV = 13131
  .................................................................[LibSVM][CV]  kernel=linear, gamma=0.001, class_weight=balanced, C=0.1, score=0.495949594959496, total=  53.8s
  ..............................[LibSVM][CV]  kernel=linear, gamma=0.001, class_weight=balanced, C=0.1, score=0.49414941494149417, total=  53.6s
  ...........................................................................................................................................
  ............................................................................................................................................
  ............................................................................................................................................
  and an infinite number of dots, with more dots appearing every second
  </code></pre>
  
  <p>This last was in the terminal, while I also get some output messages in the debugging-console:</p>
  
  <pre class="lang-py prettyprint-override"><code>Fitting 3 folds for each of 25 candidates, totalling 75 fits
  [Parallel(n_jobs=-1)]: Using backend LokyBackend with 8 concurrent workers.
  [Parallel(n_jobs=-1)]: Done  16 tasks      | elapsed:  4.8min
  </code></pre>
  
  <p>The "Done 16 tasks" was received one and a half hours ago. That means that it took 4.8 mins to evaluate 16 tasks, and after that no more debugging was received in the terminal.</p>