title: How do I calculate the mean of cross_val_score() in a better optimized way?
body: <p>I'm using a sample data that consists of 13 features and 304 rows for the sake of training. I'm trying to evaluate the score of the RandomForestClassifier() I used. In order to make the score prediction more precise, I'm adding all the results of cross_val_score() into a list and I get the mean of the numbers in that list. I'm also using a timer to see how long it takes to run it.
  Here is the cross_val_score() part of the code:</p>
  <pre><code>start = time.time()
  big_mean = list()
  i = 0
  while i &lt; 100:
      score = np.mean(cross_val_score(RFC,X,y,cv=5))
      big_mean.append(score)
      i += 1
  print(sum(big_mean)/len(big_mean))
  end = time.time()
  print(&quot;Timer: &quot;,end - start)
  </code></pre>
  <p>This is what I got:</p>
  <pre><code>0.8210316939890709
  Timer:  75.11970710754395
  </code></pre>
  <p>I feel like the code is poorly optimized. If there was more data, it would have taken even more than 75 seconds. What changes would make this a better optimized code?</p>