Tuesday, June 9, 2026

Understanding Feature Importance in Data Science: A Practical Walkthrough Using Heart Disease Data

 



Introduction

One of the most important ideas in machine learning is feature importance—understanding which input variables actually influence a model’s predictions. For students entering Data Science, this concept often feels straightforward at first, but quickly becomes more subtle when applied in real models.

In this walkthrough, we’ll use the Cleveland Heart Disease dataset from the UCI Machine Learning Repository to explore the full pipeline:

  1. Acquiring real-world data (and dealing with installation challenges)

  2. Cleaning and preparing messy medical data

  3. Training a Random Forest model

  4. Interpreting feature importance—and avoiding a very common misunderstanding


1. Acquiring the Data: Real-World Data is Rarely Plug-and-Play

In many introductory tutorials, datasets are clean and immediately available. Real-world data is rarely that convenient.

For this example, we use the Cleveland Heart Disease Dataset, which is commonly accessed through Python libraries such as ucimlrepo.

Before you can even load the dataset, you may need to install an external package:

pip install ucimlrepo

Then, you can retrieve the dataset:

from ucimlrepo import fetch_ucirepo

heart_disease = fetch_ucirepo(id=45)

X = heart_disease.data.features
y = heart_disease.data.targets

Key Lesson

Even at the “data loading” stage, students encounter a real-world issue:

Data science workflows often depend on external packages that are not included in standard Python installations.

This is an important shift in thinking, from “writing code” to “managing environments and dependencies.”


2. Cleaning the Data: The Unseen Majority of Data Work

Once the dataset is loaded, it is rarely ready for modeling.

A common issue in the Cleveland dataset is missing values represented as "?", which are not automatically interpreted as numeric nulls.

This requires explicit cleaning:

import numpy as np
import pandas as pd

# Replace missing value placeholders
X_clean = X.replace("?", np.nan)

# Convert all columns to numeric
X_clean = X_clean.apply(pd.to_numeric)

# Fill missing values (median is a common choice)
X_clean = X_clean.fillna(X_clean.median())

Key Lesson

At this stage, students often discover an important reality:

Most of the effort in data science is not modeling—it is preparing the data so a model can even run correctly.

Without cleaning, even powerful algorithms like Random Forests will either fail or produce misleading results.


3. Modeling: Random Forests and the Feature Importance Trap

Now we train a Random Forest classifier:

from sklearn.ensemble import RandomForestClassifier

y_binary = (y.iloc[:, 0] > 0).astype(int)

model = RandomForestClassifier(
    n_estimators=100,
    random_state=42
)

model.fit(X_clean, y_binary)

We then extract feature importance:

import pandas as pd

importance = pd.DataFrame({
    "Feature": X_clean.columns,
    "Importance": model.feature_importances_
}).sort_values(by="Importance", ascending=False)

print(importance)

A typical result might show a feature like thalach (maximum heart rate achieved) as the most important predictor, with a value such as 0.127.




The Common Misinterpretation

This is where many beginners make a mistake:

“0.127 looks small—so this feature must not be very important.”

This interpretation is incorrect.

Random Forest feature importance values:

  • Always sum to 1.0

  • Represent relative contribution across all features

  • Are not probabilities or absolute effect sizes

In a dataset with ~13 features, the “average” importance is:

1 / 13 ≈ 0.077

So a value like 0.127 is actually significantly above average.


Why Importance Values Feel Smaller Than Expected

Feature importance is distributed across:

  • Correlated variables (e.g., heart rate, chest pain, exercise response)

  • Many small contributions from multiple splits

  • The averaging effect across hundreds of trees

This leads to a natural spread where even strong predictors may not dominate visually.


Key Insight

Feature importance is not about how “big” a number looks. Rather, it is about how the model distributes decision-making across variables.

This is one of the most important conceptual shifts in early machine learning education.


Conclusion

Using the Cleveland heart disease dataset, we walked through a complete beginner-friendly machine learning workflow:

  • Installing and loading real-world datasets

  • Cleaning imperfect medical data

  • Training a Random Forest classifier

  • Interpreting feature importance correctly

The most valuable takeaway is not the model itself, but the interpretation:

In data science, understanding what a model is doing is often more important than achieving high accuracy.

