19 Most Elegant Sklearn Tricks I Found After 3 Years of Use
<p>Learn about 19 Sklearn features you have never seen that are direct and elegant replacements to common operations you do manually.</p>
<p> </p>
<p>Image by me with Midjourney</p>
<h2>Introduction</h2>
<p>After three years of use and by looking at the API reference of Sklearn, I have realized that the most commonly used models and functions are only a thin slice of what the library can do. Even though some features are extremely narrow-focused and used for rare edge cases, I have found many estimators, transformers, and utility functions that are more elegant fixes to common operations people do manually.</p>
<p>So, I have decided to make a list of the most elegant and important ones and briefly explain them so that you can significantly expand your Sklearn toolset in a single article. Enjoy!</p>
<h2>covariance.EllipticEnvelope</h2>
<p>It is common for distributions to have outliers. Many algorithms deal with outliers and <code>EllipticalEnvelope</code> is an example that is directly built-in to Sklearn. The advantage of this algorithm is that it performs exceptionally well at detecting outliers in normally distributed (Gaussian) features:</p>
<p><a href="https://pub.towardsai.net/19-most-elegant-sklearn-tricks-i-found-after-3-years-of-use-5bda439fa506">Website</a></p>