Scikit-learn Library

Logistic Regression in Python Scikit-Learn

Logistic regression is a popular algorithm for classification problems (despite its name indicating that it is a “regression” algorithm). It belongs to one of the most important algorithms in the machine learning space. Linear Regression Background Let’s review linear regression. Given the training data, we compute a line that fits this training data so that …

Logistic Regression in Python Scikit-Learn Read More »

Random Forest Classifier with sklearn

Does your model’s prediction accuracy suck but you need to meet the deadline at all costs? Try the quick and dirty “meta-learning” approach called ensemble learning. In this article, you’ll learn about a specific ensemble learning technique called random forests that combines the predictions (or classifications) of multiple machine learning algorithms. In many cases, it …

Random Forest Classifier with sklearn Read More »

SVM sklearn: Python Support Vector Machines Made Simple

Support Vector Machines (SVM) have gained huge popularity in recent years. The reason is their robust classification performance – even in high-dimensional spaces: SVMs even work if there are more dimensions (features) than data items. This is unusual for classification algorithms because of the curse of dimensionality – with increasing dimensionality, data becomes extremely sparse …

SVM sklearn: Python Support Vector Machines Made Simple Read More »

K-Nearest Neighbors (KNN) with sklearn in Python

The popular K-Nearest Neighbors (KNN) algorithm is used for regression and classification in many applications such as recommender systems, image classification, and financial data forecasting. It is the basis of many advanced machine learning techniques (e.g., in information retrieval). There is no doubt that understanding KNN is an important building block of your proficient computer …

K-Nearest Neighbors (KNN) with sklearn in Python Read More »

[Tutorial] K-Means Clustering with SKLearn in One Line

If there is one clustering algorithm you need to know – whether you are a computer scientist, data scientist, or machine learning expert – it’s the K-Means algorithm. In this tutorial drawn from my book Python One-Liners, you’ll learn the general idea and when and how to use it in a single line of Python …

[Tutorial] K-Means Clustering with SKLearn in One Line Read More »

Machine Learning Linear Regression Python

Python Linear Regression with sklearn – A Helpful Illustrated Guide

💡 This tutorial will show you the most simple and straightforward way to implement linear regression in Python—by using scikit-learn’s linear regression functionality. I have written this tutorial as part of my book Python One-Liners where I present how expert coders accomplish a lot in a little bit of code. Feel free to bookmark and download …

Python Linear Regression with sklearn – A Helpful Illustrated Guide Read More »

Logistic Regression Scikit-learn vs Statsmodels

What’s the difference between Statsmodels and Scikit-learn? Both have ordinary least squares and logistic regression, so it seems like Python is giving us two ways to do the same thing. Statsmodels offers modeling from the perspective of statistics. Scikit-learn offers some of the same models from the perspective of machine learning. So we need to …

Logistic Regression Scikit-learn vs Statsmodels Read More »

Decision Tree Learning — A Helpful Illustrated Guide in Python

This tutorial will show you everything you need to get started training your first models using decision tree learning in Python. To help you grasp this topic thoroughly, I attacked it from different perspectives: textual, visual, and audio-visual. So, let’s get started! Why Decision Trees? Deep learning has become the megatrend within artificial intelligence and …

Decision Tree Learning — A Helpful Illustrated Guide in Python Read More »

Why does Python Look Great on Your Resume?

Nothing to add—let’s get started! 🐍 Python is the fastest-growing major programming language. A StackOverflow 2019 developer survey shows that Python is not only faster growing than C++, Java, JavaScript, and any other major programming language, it also comes with a happier community that loves the language most. Python is great for machine learning. Python comes with …

Why does Python Look Great on Your Resume? Read More »

Why Does the Scikit-learn Library use a Trailing Underscore Convention for Attribute Names?

If you’ve used the sklearn library in your own code, you may have realized that all attributes are suffixed with a trailing underscore. Here’s an example for the k-means algorithm: In the second-last line, we used the kmeans attribute cluster_centers_. Why does sklearn library not use the attribute name cluster_centers? ‘The short answer is, the …

Why Does the Scikit-learn Library use a Trailing Underscore Convention for Attribute Names? Read More »