In this post, I will go over how I created a function in Python that easily displays some performance metrics of a trained classification model. Since this function came about as part of a larger task, I will provide context along the way to help clarify as I share images and code of my process. Primarily I will be working with the Sci-Kit Learn and Matplotlib packages but have a special appearance from Pandas plotting method, Yellowbrick’s classifier module.

Background

I was given a simple project: use a premade data set to create a use case for a classification model, then create that model. Essentially with a blank slate, I faced an entire internet’s worth of possible data sets to take as the one. Eventually I settled on something sports related, and out of all of the sports I expected to come across, I found one on UFC fights.

If you aren’t familiar with the sport, the Ultimate Fighting Championship (UFC) is a mixed martial arts promoter. Mixed martial arts, frequently referred to as MMA, is a fighting style that is a non-specific blend of multiple traditional fighting disciplines. A great example of blending fighting styles is the fighter Jon Jones. He went from a national junior college wrestling champion to obtaining a purple belt in Brazilian Jiu-Jitsu (BJJ) and a black belt in Gaidojutsu; Gaidojutsu itself being a fighting style developed in 1992 by Greg Jackson using techniques from catch wrestling, BJJ, kickboxing, and judo.

Beyond the greater freedom in how one is allowed to fight in MMA matches, the structure generally follows that of others combat sports such as boxing or wrestling. If you are curious about how it all works on a finer level, I recommend reading the “Rules” section on this Wikipedia page.

I was a big fan during the early 2010s; I had the video games, watched the shows, knew the fighters, etc. If there was one thing I remember about watching these fights, it’s how unpredictable they felt. It seemed that until someone gets knocked down or put in a submission that either fighter could win, no matter the situation. No matter how much of an underdog a particular fighter was statistically, they _still _had a chance to win and occasionally would shock the MMA community in doing so. It was those unpredictable moments that inspired me to use this data set for my project. The big question I wanted to answer was:

Can I predict the winner of a MMA fight based upon their prior performance?

#classification #functional-programming #ufc #scikit-learn #machine-learning

Ultimate Function for Classification
1.35 GEEK