title: Example of multi label, multi class(multi output) RandomForest & Nearest Neighbor in scikit-learn?
body: <p>could someone post a basic example of what a multi output, multi class  RandomForest Classifier and Nearest Neighbor algorithm looks like?  They are supported out of the box, but I do not know how to use them as the docs are too abstract to me.</p>
  
  <p>Essentially, what do I have to do to access the multilabel properties of the classifer?  I already have my <code>Y</code> labels in a <code>list()</code> format as shown below. I have also transformed my labels:</p>
  
  <pre><code>from sklearn.preprocessing import MultiLabelBinarizer
  mlb = MultiLabelBinarizer()
  YC = mlb.fit_transform(df['combined_atc'].astype(str))
  </code></pre>
  
  <p>Dataset snippet:</p>
  
  <pre><code>X1   X2     X3        Y
  red  NaN    NaN       [candy, pen]
  red  green  blue      [clown, rainbow]
  red  yellow NaN       [sun, car, shirt]
  yello pink  black     [shirt, car]
  </code></pre>
  
  <p>As long as I can predict one of the items in Y, I'm "correct".
  So if I had an X1 of "red" then if I said "candy" or "pen" or "candy and pen" then I'm correct. There is no inherent ordering and it wouldn't matter.</p>
  
  <p>Is this a multiple label, multiple class problem?  What would be the ideal algorithm to use here? Anything out of the box support my use case?</p>
  
  <pre><code>import pandas
  from sklearn import model_selection
  from sklearn.ensemble import RandomForestClassifier
  
  
  rf = RandomForestClassifier(n_jobs=2)#use 2 cores
  seed=7
  max_features = 'auto'
  num_trees = 2
  
  kfold = model_selection.KFold(n_splits=3, random_state=seed)
  
  model = RandomForestClassifier(n_estimators=num_trees, 
  max_features=max_features, verbose=1)
  
  results = model_selection.cross_val_score(model, X, YC, cv=kfold)
  print(results.mean())
  </code></pre>