<p>Two straightforward ways to handle this are:</p>

<ul>
<li>Oversample the minority class or undersample the majority class to create a training set with balanced class sizes. Since you have so many instances to play with, I'd have thought undersampling should be fine i.e. use all the positive-class instances and a randomly chosen subset of the negative-class instances, but if you have less data then the oversampling technique <a href="https://arxiv.org/pdf/1106.1813.pdf" rel="nofollow noreferrer">SMOTE</a> is popular.</li>
<li>Use the <code>Prior</code> argument to <code>fitctree</code> to specify the prior probability of each class, rather than allow <code>fitctree</code> to calculate it from the class sizes (the default):</li>
</ul>

<blockquote>
  <p><strong><code>'Prior'</code> — Prior probabilities</strong><br>
  <code>'empirical' (default) | 'uniform' | vector of scalar values | structure</code>  </p>
  
  <p>Prior probabilities for each
  class, specified as the comma-separated pair consisting of <code>'Prior'</code> and
  one of the following.</p>
  
  <p>A character vector: 'empirical' determines class probabilities from
  class frequencies in Y. If you pass observation weights, fitctree uses
  the weights to compute the class probabilities. 'uniform' sets all
  class probabilities equal.<br>
  ...</p>
</blockquote>

<p>In your case simply adding <code>'Prior', 'uniform'</code> to the arguments to <code>fitctree</code> might do the trick.</p>

<p>Whichever option you choose, remember that the test set(s) you use for evaluating the performance of the classifier should have the real distribution of positive and negative class (or, the distribution you expect to encounter in real data).</p>
Using fitctree to train a more sensitive model with an imbalanced training set
<p>I'm trying to build a decision tree in MATLAB for binary classification. I have 4 features for each instance. There are around 25,000 instances in the positive class and 350,000 instances in the negative class. </p>

<p>I've tried building classifiers both within the classification learner app and using fitctree but both seem to just identify everything as the negative class. I'm guessing that MATLAB is structuring the tree to yield the highest "accuracy."</p>

<p>Is there a way to structure the decision tree towards a more sensitive model? (i.e. rather than "accuracy", can I use fitctree to build a model where sensitivity is at 70/80/90% or where sensitivity and specificity are similar?)</p>