Feature importance is a powerful tool—but only when it is interpreted correctly.


Optional Next Step

To deepen understanding, try:

  • Removing the top 3 features and retraining the model

  • Using permutation importance instead of built-in importance

  • Comparing results across multiple models (Logistic Regression vs Random Forest)

These experiments often reveal that “importance” is not absolute. It depends on the model itself.


About the Author:

Dr. Dax Bradley is a professor of Computer Science and a lifelong connoisseur of all things nerdy. When he’s not teaching data structures or debugging Python code, he’s diving into Dungeons & Dragons campaigns, quoting obscure B-movies, or debating the finer points of Star Wars canon. He believes comic books are literature, bad movies deserve love, and if there’s a bigger nerd in the room, he’d really like to meet them.

Wednesday, July 9, 2025

Building an Arcade Cabinet for My Grandkids – A Journey of Nostalgia, Creativity, and a Little Bit of Sawdust

 By Dax Bradley

There’s something magical about the sounds and sights of an '80s arcade. The chiptune music, the flashing lights, and the rhythmic clack of buttons—all of it takes me back. I’ve always loved retro games and the decade that brought them to life. A while back, I decided to channel that love into building my own tabletop arcade machine. It was nearly complete when my grandsons came to visit—and their eyes lit up the moment they saw it.



Sadly, it wasn’t finished before they left, but the spark was there. I knew I had to build one just for them. With Christmas a few months away, I challenged myself to complete an arcade cabinet in time—and to do it on a budget using as many reclaimed materials as possible. What followed was a rewarding mix of nostalgia, problem-solving, and joyful anticipation.

Gathering Materials: From Barnwood to Button Mash

I made it a mission to use reclaimed parts wherever I could, especially for the wood. Scouring Facebook Marketplace, I stumbled across an old wooden desk being given away by a kind widow. It had been sitting in her barn for years, weathered and rough, but perfect for a project like this. Not only did I score more than enough wood, but I was also giving new life to something with its own story.






To visualize the layout, I turned to 3D software—starting in SketchUp and refining in Blender. While not strictly necessary, the mockups helped me plan spacing for the monitor, buttons, wiring, and other components. It was especially helpful given I hadn't yet finalized what materials I'd be using.




The Monitor and Electronics: Bargain Finds and Cautious Wiring

For the screen, I once again returned to Marketplace and picked up a VGA computer monitor for under $20. The JAMMA PCB board I used (specifically a 60-in-1 model) supports both CRTs and VGA, as well as a speaker output—making it incredibly versatile.

Arcade-quality buttons, a joystick, wiring harness, and a power supply rounded out the electronics. These were the only components I couldn’t easily reclaim, but I was able to get everything for around $75 online. The only issue I had with the purchases was the power supply was evidently tossed around during shipping, resulting in a dinged corner which you can see in the image. It was easy to straighten and did not affect the function. I could have sent back for a new one, but time was running out.



As someone with electronics experience, I knew how important safety was. I tested all the LED buttons using a simple 5V output from an Arduino before wiring anything to a wall-powered supply. 

                          



While JAMMA harnesses are mostly plug-and-play, labeling each wire on the non-board side saved me countless headaches later.



Construction Challenges: Flexibility is Key

The wood from the desk wasn’t pristine—some corners were rotted, cracked, or warped. In one case, I had to completely rebuild a corner with wood filler and spackle. A little sanding, some patience, and a few coats of black satin spray paint brought everything together beautifully.




One of the most important lessons: be flexible. The design changed more than once to accommodate the imperfections in the wood. I adjusted the template and rolled with it—like any good maker has to.







Final Touches: Graphics, Sound, and Sentiment

I customized the controller layout and marquee using Pinterest for inspiration, then edited everything in GIMP to add our family name and retro graphics. I got it printed out at Office Depot for very little money. A single speaker connected easily to the PCB with no extra power supply required. Even better—there was a volume control right on the board.



The final cabinet was tested, packed up, and delivered to Tennessee just in time for Christmas morning. The look on the boys' faces made every hour worth it. They dove in immediately, picking favorites among the 60 classic games—and according to them, the fun hasn’t stopped.




Looking Back—and Ahead

