title: How to implement Cross Validation and Random Forest Classifier given feature sets as dictionaries?
body: <p>I have got my <code>featuresets</code> as a dictionary containing elements in the form:</p>
  
  <pre><code>({0: 0.48447204968944096, 
    1: 0.035093167701863354, 
    2: 0.07453416149068323, 
    3: 0.046583850931677016, 
    4: 0.0, 
    5: 0.09316770186335403,
    ...
    162: 1, 
    163: 1.0}, 'male')
  </code></pre>
  
  <p>When I try implementing the <code>cross_val_score</code> or <code>cross_val_predict</code> from the sklearn library, it always results showing some error saying</p>
  
  <blockquote>
    <p>"float values cannot be dict". </p>
  </blockquote>
  
  <p>Could someone please help me implementing the cross-validation using Linear SVC and Random-Forest classifier in Python?</p>
  
  <p>I had tried this before:</p>
  
  <pre><code>train_set, test_set = featuresets[1:1628], featuresets[1630:3257]
  np.asarray(train_set)
  np.asarray(test_set)
  clf = SVC(kernel='linear', C=5)
  predicted = cross_val_predict(clf, train_set, test_set, cv=10)
  metrics.accuracy_score(test_set, predicted)
  </code></pre>
  
  <p>Also, I am not getting how to implement the kfold cross-validation here.</p>