Category Archives: Scikit

The Wheat Seed Problem Using Radius Neighbors Classification with the scikit Library

I was looking at k-NN classification using the scikit library recently. While wading through the scikit documentation, I noticed that scikit has a closely related Radius Neighbors classifier module. When I did my k-NN example, I used the Wheat Seeds … Continue reading

Posted in Scikit | Leave a comment

Example of Kernel Ridge Regression Using the scikit Library

A regression problem is one where the goal is to predict a single numeric value. For example, you might want to predict the income of a person based on their sex, age, State, and political leaning. (Note: Somewhat confusingly, “logistic … Continue reading

Posted in Scikit | Leave a comment

The Wheat Seed Problem Using k-NN Classification With the scikit Library

One of my work laptops died so I tried to reimage it by reinstalling everything, including OS, from the ground up. While that was going on, I decided to entertain myself by doing a k-nearest neighbors (k-NN) classification example using … Continue reading

Posted in Scikit | Leave a comment

Regression (People Income) Using a scikit MLPRegressor Neural Network

The scikit-learn library was originally designed for classical machine learning techniques like logistic regression and naive Bayes classification. The library eventually added the ability to do binary and multi-class classification via the MLPClassifier (multi-layer perceptron) class and regression via the … Continue reading

Posted in Scikit | Leave a comment

Example of Multinomial Naive Bayes Classification Using the scikit Library

The scikit-learn code library has a MultinomialNB class that can be used to create prediction models for multinomial data. The most common form of multinomial data has predictor variables where the values are counts. For example, suppose you want to … Continue reading

Posted in Scikit | Leave a comment

“Binary Classification Using a scikit Decision Tree” in Visual Studio Magazine

I wrote an article titled “Binary Classification Using a scikit Decision Tree” in the February 2023 edition of Microsoft Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2023/02/21/scikit-decision-tree.aspx. A decision tree is a machine learning technique that can be used for binary classification or … Continue reading

Posted in Scikit | 1 Comment

Multi-Class Classification Using a scikit MLPClassifier Neural Network

The scikit-learn (aka scikit) library can do neural networks. In a work environment, I use PyTorch because it’s very flexible. But one morning, just for fun and mental exercise, I decided to create a scikit neural network multi-class classifier to … Continue reading

Posted in Scikit | Leave a comment

Example of Spectral Clustering Using the scikit Library

Ah, where to begin. Bottom line: spectral clustering is a machine learning technique that is great in theory but just isn’t practical or useful in most real-world scenarios. The idea of clustering is to group data points together so that … Continue reading

Posted in Scikit | Leave a comment

Making scikit Confusion Matrices Easier to Understand

I was looking at logistic regression with the scikit-learn (scikit or sklearn for short) library. There is a built-in scikit confusion_matrix(y_actuals, y_predicteds) function to compute and display a confusion matrix. But the output of printing the result of confusion_matrix() isn’t … Continue reading

Posted in Scikit | Leave a comment

Multi-Class Classification Using a scikit Decision Tree

I’ve been reviewing the scikit-learn (scikit for short) library for several months, so I figured I’d do a multi-class decision tree classification example. Before I go any further, let me comment that machine learning beginners are often seduced by the … Continue reading

Posted in Scikit | 1 Comment