Pandas Melt, Explained

In this blog post, I’ll show you how to use the Pandas melt method. I explain what melt does, how the syntax works, and I’ll show you a simple example. If you need something specific, you can click on any of the following links: Table of Contents: Introduction Syntax Examples Frequently Asked Questions Having said … Read more

Sklearn confusion_matrix, Explained

An image of a confusion matrix, similar to the type of confusion matrix that we would make with Sklearn confusion_matrix.

Scikit-learn, which is affectionately known as sklearn among Python data scientists, is a Python library that offers a wide range of machine learning tools. Among these tools is the confusion_matrix function, which is indispensable when working on classification problems. So in this tutorial, I’ll show you how to use the sklearn confusion_matrix function. I’ll give … Read more

The 5 Python Skills You Need Before You Study Machine Learning

And image showing the 5 Python skills you need before you study machine learning.

Machine learning is a very powerful skill. And machine learning is a valuable skill. According to Glassdoor, the average salary for a machine learning engineer is about $140,000 in 2023. Mastering machine learning could increase your earning power a lot. The question is, how? What’s the best way to get started with machine learning? What … Read more

7 Secrets To Help You Master Python Data Science

If you’ve been reading the Sharp Sight blog for a while, you’ll know that I’m a big fan of elite performers: Navy SEALs, elite athletes, grandmaster chess players, etcetera. I like to research how elite performers operate, because I want to find what makes them special. The techniques. The training methods. The mindsets. In particular, … Read more

The Best Way to Plot an ROC Curve in Python

An image that shows an ROC curve in Python, made with the Seaborn Objects API.

This tutorial will show you how to plot an ROC curve in Python using the Seaborn Objects visualization package. The tutorial is divided into sections for easy navigation, so if you need anything specific, just click on the appropriate link below. Table of Contents: Quick Review of ROC Curves Setup Create Data Plot the ROC … Read more

How to Use the Sklearn Logistic Regression Function

An image of a logistic regression model made with Scikit-learn, also showing a piece of Scikit-learn code.

In this tutorial, I’ll show you how to use the Sklearn Logistic Regression function to create logistic regression models in Python. I’ll quickly review what logistic regression is, explain the syntax of Sklearn LogisticRegression, and I’ll show you a step-by-step example of how to use the technique. If you need something specific, just click on … Read more

Sklearn make_classification, Explained

An image of code that uses Scikit-learn make_classification to create a binary classification dataset, and an image of a scatterplot that plots the resulting binary data.

With the rise of AI, machine learning has suddenly become very popular. Machine learning has been around for decades, but machine learning systems are becoming increasingly important in a range of fields, from healthcare, to finance, to marketing. Python, with a range of libraries for data science and ML, has arguably become the top language … Read more

How to Make a Python Perceptron from Scratch

An image that shows a Perceptron, and code to initialize a Python Perceptron.

The Perceptron stands as one of the most basic building blocks for creating neural networks, including more advanced structures like deep networks and their variants. Originally developed in the late 1950s, Perceptrons were designed to mimic the function of biological neurons. I recently wrote a blog post explaining some of the history of Perceptrons as … Read more