title: How to set class weights in DecisionTreeClassifier for multi-class setting
body: <p>I am using <code>sklearn.tree.DecisionTreeClassifier</code> to train 3-class classification problem.</p>
  <p>The number of records in 3 classes are given below:</p>
  <pre><code>A: 122038
  B: 43626
  C: 6678
  </code></pre>
  <p>When I train the classifier model it fails to learn the class - <code>C</code>. Though efficiency comes out to be 65-70% but it completely ignores the class C.</p>
  <p>Then I came to know about <code>class_weight</code> parameter but I am not sure how to use it in multiclass setting.</p>
  <p>Here is my code: ( I used <code>balanced</code> but it gave more poor accuracy)</p>
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1)
  clf = tree.DecisionTreeClassifier(criterion=&quot;gini&quot;, max_depth=3, random_state=1,class_weight='balanced')
  clf = clf.fit(X_train,y_train)
  y_pred = clf.predict(X_test)
  </code></pre>
  <p>How can I use weights with proportion to class distributions.</p>
  <p>Secondly, is there any better way to address this Imbalance class problem to increase accuracy.?</p>