This little project became something much bigger than a holiday gift. It was a way to share my love of retro games, to teach resourcefulness, and to build something with care and intention. And most of all, it became a memory-maker.

I hope the cabinet lasts for years, not just as a fun gaming machine, but as a symbol of how we can blend nostalgia with creativity—and maybe even pass it on to the next generation.


About the Author:

Dr. Dax Bradley is a professor of Computer Science and a lifelong connoisseur of all things nerdy. When he’s not teaching data structures or debugging Python code, he’s diving into Dungeons & Dragons campaigns, quoting obscure B-movies, or debating the finer points of Star Wars canon. He believes comic books are literature, bad movies deserve love, and if there’s a bigger nerd in the room, he’d really like to meet them.

Monday, July 7, 2025

So Bad It's Brilliant! My Top 10 MST3K Episodes That I Love (and You Should Too)



There’s something beautifully bizarre about a truly bad movie. The wooden acting, the baffling plot choices, the zero-budget special effects—all of it combines into an experience that’s strangely hypnotic. 

And while some people can’t get past the clunkiness, I’ve always found a weird sort of joy in watching cinematic misfires. Maybe it’s the ambition behind them. Maybe it’s the unintentional comedy. Maybe it’s just that I like things that are a little off.

 But my love of bad movies truly blossomed when I discovered Mystery Science Theater 3000. This gloriously absurd show—featuring a human host and his robot companions riffing on terrible films while trapped in space—made bad movies not just tolerable, but downright enjoyable. 

With MST3K, what would’ve been an agonizing slog through awkward line deliveries and nonsensical plots becomes a laugh-out-loud joyride of clever jokes and shared disbelief.

 Whether you’re a longtime Mistie or someone curious about the best (or worst?) the show has to offer, here’s a look at 10 of my favorite MST3K episodes—in no particular order—plus one honorable mention. These are the episodes I go back to again and again, not just because of the movies themselves (though some are... something else), but because of the brilliant, hilarious commentary that transforms each one into a cult classic in its own right.


Eegah!




This unique offering has a really interesting vibe. I can't explain it, but there is a dreamlike quality in every frame. If you’ve experienced Arch Hall Sr. and Jr’s opus years ago, perhaps you remember it like a fever dream. Part caveman-sort-of-monster movie, part beach movie, part musical—it suffers from an identity crisis but succeeds in holding your attention as you wonder what could possibly happen next.

 Trivia

- The titular Eegah was played by Jaws actor Richard Kiel. 

- The famous MST3K catchphrase "Watch out for snakes!" was lifted from this movie and became a fan-favorite Easter egg, even inspiring a live tour name.

 Favorite Riff:

 (Female lead character Roxy screams uncontrollably)

 Arch Hall Jr.: "Roxy, it’s just me."

 Bots: “I know—that’s why I’m screaming. AAAAAAAAH!”


Manos: The Hands of Fate



The first MST3K VHS movie I bought, and unironically one of my favorite horror movies. Period. Not just for the riffing. Something about the strange pacing, the eerie music, and the bizarre characters stays with you.

It’s as if someone tried to make a horror film with no experience whatsoever (which is exactly what happened). The result is haunting in a way that most actual horror movies aren’t.

Trivia

- Made by El Paso fertilizer salesman Harold P. Warren on a bet. 

- The name literally translates to "Hands: The Hands of Fate" — a redundancy only MST3K could appreciate.

 Favorite Riff:

 Master: "Silence!"

 Joel: "—is golden!"


Pod People



This is what happens when a gritty horror script suddenly gets rewritten to capitalize on the success of E.T.

 The result: a movie that can't decide what it is. It's a horror movie with a cute alien named Trumpy, a child protagonist, and also—a rock band? Even the MST3K crew refers to it as three films in one: "Movie A, B, and C."

 Trivia

- U.S. distributors added the alien storyline over a more violent Spanish film. - The opening credits steal footage from Galaxy Invader, another MST3K favorite.

 Favorite Riff:

 (Alien examines multiple items)

 Crow: (Mock voice-over) “Hmmm…this is another potato. (looks at rabbit)…This potato has long ears.”

 Kid: “Trumpy, so you know what playing is?”

 Servo: “It’s where I break you in half and eat you.”

 

