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 just two possible values. For example, you might want to predict the sex (male or female) of a person based on their height, annual income, and credit rating. There are many different techniques you can use for binary classification. Older techniques include logistic regression, support vector machine, naive Bayes, k-nearest neighbors, decision trees, and several others.

Using a neural network for binary classification has several advantages over other techniques. But NNs have disadvatages too, most notably they 1.) require lots of training data, and 2.) the resulting model is difficult to interpret (the model that is, not a specific prediction).

It’s possible to write neural network code from scratch using a language like Java, C#, or Python. But writing from scratch is very time consuming. So, the usual approach is to use a neural network code library. Amonmg my colleagues, the most common libraries are Keras, TensorFlow, PyTorch, scikit-learn, and MXNet, but there are dozens more.

Keras operates at a relatively high level of abstraction which means that you can get a system up and running fairly quickly. The disadvantage of Keras is that it’s moe difficult to customize than TensorFlow and PyTorch. Keras uses the Python language which is by far the most common language for ML. And note that Keras actually relies on TensorFlow.

For my talk, I used the Cleveland Heart Disease dataset. The goal is to predict whether a patient will develop heart disease based on 13 predictor variables (age, sex, cholesterol level, etc.)

Even though the program code is quite short, it’s extremely dense, meaning there are many ideas associated with each line of code. The output of the trained neural network is a single value between 0.0 and 1.0 where a value of less than 0.5 means a prediction of no heart disease, and an output value greater than 0.5 means heart disease.



Two images from my “What the Heck?” collection. (Click to enlarge image) Left: “Legendary blind chess player Zsiltzova Lubov looks over the game of Anna Stolarczyk” What?! Right: “Headless Body in Topless Bar”. Perhaps the best newspaper headline in history.

This entry was posted in Keras, Machine Learning. Bookmark the permalink.

1 Response to I Give a Talk on Binary Classification Using Keras

  1. Pingback: Binary Classification Using Keras – Frank's World of Data Science & AI

Comments are closed.