<p>Another option is to actually use more recent packages that are purpose-built for highly dimensional / high volume data sets. They run their code using lower-level languages (C++ and/or Java) and in certain cases use parallelization.</p>
<p>I'd recommend taking a look into these three:</p>
<p>ranger (uses C++ compiler)
randomForestSRC (uses C++ compiler)
h2o (Java compiler - needs Java version 8 or higher)
Also, some additional reading here to give you more to go off on which package to choose: <a href="https://arxiv.org/pdf/1508.04409.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1508.04409.pdf</a></p>
<p>Page 8 shows benchmarks showing the performance improvement of ranger against randomForest against growing data size - ranger is WAY faster due to linear growth in runtime rather than non-linear for randomForest for rising tree/sample/split/feature sizes.</p>
<p>Good Luck!</p>
How to improve randomForest performance?
<p>I have a training set of size 38 MB (12 attributes with 420000 rows). I am running the below <code>R</code> snippet, to train the model using <code>randomForest</code>. This is taking hours for me.</p>

<pre><code>rf.model &lt;- randomForest(
              Weekly_Sales~.,
              data=newdata,
              keep.forest=TRUE,
              importance=TRUE,
              ntree=200,
              do.trace=TRUE,
              na.action=na.roughfix
            )
</code></pre>

<p>I think, due to <code>na.roughfix</code>, it is taking long time to execute. There are so many <code>NA's</code> in the training set.</p>

<p>Could someone let me know how can I improve the performance?</p>

<p>My system configuration is:</p>

<pre><code>Intel(R) Core i7 CPU @ 2.90 GHz
RAM - 8 GB
HDD - 500 GB
64 bit OS
</code></pre>