Santa Claus (1959)



 A Christmas movie that feels more like a fever dream. Made in Mexico and dubbed into English by K. Gordon Murray, this version of Santa Claus has him fighting a red-tights-wearing demon named Pitch, flying through space, and using a surveillance system to spy on children. The doll sequences and mechanical reindeer are pure nightmare fuel.

 Trivia

- Murray added near-constant laughing instead of translating the original dialogue. 

- Features a multilingual chorus of child laborers singing Santa's praises.

 Favorite Riff:

 (Pitch shivers on a rooftop)

 Mike: “Santa, I just need some ‘stuff,’ man, come on, just a taste, come on, man!”

 

Star Crash



 A Star Wars knockoff with style, and I mean that sincerely. Caroline Munro stars as space-smuggler Stella Star, alongside a Texan-accented robot, a lightsaber-wielding Fabio-type, and David Hasselhoff. And yes, Christopher Plummer delivers his lines with Shakespearean dignity in the middle of a sci-fi cheese platter.

 Trivia

- Plummer took the part for a short paid vacation in Rome. 

- The script was rewritten mid-shoot, often leading to actors improvising entire scenes.

 Favorite Riff:

 (Stella Star explores a spaceship)

 Servo: “Wow! There’s no line for Star Tours!”

 

The Wild Wild World of Batwoman



 This one defies description. A strange mix of spy movie, superhero parody, and surrealist mess. It's one of those so-bad-it's-good movies made better when shared. I have a sentimental attachment to this one because I watched it with my son on VHS, and we couldn’t stop laughing.

 Trivia

- Director Jerry Warren reused footage from his own earlier films to pad runtime. 

- Despite the title, it has no connection to DC's Batwoman.

 Favorite Riff:

 (Three Batwomen standing together)

 Mike: “Angels, you’re going undercover tonight with Adam West!”

 

This Island Earth



This movie was the centerpiece for MST3K: The Movie, and it's just a joy to watch. The sci-fi visuals are decent, but the pacing and plot are ripe for riffing. It follows a group of Earth scientists taken to the planet Metaluna to save it from destruction. Cue the classic MU-Tant alien.

Trivia

- The studio cut a planned short film from MST3K: The Movie to reduce runtime. 

- "Normal view!" became a running joke in MST3K fandom.

 Favorite Riff:

 (Crew watches their home planet on a monitor)

 Exeter: “Switch to normal view.”

 Crow, Mike, Servo (singing): “Normallll viewww... NORRRRRMALLL VIEWWWWW!”

 

Space Mutiny



This movie borrows heavily from Battlestar Galactica, literally stealing footage and models. The plot follows Reb Brown as a man-mountain of a space officer trying to stop a mutiny. It's famous for continuity errors, including a dead character who keeps reappearing. This one made such an impact it made our book, which you can find here

Trivia: 

- The lead actor’s repeated entrance triggered a running gag of absurd manly nicknames. 

- Features one of the most awkward slow-motion chase scenes ever filmed.

 Favorite Riff:

 Mike: "Blast Hardcheese!"

 Crow: "Slab Bulkhead!"

 Servo: "Drunk Slam-Chest!"


The Beginning of the End



Peter Graves stars as a scientist whose food-growing experiment leads to a plague of giant grasshoppers. The effects include placing live insects on postcards of Chicago skyscrapers. I love this movie for its earnest tone and terrible science.

Trivia

- Directed by Bert I. Gordon, a.k.a. "Mr. B.I.G." 

- Famous for the shot of grasshoppers slipping off photos of buildings.

 Favorite Riff:

 (Deaf assistant flails in fear)

 Servo: “He’s signing, 'AAAAAAAAAAAAH!'”

 

Hobgoblins



 One of the most iconic Gremlins ripoffs, and possibly the cheapest. The monsters tap into your deepest desires and fantasies—then use them to kill you. Not that the logic matters. The puppets are laughable, the acting is wooden, and the plot is nonsense.

Trivia

- Director Rick Sloane fully leaned into the cult status and made Hobgoblins 2 in 2009. 

