Author Archives: jamesdmccaffrey

Matrix Decomposition

In ordinary arithmetic, the decomposition of a number is finding two numbers that when multiplied together give the original number. For example, the number 12 can be decomposed into 3 and 4 because 3 * 4 = 12. There’s a … Continue reading

Posted in Miscellaneous | Leave a comment

Weighted k-NN Classification Using Python

I wrote an article titled, “Weighted k-NN Classification Using Python” in the April 2019 issue of Visual Studio Magazine. See The weighted k-nearest neighbors (k-NN) classification algorithm is a relatively simple technique to predict the class of an item … Continue reading

Posted in Machine Learning | Leave a comment

Neural Network Momentum using JavaScript

I’ve been slowly but surely implementing core neural network functionality using the JavaScript language. My most recent exploration was modifying a back-propagation function so that it used momentum. The motivation is to speed up training. The idea is best explained … Continue reading

Posted in JavaScript, Machine Learning | 2 Comments

I Give a Talk on Binary Classification Using Keras

I recently gave a short workshop/talk at the tech company I work for on binary classification using the Keras neural network code library. The goal of a binary classification problem is to predict something that can take on one of … Continue reading

Posted in Keras, Machine Learning | 1 Comment

Selecting n Random Items Using JavaScript

Even though I’m not a huge fan of JavaScript, I like the language more than most of my engineering / developer colleagues. Just for fun I decided to code up a function that selects n random integers from N. For … Continue reading

Posted in JavaScript, Miscellaneous | Leave a comment

The Difference Between Cross Entropy and Binary Cross Entropy

The basic ideas of cross entropy error and binary cross entropy error are relatively simple. But they’re often a source of confusion for developers who are new to machine learning because of the many topics related to how the two … Continue reading

Posted in Machine Learning | Leave a comment

Applying a Permutation to an Array

A permutation of order n is an arrangement of the numbers 0 through n-1. For example, one permutation of order 5 is (4, 2, 0, 1, 3). Suppose you have an array of (“C”, “E”, “A”, “B”, “D”) and the … Continue reading

Posted in Machine Learning | Leave a comment