<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/regularized-greedy-forest-in-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://mlampros.github.io/mlampros.github.io/2018/02/14/the_RGF_package/"> mlampros</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>This blog post is about my newly released <a rel="nofollow" href="https://github.com/mlampros/RGF" target="_blank">RGF package</a> (the blog post consists mainly of the package Vignette). The <em>RGF</em> package is a wrapper of the <a rel="nofollow" href="https://github.com/fukatani/rgf_python" target="_blank"><em>Regularized Greedy Forest</em></a> <em>python</em> package, which also includes a <a rel="nofollow" href="https://github.com/baidu/fast_rgf" target="_blank"><em>Multi-core implementation (FastRGF)</em></a>. Portability from Python to R was made possible using the <a rel="nofollow" href="https://github.com/rstudio/reticulate" target="_blank">reticulate</a> package and the installation requires basic knowledge of Python. Except for the Linux Operating System, the installation on Macintosh and Windows might be somehow cumbersome (<em>on windows the package currently can be used only from within the command prompt</em>). Detailed installation instructions for all three Operating Systems can be found in the <em>README.md</em> file and in the <a rel="nofollow" href="https://github.com/fukatani/rgf_python" target="_blank"><em>rgf_python</em></a> Github repository.</p>
<p></p>
<p>The <em>Regularized Greedy Forest</em> algorithm is explained in detail in the paper <a rel="nofollow" href="https://arxiv.org/abs/1109.0887" target="_blank"><em>Rie Johnson and Tong Zhang, Learning Nonlinear Functions Using Regularized Greedy Forest</em></a>. A small synopsis would be <em>“… the resulting method, which we refer to as regularized greedy forest (RGF), integrates two ideas: one is to include tree-structured regularization into the learning formulation; and the other is to employ the fully-corrective regularized greedy algorithm ….”</em>.</p>
<p></p>
<p>At the time of writing this blog post (14 – 02 – 2018), there isn’t a corresponding implementation of the algorithm in the R language, so I decided to port the Python package in R taking advantage of the reticulate package. In the next lines, I will explain the functionality of the package and I compare RBF with other similar implementations, such as <a rel="nofollow" href="https://github.com/imbs-hl/ranger" target="_blank"><em>ranger</em></a> (random forest algorithm) and <a rel="nofollow" href="https://github.com/dmlc/xgboost/tree/master/R-package" target="_blank"><em>xgboost</em></a> (gradient boosting algorithm), in terms of time efficiency and error rate improvement.</p>
<p></p>
<h4><strong>The RGF package</strong></h4>
<p></p>
<p>The <em>RGF</em> package includes the following R6-classes / functions,</p>
<p></p>
<h5><strong>classes</strong></h5>
<p></p>
<table>
<thead>
<tr>
<th>RGF_Regressor</th>
<th>RGF_Classifier</th>
<th>FastRGF_Regressor</th>
<th>FastRGF_Classifier</th>
</tr>
</thead>
<tbody>
<tr>
<td>fit()</td>
<td>fit(()</td>
<td>fit()</td>
<td>fit()</td>
</tr>
<tr>
<td>predict()</td>
<td>predict()</td>
<td>predict()</td>
<td>predict()</td>
</tr>
<tr>
<td>cleanup()</td>
<td>predict_proba()</td>
<td>cleanup()</td>
<td>predict_proba()</td>
</tr>
<tr>
<td>get_params()</td>
<td>cleanup()</td>
<td>get_params()</td>
<td>cleanup()</td>
</tr>
<tr>
<td>score()</td>
<td>get_params()</td>
<td>score()</td>
<td>get_params()</td>
</tr>
<tr>
<td> </td>
<td>score()</td>
<td> </td>
<td>score()</td>
</tr>
</tbody>
</table>
<p></p>
<h5><strong>functions</strong></h5>
<p></p>
<p>dgCMatrix_2scipy_sparse()</p>
<p>RGF_cleanup_temp_files()</p>
<p>mat_2scipy_sparse()</p>
<p></p>
<p>The package documentation includes details and examples for all R6-classes and functions. In the following code chunks, I’ll explain how a user can work with sparse matrices as all RGF algorithms (besides a dense matrix) <strong>require a python sparse matrix as input</strong>.</p>
<p></p>
<h4><strong>Sparse matrices as input</strong></h4>
<p></p>
<p>The RGF package includes two functions (<strong>mat_2scipy_sparse</strong> and <strong>dgCMatrix_2scipy_sparse</strong>) which allow the user to convert from a <em>matrix</em> / <em>dgCMatrix</em> to a <em>scipy sparse matrix</em>,</p>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>library</span><span>(</span><span>RGF</span><span>)</span><span>
</span><span># conversion from a matrix object to a scipy sparse matrix</span><span>
</span><span>#----------------------------------------------------------</span><span>
</span><span>set.seed</span><span>(</span><span>1</span><span>)</span><span>
</span><span>x</span><span> </span><span>=</span><span> </span><span>matrix</span><span>(</span><span>runif</span><span>(</span><span>1000</span><span>),</span><span> </span><span>nrow</span><span> </span><span>=</span><span> </span><span>100</span><span>,</span><span> </span><span>ncol</span><span> </span><span>=</span><span> </span><span>10</span><span>)</span><span>
</span><span>x_sparse</span><span> </span><span>=</span><span> </span><span>mat_2scipy_sparse</span><span>(</span><span>x</span><span>,</span><span> </span><span>format</span><span> </span><span>=</span><span> </span><span>&quot;sparse_row_matrix&quot;</span><span>)</span><span>
</span><span>print</span><span>(</span><span>dim</span><span>(</span><span>x</span><span>))</span><span>
</span><span>[</span><span>1</span><span>]</span><span> </span><span>100</span><span> </span><span>10</span><span>
</span><span>print</span><span>(</span><span>x_sparse</span><span>$</span><span>shape</span><span>)</span><span>
</span><span>(</span><span>100</span><span>,</span><span> </span><span>10</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span># conversion from a dgCMatrix object to a scipy sparse matrix</span><span>
</span><span>#-------------------------------------------------------------</span><span>
</span><span>data</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>1</span><span>,</span><span> </span><span>0</span><span>,</span><span> </span><span>2</span><span>,</span><span> </span><span>0</span><span>,</span><span> </span><span>0</span><span>,</span><span> </span><span>3</span><span>,</span><span> </span><span>4</span><span>,</span><span> </span><span>5</span><span>,</span><span> </span><span>6</span><span>)</span><span>
</span><span># by default column-oriented format</span><span>
</span><span>dgcM</span><span> </span><span>=</span><span> </span><span>Matrix</span><span>::</span><span>Matrix</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>data</span><span>,</span><span> </span><span>nrow</span><span> </span><span>=</span><span> </span><span>3</span><span>,</span><span>
</span><span>ncol</span><span> </span><span>=</span><span> </span><span>3</span><span>,</span><span> </span><span>byrow</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>,</span><span>
</span><span>sparse</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)</span><span>
</span><span>print</span><span>(</span><span>dim</span><span>(</span><span>dgcM</span><span>))</span><span>
</span><span>[</span><span>1</span><span>]</span><span> </span><span>3</span><span> </span><span>3</span><span>
</span><span>x_sparse</span><span> </span><span>=</span><span> </span><span>dgCMatrix_2scipy_sparse</span><span>(</span><span>dgcM</span><span>)</span><span>
</span><span>print</span><span>(</span><span>x_sparse</span><span>$</span><span>shape</span><span>)</span><span>
</span><span>(</span><span>3</span><span>,</span><span> </span><span>3</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<h4><strong>Comparison of RGF with ranger and xgboost</strong></h4>
<p></p>
<p>First the data, libraries and cross-validation function will be inputted (the <em>MLmetrics</em> library is also required),</p>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>data</span><span>(</span><span>Boston</span><span>,</span><span> </span><span>package</span><span> </span><span>=</span><span> </span><span>'KernelKnn'</span><span>)</span><span>
</span><span>library</span><span>(</span><span>RGF</span><span>)</span><span>
</span><span>library</span><span>(</span><span>ranger</span><span>)</span><span>
</span><span>library</span><span>(</span><span>xgboost</span><span>)</span><span>
</span><span># shuffling function for cross-validation folds</span><span>
</span><span>#-----------------------------------------------</span><span>
</span><span>func_shuffle</span><span> </span><span>=</span><span> </span><span>function</span><span>(</span><span>vec</span><span>,</span><span> </span><span>times</span><span> </span><span>=</span><span> </span><span>10</span><span>)</span><span> </span><span>{</span><span>
</span><span>for</span><span> </span><span>(</span><span>i</span><span> </span><span>in</span><span> </span><span>1</span><span>:</span><span>times</span><span>)</span><span> </span><span>{</span><span>
</span><span>out</span><span> </span><span>=</span><span> </span><span>sample</span><span>(</span><span>vec</span><span>,</span><span> </span><span>length</span><span>(</span><span>vec</span><span>))</span><span>
</span><span>}</span><span>
</span><span>out</span><span>
</span><span>}</span><span>
</span><span># cross-validation folds [ regression]</span><span>
</span><span>#-------------------------------------</span><span>
</span><span>regr_folds</span><span> </span><span>=</span><span> </span><span>function</span><span>(</span><span>folds</span><span>,</span><span> </span><span>RESP</span><span>,</span><span> </span><span>stratified</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>)</span><span> </span><span>{</span><span>
</span><span>if</span><span> </span><span>(</span><span>is.factor</span><span>(</span><span>RESP</span><span>))</span><span> </span><span>{</span><span>
</span><span>stop</span><span>(</span><span>simpleError</span><span>(</span><span>&quot;this function is meant for regression for classification use the 'class_folds' function&quot;</span><span>))</span><span>
</span><span>}</span><span>
</span><span>samp_vec</span><span> </span><span>=</span><span> </span><span>rep</span><span>(</span><span>1</span><span>/</span><span>folds</span><span>,</span><span> </span><span>folds</span><span>)</span><span>
</span><span>sort_names</span><span> </span><span>=</span><span> </span><span>paste0</span><span>(</span><span>'fold_'</span><span>,</span><span> </span><span>1</span><span>:</span><span>folds</span><span>)</span><span>
</span><span>if</span><span> </span><span>(</span><span>stratified</span><span> </span><span>==</span><span> </span><span>TRUE</span><span>)</span><span> </span><span>{</span><span>
</span><span>stratif</span><span> </span><span>=</span><span> </span><span>cut</span><span>(</span><span>RESP</span><span>,</span><span> </span><span>breaks</span><span> </span><span>=</span><span> </span><span>folds</span><span>)</span><span>
</span><span>clas</span><span> </span><span>=</span><span> </span><span>lapply</span><span>(</span><span>unique</span><span>(</span><span>stratif</span><span>),</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>which</span><span>(</span><span>stratif</span><span> </span><span>==</span><span> </span><span>x</span><span>))</span><span>
</span><span>len</span><span> </span><span>=</span><span> </span><span>lapply</span><span>(</span><span>clas</span><span>,</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>length</span><span>(</span><span>x</span><span>))</span><span>
</span><span>prop</span><span> </span><span>=</span><span> </span><span>lapply</span><span>(</span><span>len</span><span>,</span><span> </span><span>function</span><span>(</span><span>y</span><span>)</span><span> </span><span>sapply</span><span>(</span><span>1</span><span>:</span><span>length</span><span>(</span><span>samp_vec</span><span>),</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>round</span><span>(</span><span>y</span><span> </span><span>*</span><span> </span><span>samp_vec</span><span>[</span><span>x</span><span>])))</span><span>
</span><span>repl</span><span> </span><span>=</span><span> </span><span>unlist</span><span>(</span><span>lapply</span><span>(</span><span>prop</span><span>,</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>sapply</span><span>(</span><span>1</span><span>:</span><span>length</span><span>(</span><span>x</span><span>),</span><span> </span><span>function</span><span>(</span><span>y</span><span>)</span><span> </span><span>rep</span><span>(</span><span>paste0</span><span>(</span><span>'fold_'</span><span>,</span><span> </span><span>y</span><span>),</span><span> </span><span>x</span><span>[</span><span>y</span><span>]))))</span><span>
</span><span>spl</span><span> </span><span>=</span><span> </span><span>suppressWarnings</span><span>(</span><span>split</span><span>(</span><span>1</span><span>:</span><span>length</span><span>(</span><span>RESP</span><span>),</span><span> </span><span>repl</span><span>))}</span><span>
</span><span>else</span><span> </span><span>{</span><span>
</span><span>prop</span><span> </span><span>=</span><span> </span><span>lapply</span><span>(</span><span>length</span><span>(</span><span>RESP</span><span>),</span><span> </span><span>function</span><span>(</span><span>y</span><span>)</span><span> </span><span>sapply</span><span>(</span><span>1</span><span>:</span><span>length</span><span>(</span><span>samp_vec</span><span>),</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>round</span><span>(</span><span>y</span><span> </span><span>*</span><span> </span><span>samp_vec</span><span>[</span><span>x</span><span>])))</span><span>
</span><span>repl</span><span> </span><span>=</span><span> </span><span>func_shuffle</span><span>(</span><span>unlist</span><span>(</span><span>lapply</span><span>(</span><span>prop</span><span>,</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>sapply</span><span>(</span><span>1</span><span>:</span><span>length</span><span>(</span><span>x</span><span>),</span><span> </span><span>function</span><span>(</span><span>y</span><span>)</span><span> </span><span>rep</span><span>(</span><span>paste0</span><span>(</span><span>'fold_'</span><span>,</span><span> </span><span>y</span><span>),</span><span> </span><span>x</span><span>[</span><span>y</span><span>])))))</span><span>
</span><span>spl</span><span> </span><span>=</span><span> </span><span>suppressWarnings</span><span>(</span><span>split</span><span>(</span><span>1</span><span>:</span><span>length</span><span>(</span><span>RESP</span><span>),</span><span> </span><span>repl</span><span>))</span><span>
</span><span>}</span><span>
</span><span>spl</span><span> </span><span>=</span><span> </span><span>spl</span><span>[</span><span>sort_names</span><span>]</span><span>
</span><span>if</span><span> </span><span>(</span><span>length</span><span>(</span><span>table</span><span>(</span><span>unlist</span><span>(</span><span>lapply</span><span>(</span><span>spl</span><span>,</span><span> </span><span>function</span><span>(</span><span>x</span><span>)</span><span> </span><span>length</span><span>(</span><span>x</span><span>)))))</span><span> </span><span>></span><span> </span><span>1</span><span>)</span><span> </span><span>{</span><span>
</span><span>warning</span><span>(</span><span>'the folds are not equally split'</span><span>)</span><span>
</span><span>}</span><span>
</span><span>if</span><span> </span><span>(</span><span>length</span><span>(</span><span>unlist</span><span>(</span><span>spl</span><span>))</span><span> </span><span>!=</span><span> </span><span>length</span><span>(</span><span>RESP</span><span>))</span><span> </span><span>{</span><span>
</span><span>stop</span><span>(</span><span>simpleError</span><span>(</span><span>&quot;the length of the splits are not equal with the length of the response&quot;</span><span>))</span><span>
</span><span>}</span><span>
</span><span>spl</span><span>
</span><span>}</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<h4><strong>single threaded ( small data set )</strong></h4>
<p></p>
<p>In the next code chunk, I’ll perform 5-fold cross-validation using the Boston dataset and I’ll compare time execution and error rate for all three algorithms (comparison <strong>without doing hyper-parameter tuning</strong>),</p>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>NUM_FOLDS</span><span> </span><span>=</span><span> </span><span>5</span><span>
</span><span>set.seed</span><span>(</span><span>1</span><span>)</span><span>
</span><span>FOLDS</span><span> </span><span>=</span><span> </span><span>regr_folds</span><span>(</span><span>folds</span><span> </span><span>=</span><span> </span><span>NUM_FOLDS</span><span>,</span><span> </span><span>Boston</span><span>[,</span><span> </span><span>'medv'</span><span>],</span><span> </span><span>stratified</span><span> </span><span>=</span><span> </span><span>T</span><span>)</span><span>
</span><span>boston_rgf_te</span><span> </span><span>=</span><span> </span><span>boston_ranger_te</span><span> </span><span>=</span><span> </span><span>boston_xgb_te</span><span> </span><span>=</span><span> </span><span>boston_rgf_time</span><span> </span><span>=</span><span> </span><span>boston_ranger_time</span><span> </span><span>=</span><span> </span><span>boston_xgb_time</span><span> </span><span>=</span><span> </span><span>rep</span><span>(</span><span>NA</span><span>,</span><span> </span><span>NUM_FOLDS</span><span>)</span><span>
</span><span>for</span><span> </span><span>(</span><span>i</span><span> </span><span>in</span><span> </span><span>1</span><span>:</span><span>length</span><span>(</span><span>FOLDS</span><span>))</span><span> </span><span>{</span><span>
</span><span>cat</span><span>(</span><span>&quot;fold : &quot;</span><span>,</span><span> </span><span>i</span><span>,</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span><span>samp</span><span> </span><span>=</span><span> </span><span>unlist</span><span>(</span><span>FOLDS</span><span>[</span><span>-</span><span>i</span><span>])</span><span>
</span><span>samp_</span><span> </span><span>=</span><span> </span><span>unlist</span><span>(</span><span>FOLDS</span><span>[</span><span>i</span><span>])</span><span>
</span><span># RGF</span><span>
</span><span>#----</span><span>
</span><span>rgf_start</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>init_regr</span><span> </span><span>=</span><span> </span><span>RGF_Regressor</span><span>$</span><span>new</span><span>(</span><span>l</span><span>2</span><span> </span><span>=</span><span> </span><span>0.1</span><span>)</span><span>
</span><span>init_regr</span><span>$</span><span>fit</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>as.matrix</span><span>(</span><span>Boston</span><span>[</span><span>samp</span><span>,</span><span> </span><span>-</span><span>ncol</span><span>(</span><span>Boston</span><span>)]),</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>Boston</span><span>[</span><span>samp</span><span>,</span><span> </span><span>ncol</span><span>(</span><span>Boston</span><span>)])</span><span>
</span><span>pr_te</span><span> </span><span>=</span><span> </span><span>init_regr</span><span>$</span><span>predict</span><span>(</span><span>as.matrix</span><span>(</span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>-</span><span>ncol</span><span>(</span><span>Boston</span><span>)]))</span><span>
</span><span>rgf_end</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>boston_rgf_time</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>rgf_end</span><span> </span><span>-</span><span> </span><span>rgf_start</span><span>
</span><span>boston_rgf_te</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>MLmetrics</span><span>::</span><span>RMSE</span><span>(</span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>'medv'</span><span>],</span><span> </span><span>pr_te</span><span>)</span><span>
</span><span># ranger</span><span>
</span><span>#-------</span><span>
</span><span>ranger_start</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>fit</span><span> </span><span>=</span><span> </span><span>ranger</span><span>(</span><span>dependent.variable.name</span><span> </span><span>=</span><span> </span><span>&quot;medv&quot;</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>Boston</span><span>[</span><span>samp</span><span>,</span><span> </span><span>],</span><span> </span><span>write.forest</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>,</span><span> </span><span>probability</span><span> </span><span>=</span><span> </span><span>F</span><span>,</span><span> </span><span>num.threads</span><span> </span><span>=</span><span> </span><span>1</span><span>,</span><span> </span><span>num.trees</span><span> </span><span>=</span><span> </span><span>500</span><span>,</span><span> </span><span>verbose</span><span> </span><span>=</span><span> </span><span>T</span><span>,</span><span> </span><span>classification</span><span> </span><span>=</span><span> </span><span>F</span><span>,</span><span> </span><span>mtry</span><span> </span><span>=</span><span> </span><span>NULL</span><span>,</span><span> </span><span>min.node.size</span><span> </span><span>=</span><span> </span><span>5</span><span>,</span><span> </span><span>keep.inbag</span><span> </span><span>=</span><span> </span><span>T</span><span>)</span><span>
</span><span>pred_te</span><span> </span><span>=</span><span> </span><span>predict</span><span>(</span><span>fit</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>-</span><span>ncol</span><span>(</span><span>Boston</span><span>)],</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>'se'</span><span>)</span><span>$</span><span>predictions</span><span>
</span><span>ranger_end</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>boston_ranger_time</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>ranger_end</span><span> </span><span>-</span><span> </span><span>ranger_start</span><span>
</span><span>boston_ranger_te</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>MLmetrics</span><span>::</span><span>RMSE</span><span>(</span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>'medv'</span><span>],</span><span> </span><span>pred_te</span><span>)</span><span>
</span><span># xgboost</span><span>
</span><span>#--------</span><span>
</span><span>xgb_start</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>dtrain</span><span> </span><span>&lt;-</span><span> </span><span>xgb.DMatrix</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>as.matrix</span><span>(</span><span>Boston</span><span>[</span><span>samp</span><span>,</span><span> </span><span>-</span><span>ncol</span><span>(</span><span>Boston</span><span>)]),</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>Boston</span><span>[</span><span>samp</span><span>,</span><span> </span><span>ncol</span><span>(</span><span>Boston</span><span>)])</span><span>
</span><span>dtest</span><span> </span><span>&lt;-</span><span> </span><span>xgb.DMatrix</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>as.matrix</span><span>(</span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>-</span><span>ncol</span><span>(</span><span>Boston</span><span>)]),</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>ncol</span><span>(</span><span>Boston</span><span>)])</span><span>
</span><span>watchlist</span><span> </span><span>&lt;-</span><span> </span><span>list</span><span>(</span><span>train</span><span> </span><span>=</span><span> </span><span>dtrain</span><span>,</span><span> </span><span>test</span><span> </span><span>=</span><span> </span><span>dtest</span><span>)</span><span>
</span><span>param</span><span> </span><span>=</span><span> </span><span>list</span><span>(</span><span>&quot;objective&quot;</span><span> </span><span>=</span><span> </span><span>&quot;reg:linear&quot;</span><span>,</span><span> </span><span>&quot;bst:eta&quot;</span><span> </span><span>=</span><span> </span><span>0.05</span><span>,</span><span> </span><span>&quot;max_depth&quot;</span><span> </span><span>=</span><span> </span><span>4</span><span>,</span><span> </span><span>&quot;subsample&quot;</span><span> </span><span>=</span><span> </span><span>0.85</span><span>,</span><span> </span><span>&quot;colsample_bytree&quot;</span><span> </span><span>=</span><span> </span><span>0.85</span><span>,</span><span> </span><span>&quot;booster&quot;</span><span> </span><span>=</span><span> </span><span>&quot;gbtree&quot;</span><span>,</span><span>
</span><span>&quot;nthread&quot;</span><span> </span><span>=</span><span> </span><span>1</span><span>)</span><span>
</span><span>fit</span><span> </span><span>=</span><span> </span><span>xgb.train</span><span>(</span><span>param</span><span>,</span><span> </span><span>dtrain</span><span>,</span><span> </span><span>nround</span><span> </span><span>=</span><span> </span><span>500</span><span>,</span><span> </span><span>print_every_n</span><span> </span><span>=</span><span> </span><span>100</span><span>,</span><span> </span><span>watchlist</span><span> </span><span>=</span><span> </span><span>watchlist</span><span>,</span><span> </span><span>early_stopping_rounds</span><span> </span><span>=</span><span> </span><span>20</span><span>,</span><span>
</span><span>maximize</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>,</span><span> </span><span>verbose</span><span> </span><span>=</span><span> </span><span>0</span><span>)</span><span>
</span><span>p_te</span><span> </span><span>=</span><span> </span><span>xgboost</span><span>:::</span><span>predict.xgb.Booster</span><span>(</span><span>fit</span><span>,</span><span> </span><span>as.matrix</span><span>(</span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>-</span><span>ncol</span><span>(</span><span>Boston</span><span>)]),</span><span> </span><span>ntreelimit</span><span> </span><span>=</span><span> </span><span>fit</span><span>$</span><span>best_iteration</span><span>)</span><span>
</span><span>xgb_end</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>boston_xgb_time</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>xgb_end</span><span> </span><span>-</span><span> </span><span>xgb_start</span><span>
</span><span>boston_xgb_te</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>MLmetrics</span><span>::</span><span>RMSE</span><span>(</span><span>Boston</span><span>[</span><span>samp_</span><span>,</span><span> </span><span>'medv'</span><span>],</span><span> </span><span>p_te</span><span>)</span><span>
</span><span>}</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>fold</span><span> </span><span>:</span><span> </span><span>1</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>2</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>3</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>4</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>5</span><span> </span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>cat</span><span>(</span><span>&quot;total time rgf 5 fold cross-validation : &quot;</span><span>,</span><span> </span><span>sum</span><span>(</span><span>boston_rgf_time</span><span>),</span><span> </span><span>&quot; mean rmse on test data : &quot;</span><span>,</span><span> </span><span>mean</span><span>(</span><span>boston_rgf_te</span><span>),</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span><span>cat</span><span>(</span><span>&quot;total time ranger 5 fold cross-validation : &quot;</span><span>,</span><span> </span><span>sum</span><span>(</span><span>boston_ranger_time</span><span>),</span><span> </span><span>&quot; mean rmse on test data : &quot;</span><span>,</span><span> </span><span>mean</span><span>(</span><span>boston_ranger_te</span><span>),</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span><span>cat</span><span>(</span><span>&quot;total time xgb 5 fold cross-validation : &quot;</span><span>,</span><span> </span><span>sum</span><span>(</span><span>boston_xgb_time</span><span>),</span><span> </span><span>&quot; mean rmse on test data : &quot;</span><span>,</span><span> </span><span>mean</span><span>(</span><span>boston_xgb_te</span><span>),</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>total</span><span> </span><span>time</span><span> </span><span>rgf</span><span> </span><span>5</span><span> </span><span>fold</span><span> </span><span>cross</span><span>-</span><span>validation</span><span> </span><span>:</span><span> </span><span>0.7730639</span><span> </span><span>mean</span><span> </span><span>rmse</span><span> </span><span>on</span><span> </span><span>test</span><span> </span><span>data</span><span> </span><span>:</span><span> </span><span>3.832135</span><span> </span><span>total</span><span> </span><span>time</span><span> </span><span>ranger</span><span> </span><span>5</span><span> </span><span>fold</span><span> </span><span>cross</span><span>-</span><span>validation</span><span> </span><span>:</span><span> </span><span>3.826846</span><span> </span><span>mean</span><span> </span><span>rmse</span><span> </span><span>on</span><span> </span><span>test</span><span> </span><span>data</span><span> </span><span>:</span><span> </span><span>4.17419</span><span> </span><span>total</span><span> </span><span>time</span><span> </span><span>xgb</span><span> </span><span>5</span><span> </span><span>fold</span><span> </span><span>cross</span><span>-</span><span>validation</span><span> </span><span>:</span><span> </span><span>0.4316094</span><span> </span><span>mean</span><span> </span><span>rmse</span><span> </span><span>on</span><span> </span><span>test</span><span> </span><span>data</span><span> </span><span>:</span><span> </span><span>3.949122</span><span> </span></code></pre>
</div>
</div>
<p></p>
<h4><strong>5 threads ( high dimensional dataset and presence of multicollinearity )</strong></h4>
<p></p>
<p>For the high-dimensional data (can be downloaded from my <a rel="nofollow" href="https://github.com/mlampros/DataSets" target="_blank">Github repository</a>) I’ll use the <em>FastRGF_Regressor</em> rather than the RGF_Regressor (comparison <strong>without doing hyper-parameter tuning</strong>),</p>
<p></p>
<div>
<div>
<pre><code><span>
</span><span># download the data from my Github repository (tested on a Linux OS)</span><span>
</span><span>system</span><span>(</span><span>&quot;wget https://raw.githubusercontent.com/mlampros/DataSets/master/africa_soil_train_data.zip&quot;</span><span>)</span><span>
</span><span># load the data in the R session</span><span>
</span><span>train_dat</span><span> </span><span>=</span><span> </span><span>read.table</span><span>(</span><span>unz</span><span>(</span><span>&quot;africa_soil_train_data.zip&quot;</span><span>,</span><span> </span><span>&quot;train.csv&quot;</span><span>),</span><span> </span><span>nrows</span><span> </span><span>=</span><span> </span><span>1157</span><span>,</span><span> </span><span>header</span><span> </span><span>=</span><span> </span><span>T</span><span>,</span><span> </span><span>quote</span><span> </span><span>=</span><span> </span><span>&quot;\&quot;&quot;</span><span>,</span><span> </span><span>sep</span><span> </span><span>=</span><span> </span><span>&quot;,&quot;</span><span>)</span><span>
</span><span># c(&quot;Ca&quot;, &quot;P&quot;, &quot;pH&quot;, &quot;SOC&quot;, &quot;Sand&quot;) : response variables </span><span>
</span><span># exclude response-variables and factor variable</span><span>
</span><span>x</span><span> </span><span>=</span><span> </span><span>train_dat</span><span>[,</span><span> </span><span>-</span><span>c</span><span>(</span><span>1</span><span>,</span><span> </span><span>which</span><span>(</span><span>colnames</span><span>(</span><span>train_dat</span><span>)</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;Ca&quot;</span><span>,</span><span> </span><span>&quot;P&quot;</span><span>,</span><span> </span><span>&quot;pH&quot;</span><span>,</span><span> </span><span>&quot;SOC&quot;</span><span>,</span><span> </span><span>&quot;Sand&quot;</span><span>,</span><span> </span><span>&quot;Depth&quot;</span><span>)))]</span><span>
</span><span># take (randomly) the first of the responses for train</span><span>
</span><span>y</span><span> </span><span>=</span><span> </span><span>train_dat</span><span>[,</span><span> </span><span>&quot;Ca&quot;</span><span>]</span><span>
</span><span># dataset for ranger</span><span>
</span><span>tmp_rg_dat</span><span> </span><span>=</span><span> </span><span>cbind</span><span>(</span><span>Ca</span><span> </span><span>=</span><span> </span><span>y</span><span>,</span><span> </span><span>x</span><span>)</span><span>
</span><span># cross-validation folds</span><span>
</span><span>set.seed</span><span>(</span><span>2</span><span>)</span><span>
</span><span>FOLDS</span><span> </span><span>=</span><span> </span><span>regr_folds</span><span>(</span><span>folds</span><span> </span><span>=</span><span> </span><span>NUM_FOLDS</span><span>,</span><span> </span><span>y</span><span>,</span><span> </span><span>stratified</span><span> </span><span>=</span><span> </span><span>T</span><span>)</span><span>
</span><span>highdim_rgf_te</span><span> </span><span>=</span><span> </span><span>highdim_ranger_te</span><span> </span><span>=</span><span> </span><span>highdim_xgb_te</span><span> </span><span>=</span><span> </span><span>highdim_rgf_time</span><span> </span><span>=</span><span> </span><span>highdim_ranger_time</span><span> </span><span>=</span><span> </span><span>highdim_xgb_time</span><span> </span><span>=</span><span> </span><span>rep</span><span>(</span><span>NA</span><span>,</span><span> </span><span>NUM_FOLDS</span><span>)</span><span>
</span><span>for</span><span> </span><span>(</span><span>i</span><span> </span><span>in</span><span> </span><span>1</span><span>:</span><span>length</span><span>(</span><span>FOLDS</span><span>))</span><span> </span><span>{</span><span>
</span><span>cat</span><span>(</span><span>&quot;fold : &quot;</span><span>,</span><span> </span><span>i</span><span>,</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span><span>new_samp</span><span> </span><span>=</span><span> </span><span>unlist</span><span>(</span><span>FOLDS</span><span>[</span><span>-</span><span>i</span><span>])</span><span>
</span><span>new_samp_</span><span> </span><span>=</span><span> </span><span>unlist</span><span>(</span><span>FOLDS</span><span>[</span><span>i</span><span>])</span><span>
</span><span># RGF</span><span>
</span><span>#----</span><span>
</span><span>rgf_start</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>init_regr</span><span> </span><span>=</span><span> </span><span>FastRGF_Regressor</span><span>$</span><span>new</span><span>(</span><span>n_jobs</span><span> </span><span>=</span><span> </span><span>5</span><span>,</span><span> </span><span>l</span><span>2</span><span> </span><span>=</span><span> </span><span>0.1</span><span>)</span><span> </span><span># I added 'l2' regularization</span><span>
</span><span>init_regr</span><span>$</span><span>fit</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>as.matrix</span><span>(</span><span>x</span><span>[</span><span>new_samp</span><span>,</span><span> </span><span>]),</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>y</span><span>[</span><span>new_samp</span><span>])</span><span>
</span><span>pr_te</span><span> </span><span>=</span><span> </span><span>init_regr</span><span>$</span><span>predict</span><span>(</span><span>as.matrix</span><span>(</span><span>x</span><span>[</span><span>new_samp_</span><span>,</span><span> </span><span>]))</span><span>
</span><span>rgf_end</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>highdim_rgf_time</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>rgf_end</span><span> </span><span>-</span><span> </span><span>rgf_start</span><span>
</span><span>highdim_rgf_te</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>MLmetrics</span><span>::</span><span>RMSE</span><span>(</span><span>y</span><span>[</span><span>new_samp_</span><span>],</span><span> </span><span>pr_te</span><span>)</span><span>
</span><span># ranger</span><span>
</span><span>#-------</span><span>
</span><span>ranger_start</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>fit</span><span> </span><span>=</span><span> </span><span>ranger</span><span>(</span><span>dependent.variable.name</span><span> </span><span>=</span><span> </span><span>&quot;Ca&quot;</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>tmp_rg_dat</span><span>[</span><span>new_samp</span><span>,</span><span> </span><span>],</span><span> </span><span>write.forest</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>,</span><span> </span><span>probability</span><span> </span><span>=</span><span> </span><span>F</span><span>,</span><span> </span><span>num.threads</span><span> </span><span>=</span><span> </span><span>5</span><span>,</span><span> </span><span>num.trees</span><span> </span><span>=</span><span> </span><span>500</span><span>,</span><span>
</span><span>verbose</span><span> </span><span>=</span><span> </span><span>T</span><span>,</span><span> </span><span>classification</span><span> </span><span>=</span><span> </span><span>F</span><span>,</span><span> </span><span>mtry</span><span> </span><span>=</span><span> </span><span>NULL</span><span>,</span><span> </span><span>min.node.size</span><span> </span><span>=</span><span> </span><span>5</span><span>,</span><span> </span><span>keep.inbag</span><span> </span><span>=</span><span> </span><span>T</span><span>)</span><span>
</span><span>pred_te</span><span> </span><span>=</span><span> </span><span>predict</span><span>(</span><span>fit</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>x</span><span>[</span><span>new_samp_</span><span>,</span><span> </span><span>],</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>'se'</span><span>)</span><span>$</span><span>predictions</span><span>
</span><span>ranger_end</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>highdim_ranger_time</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>ranger_end</span><span> </span><span>-</span><span> </span><span>ranger_start</span><span>
</span><span>highdim_ranger_te</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>MLmetrics</span><span>::</span><span>RMSE</span><span>(</span><span>y</span><span>[</span><span>new_samp_</span><span>],</span><span> </span><span>pred_te</span><span>)</span><span>
</span><span># xgboost</span><span>
</span><span>#--------</span><span>
</span><span>xgb_start</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>dtrain</span><span> </span><span>&lt;-</span><span> </span><span>xgb.DMatrix</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>as.matrix</span><span>(</span><span>x</span><span>[</span><span>new_samp</span><span>,</span><span> </span><span>]),</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>y</span><span>[</span><span>new_samp</span><span>])</span><span>
</span><span>dtest</span><span> </span><span>&lt;-</span><span> </span><span>xgb.DMatrix</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>as.matrix</span><span>(</span><span>x</span><span>[</span><span>new_samp_</span><span>,</span><span> </span><span>]),</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>y</span><span>[</span><span>new_samp_</span><span>])</span><span>
</span><span>watchlist</span><span> </span><span>&lt;-</span><span> </span><span>list</span><span>(</span><span>train</span><span> </span><span>=</span><span> </span><span>dtrain</span><span>,</span><span> </span><span>test</span><span> </span><span>=</span><span> </span><span>dtest</span><span>)</span><span>
</span><span>param</span><span> </span><span>=</span><span> </span><span>list</span><span>(</span><span>&quot;objective&quot;</span><span> </span><span>=</span><span> </span><span>&quot;reg:linear&quot;</span><span>,</span><span> </span><span>&quot;bst:eta&quot;</span><span> </span><span>=</span><span> </span><span>0.05</span><span>,</span><span> </span><span>&quot;max_depth&quot;</span><span> </span><span>=</span><span> </span><span>6</span><span>,</span><span> </span><span>&quot;subsample&quot;</span><span> </span><span>=</span><span> </span><span>0.85</span><span>,</span><span> </span><span>&quot;colsample_bytree&quot;</span><span> </span><span>=</span><span> </span><span>0.85</span><span>,</span><span> </span><span>&quot;booster&quot;</span><span> </span><span>=</span><span> </span><span>&quot;gbtree&quot;</span><span>,</span><span>
</span><span>&quot;nthread&quot;</span><span> </span><span>=</span><span> </span><span>5</span><span>)</span><span> </span><span># &quot;lambda&quot; = 0.1 does not improve RMSE</span><span>
</span><span>fit</span><span> </span><span>=</span><span> </span><span>xgb.train</span><span>(</span><span>param</span><span>,</span><span> </span><span>dtrain</span><span>,</span><span> </span><span>nround</span><span> </span><span>=</span><span> </span><span>500</span><span>,</span><span> </span><span>print_every_n</span><span> </span><span>=</span><span> </span><span>100</span><span>,</span><span> </span><span>watchlist</span><span> </span><span>=</span><span> </span><span>watchlist</span><span>,</span><span>
</span><span>early_stopping_rounds</span><span> </span><span>=</span><span> </span><span>20</span><span>,</span><span> </span><span>maximize</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>,</span><span> </span><span>verbose</span><span> </span><span>=</span><span> </span><span>0</span><span>)</span><span>
</span><span>p_te</span><span> </span><span>=</span><span> </span><span>xgboost</span><span>:::</span><span>predict.xgb.Booster</span><span>(</span><span>fit</span><span>,</span><span> </span><span>as.matrix</span><span>(</span><span>x</span><span>[</span><span>new_samp_</span><span>,</span><span> </span><span>]),</span><span> </span><span>ntreelimit</span><span> </span><span>=</span><span> </span><span>fit</span><span>$</span><span>best_iteration</span><span>)</span><span>
</span><span>xgb_end</span><span> </span><span>=</span><span> </span><span>Sys.time</span><span>()</span><span>
</span><span>highdim_xgb_time</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>xgb_end</span><span> </span><span>-</span><span> </span><span>xgb_start</span><span>
</span><span>highdim_xgb_te</span><span>[</span><span>i</span><span>]</span><span> </span><span>=</span><span> </span><span>MLmetrics</span><span>::</span><span>RMSE</span><span>(</span><span>y</span><span>[</span><span>new_samp_</span><span>],</span><span> </span><span>p_te</span><span>)</span><span>
</span><span>}</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>fold</span><span> </span><span>:</span><span> </span><span>1</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>2</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>3</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>4</span><span> </span><span>fold</span><span> </span><span>:</span><span> </span><span>5</span><span> </span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>cat</span><span>(</span><span>&quot;total time rgf 5 fold cross-validation : &quot;</span><span>,</span><span> </span><span>sum</span><span>(</span><span>highdim_rgf_time</span><span>),</span><span> </span><span>&quot; mean rmse on test data : &quot;</span><span>,</span><span> </span><span>mean</span><span>(</span><span>highdim_rgf_te</span><span>),</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span><span>cat</span><span>(</span><span>&quot;total time ranger 5 fold cross-validation : &quot;</span><span>,</span><span> </span><span>sum</span><span>(</span><span>highdim_ranger_time</span><span>),</span><span> </span><span>&quot; mean rmse on test data : &quot;</span><span>,</span><span> </span><span>mean</span><span>(</span><span>highdim_ranger_te</span><span>),</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span><span>cat</span><span>(</span><span>&quot;total time xgb 5 fold cross-validation : &quot;</span><span>,</span><span> </span><span>sum</span><span>(</span><span>highdim_xgb_time</span><span>),</span><span> </span><span>&quot; mean rmse on test data : &quot;</span><span>,</span><span> </span><span>mean</span><span>(</span><span>highdim_xgb_te</span><span>),</span><span> </span><span>&quot;\n&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<div>
<div>
<pre><code><span>
</span><span>total</span><span> </span><span>time</span><span> </span><span>rgf</span><span> </span><span>5</span><span> </span><span>fold</span><span> </span><span>cross</span><span>-</span><span>validation</span><span> </span><span>:</span><span> </span><span>92.31971</span><span> </span><span>mean</span><span> </span><span>rmse</span><span> </span><span>on</span><span> </span><span>test</span><span> </span><span>data</span><span> </span><span>:</span><span> </span><span>0.5155166</span><span>
</span><span>total</span><span> </span><span>time</span><span> </span><span>ranger</span><span> </span><span>5</span><span> </span><span>fold</span><span> </span><span>cross</span><span>-</span><span>validation</span><span> </span><span>:</span><span> </span><span>27.32866</span><span> </span><span>mean</span><span> </span><span>rmse</span><span> </span><span>on</span><span> </span><span>test</span><span> </span><span>data</span><span> </span><span>:</span><span> </span><span>0.5394164</span><span>
</span><span>total</span><span> </span><span>time</span><span> </span><span>xgb</span><span> </span><span>5</span><span> </span><span>fold</span><span> </span><span>cross</span><span>-</span><span>validation</span><span> </span><span>:</span><span> </span><span>30.48834</span><span> </span><span>mean</span><span> </span><span>rmse</span><span> </span><span>on</span><span> </span><span>test</span><span> </span><span>data</span><span> </span><span>:</span><span> </span><span>0.5453544</span><span>
</span></code></pre>
</div>
</div>
<p></p>
<p>The <em>README.md</em> file of the <em>RGF</em> package includes the SystemRequirements and installation instructions.</p>
<p>An updated version of the RGF package can be found in my <a rel="nofollow" href="https://github.com/mlampros/RGF" target="_blank">Github repository</a> and to report bugs/issues please use the following link, <a rel="nofollow" href="https://github.com/mlampros/RGF/issues" target="_blank">https://github.com/mlampros/RGF/issues</a>.</p>
<p></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://mlampros.github.io/mlampros.github.io/2018/02/14/the_RGF_package/"> mlampros</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/CqRFrcsQDJ8" height="1"></a></div>