- One of the few MST3K films with a nightclub dance-off death.

 Favorite Riff:

 (Nightclub scene, girl trying to look seductive)

 DJ: “Is she a HIT or a MISS?”

 Guy holds up a sign: “HIT”

 Crow: “They should really add an 'S' to that.”

 Servo: “HITS?”

 

Honorable Mention: Time Chasers



 When brilliant inventor Nick cobbles together a time machine using an airplane and a Commodore-64,

 things go downhill fast. A forgettable early-'90s film transformed into a classic by the MST3K crew.

 Trivia

- Features Troll 2’s George Hardy as villain J.K. Robertson. 

- Nick's mullet and shirtless scenes are meme-worthy.

Favorite Riff:

 Nick (shirtless on the phone): "Sure."

 Servo: "SURE, I'm an unappealing actor in a bad movie!"

 

Wrapping Up: Bad Movies, Good Times

 At the end of the day, Mystery Science Theater 3000 is more than just a funny show about bad movies—it’s a shared language. It’s an invitation to laugh with the movie, not just at it. It teaches us to appreciate sincerity over perfection, effort over polish, and joy over judgment.

For me, these episodes aren’t just funny—they're memories. As a single dad, weekends with my son were everything. We didn’t have a lot of money for outings or events, but we had MST3K tapes, a battered VCR, and our own goofy commentary layered on top of Joel, Mike, and the bots. We'd stay up late watching these oddball flicks, rewinding the parts that made us laugh hardest, quoting riffs at breakfast the next morning.

Now that he's grown, it’s something we still share—a shorthand of inside jokes, bad sci-fi, and great memories. These cheesy old movies gave us a way to bond, to laugh, to connect. That’s what Mystery Science Theater 3000 does best: it turns the worst movies into some of the best times.


About the Author:

Dr. Dax Bradley is a professor of Computer Science and a lifelong connoisseur of all things nerdy. When he’s not teaching data structures or debugging Python code, he’s diving into Dungeons & Dragons campaigns, quoting obscure B-movies, or debating the finer points of Star Wars canon. He believes comic books are literature, bad movies deserve love, and if there’s a bigger nerd in the room, he’d really like to meet them.

Thursday, September 13, 2018

Scam Alert





 If you suspect a scam, keep these red flags in mind:


  • The site asks for payment by wire or money order instead of Paypal or Credit Card. Always use a card if possible, because you can usually dispute a scam an receive a refund.

  • The site uses a professional brand name, but also includes special characters or words rather than just the brand name. Case in point Pandorasukonline, which is now pulled. Pandora does not add phrases or words to their brand.

  • Hyperlinks that go nowhere (broken links)

  • Spelling errors, grammar errors, or unusual wording - a dead giveaway that the administrator's first language is not English. While that in itself is not a crime, keep in mind real retailers thoroughly vet their content professionally before publishing 

  • While this may sound obvious, it needs to be said: If it sounds too good to be true, it normally is. If someone as in the computers example above offers you a Predator (c) gaming rig, even refurbished, for less than $1500 US, especially at $99, you are looking at a scam

-Dax

Thursday, October 5, 2017

Update on the "Four in a Row" app progress

10/5/17

I had put the Connect Four clone project on hold while I was in school. I finished the first part of my dissertation, so now I have a couple of week break before returning to school, so I worked on the game project a bit more. I added some sounds, and tweeked the code to make it simpler to play.

The goal is for anyone to be able to pick up and play the game without any coaching, so simplicity is the order of the day. I made it easy to click any region on the screen and drop a token into place. Also I added some instructions to carry out if the program "senses" that there are four of the same colored tokens in a row. It was pretty easy, until I realized that the diagonal four-in-a-row routines would require a different approach then horizontal and vertical.

But, I got that problem solved with some elbow grease. If you know a little about programming and algorithm design, I used a "Brute Force" algorithm to check all possible cases for diagonal four-in-a-row success.  Basically, it asks, "Are there four in a row for Case 1?  No, Ok, how about Case 2..." and so on.  If you've never heard of brute force algorithms, it's basically what it sounds like. It checks each possible outcome, one at a time until it reaches all possible outcomes.

It's kind of a pain in the neck, but it works.

I'm 100% certain that a better programmer would have created an easier way, but I suppose that the good news is that part is done. Yay!