<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/fselectorrcpp-on-cran/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://r-addict.com/2017/03/14/FSelectorRcpp-Release.html"> http://r-addict.com</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img src="https://i0.wp.com/r-addict.com/images/fulls/fire.jpg?w=456" data-recalc-dims="1"> <a target="_blank" rel="nofollow" href="http://mi2-warsaw.github.io/FSelectorRcpp/">FSelectorRcpp</a> – Rcpp (free of Java/Weka) implementation of <a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/FSelector/index.html">FSelector</a> entropy-based feature selection algorithms with a sparse matrix support, has finally arrived on <a target="_blank" rel="nofollow" href="https://cran.rstudio.com/web/packages/FSelectorRcpp/index.html">CRAN</a> after <a target="_blank" rel="nofollow" href="https://github.com/mi2-warsaw/FSelectorRcpp">a year of development</a>. It is also equipped with a parallel backend.</p>
<p>Big thanks to the main architect: <a target="_blank" rel="nofollow" href="https://github.com/zzawadz">Zygmunt Zawadzki, zstat</a>, and our reviewer: <a target="_blank" rel="nofollow" href="https://github.com/krzyslom">Krzysztof Słomczyński</a>.</p>
<p>If something is missing or not clear – please chat with us on our <a target="_blank" rel="nofollow" href="https://fselectorrcpp.slack.com/messages/general/">slack</a>?</p>
<h3>Get started: <a target="_blank" rel="nofollow" href="http://mi2-warsaw.github.io/FSelectorRcpp/articles/get_started.html">Motivation, Installation and Quick Workflow</a></h3>
<h3><a target="_blank" rel="nofollow" href="http://mi2-warsaw.github.io/FSelectorRcpp/reference/">Provided functionalities</a></h3>
<h3>Blog posts history with use cases</h3>
<ul>
<li><a target="_blank" rel="nofollow" href="http://r-addict.com/2017/01/08/Entropy-Based-Image-Binarization.html">Entropy Based Image Binarization with imager and FSelectorRcpp, Marcin Kosiński</a></li>
<li><a target="_blank" rel="nofollow" href="http://www.r-bloggers.com/venn-diagram-comparison-of-boruta-fselectorrcpp-and-glmnet-algorithms/">Venn Diagram Comparison of Boruta, FSelectorRcpp and GLMnet Algorithms, Marcin Kosiński</a></li>
</ul>
<h3><a target="_blank" rel="nofollow" href="http://mi2-warsaw.github.io/FSelectorRcpp/articles/get_started.html#quick-workflow">Quick Workflow</a></h3>
<p>A simple entropy based feature selection workflow. <strong>Information gain</strong> is an easy, linear algorithm that computes the entropy of a dependent and explanatory variables, and the conditional entropy of a dependent variable with a respect to each explanatory variable separately. This simple statistic enables to calculate the belief of the distribution of a dependent variable when we only know the distribution of a explanatory variable.</p>
<p>
<br>
<div class="feedlyNoScript">
<pre>
       
<figure><pre><code data-lang="r"><span># install.packages(c('magrittr', 'FSelectorRcpp'))
</span><span>library</span><span>(</span><span>magrittr</span><span>)</span><span>
</span><span>library</span><span>(</span><span>FSelectorRcpp</span><span>)</span><span> </span><span>information_gain</span><span>(</span><span> </span><span># Calculate the score for each attribute
</span><span> </span><span>formula</span><span> </span><span>=</span><span> </span><span>Species</span><span> </span><span>~</span><span> </span><span>.</span><span>,</span><span> </span><span># that is on the right side of the formula.
</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>iris</span><span>,</span><span> </span><span># Attributes must exist in the passed data.
</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>&quot;infogain&quot;</span><span>,</span><span> </span><span># Choose the type of a score to be calculated.
</span><span> </span><span>threads</span><span> </span><span>=</span><span> </span><span>2</span><span> </span><span># Set number of threads in a parallel backend.
</span><span> </span><span>)</span><span> </span><span>%>%</span><span> </span><span>cut_attrs</span><span>(</span><span> </span><span># Then take attributes with the highest rank.
</span><span> </span><span>k</span><span> </span><span>=</span><span> </span><span>2</span><span> </span><span># For example: 2 attrs with the higehst rank.
</span><span> </span><span>)</span><span> </span><span>%>%</span><span> </span><span>to_formula</span><span>(</span><span> </span><span># Create a new formula object with </span><span> </span><span>attrs</span><span> </span><span>=</span><span> </span><span>.</span><span>,</span><span> </span><span># the most influencial attrs.
</span><span> </span><span>class</span><span> </span><span>=</span><span> </span><span>&quot;Species&quot;</span><span> </span><span>)</span><span> </span><span>%>%</span><span>
</span><span>glm</span><span>(</span><span>
</span><span>formula</span><span> </span><span>=</span><span> </span><span>.</span><span>,</span><span> </span><span># Use that formula in any classification algorithm.
</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>iris</span><span>,</span><span> </span><span>family</span><span> </span><span>=</span><span> </span><span>&quot;binomial&quot;</span><span> </span><span>)</span><span>
</span></code></pre>
</figure>
<p> 
</p>
<p><img alt="Orly cover" src="https://i1.wp.com/raw.githubusercontent.com/mi2-warsaw/FSelectorRcpp/master/o_rly.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h1>Acknowledgements</h1>
<p>The cover photo of this blog posts comes from https://newevolutiondesigns.com/20-fire-art-wallpapers</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://r-addict.com/2017/03/14/FSelectorRcpp-Release.html"> http://r-addict.com</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/Tpk2XJZh2lA"></a></div></pre></div>