<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stefen Ewers on Medium]]></title>
        <description><![CDATA[Stories by Stefen Ewers on Medium]]></description>
        <link>https://medium.com/@stefenewers?source=rss-779673638c15------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Xv-KruFq26cdEgGjU_tO7w.jpeg</url>
            <title>Stories by Stefen Ewers on Medium</title>
            <link>https://medium.com/@stefenewers?source=rss-779673638c15------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 04:58:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stefenewers/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Neural Networks, but Make It Make Sense: My Week 1 & 2 Recap of Andrew Ng’s Deep Learning Course]]></title>
            <link>https://stefenewers.medium.com/neural-networks-but-make-it-make-sense-my-week-1-2-recap-of-andrew-ngs-deep-learning-course-0964fd5c2366?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/0964fd5c2366</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[andrew-ng]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[learning-algorithms]]></category>
            <category><![CDATA[stanford]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Wed, 04 Jun 2025 13:44:20 GMT</pubDate>
            <atom:updated>2025-06-04T13:44:20.149Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever thought neural networks sound like something straight out of sci-fi, you’re not wrong. But after diving into the first two weeks of Andrew Ng and Standard AI’s <em>Advanced Machine Learning Algorithms</em> course, I can confidently say they’re actually way more logical than they are mystical.</p><p>Here’s a breakdown of the first two weeks — no PhD required.</p><h3>🧠 Week 1: Neural Networks 101 — From T-Shirts to Face ID</h3><p>We kicked things off with a pretty relatable use case: predicting whether a T-shirt will be a top seller. The idea? Feed the network features like price, marketing budget, shipping cost, and material quality. The output? A probability score that says, “Yes, this one’s going viral,” or “Nah, try again.”</p><p>But where it really got interesting was moving from good old logistic regression to something more flexible: neural networks.</p><h3>What’s a Neural Network Anyway?</h3><p>Think of it like a stack of mini logistic regressions (a.k.a. neurons) organized in layers. Each one tries to learn something useful — like how affordable a product is or how much awareness it’s getting. Stack a few of those layers together, and you get what’s called a <strong>multilayer perceptron (MLP)</strong>.</p><p>Each layer builds more complex understanding. Like:</p><ul><li>Layer 1: edges or prices</li><li>Layer 2: eyes or product awareness</li><li>Layer 3: faces or “should I buy this?”</li></ul><p>The cool part? Neural networks <strong>learn features</strong> instead of us manually defining them. That’s the magic sauce.</p><h3>📈 Forward Propagation (a.k.a. Making Predictions)</h3><p>Once your network is trained, forward propagation is how it makes predictions. Think of it like passing data through a funnel:</p><ul><li>Input goes into Layer 1</li><li>Layer 1 activates Layer 2</li><li>And so on until the final output layer spits out your prediction</li></ul><p>We even implemented this in TensorFlow (shoutout Sequential) and by hand using NumPy to really internalize what’s happening under the hood. It’s all just matrix multiplication + activation functions like sigmoid.</p><h3>🔧 Week 2: Time to Train — Where the Real Learning Happens</h3><p>Week 2 shifted gears into training — not just feeding the network examples, but teaching it how to learn.</p><h3>3-Step Game Plan for Training:</h3><ol><li><strong>Build the Model</strong> — Define architecture (layers, neurons, activations).</li><li><strong>Compile</strong> — Set your loss function (e.g. binary_crossentropy) and optimizer (we used adam).</li><li><strong>Fit</strong> — Train the model on your data using model.fit(X, Y).</li></ol><p>Simple? Sure. But here’s where it gets deep.</p><h3>🎯 Loss, Cost, and Why They Matter</h3><p>Training is all about minimizing a cost function. For binary classification, that’s cross-entropy. The goal: make the predicted probabilities match the actual labels as closely as possible.</p><p>The course did a great job explaining the math and the intuition — especially how TensorFlow handles <strong>gradient descent</strong> and <strong>backpropagation</strong> under the hood.</p><p>Even though the libraries do the heavy lifting, knowing what’s happening gives you superpowers when your model doesn’t perform well.</p><h3>⚡️ Activation Functions: It’s Not Just Sigmoid Anymore</h3><p>This was a huge “a-ha” moment for me.</p><p>Until now, everything used the sigmoid function, but that’s not always ideal. Enter:</p><ul><li>ReLU (Rectified Linear Unit): Great for hidden layers, super fast, avoids the dreaded vanishing gradient problem.</li><li>Linear: Use this in output layers when you’re predicting real values (like house prices).</li><li>Softmax: Perfect for <strong>multiclass classification</strong>, like predicting digits 0–9.</li></ul><p>Swapping in the right activation can change everything.</p><h3>🤹‍♀️ Softmax &amp; Multiclass Classification</h3><p>When you’re not just predicting yes/no but <em>which</em> of many categories something belongs to (like which disease a patient has or which digit an image shows), you need softmax.</p><p>This activation takes a vector of raw scores (logits) and turns them into probabilities that all add up to 1. Very elegant.</p><p>Bonus tip: use from_logits=True when compiling your model in TensorFlow to keep things numerically stable. Trust me — your model will thank you.</p><h3>🧠 Optimization: Why We Stan Adam</h3><p>Adam is the optimizer of choice for most modern deep learning. It dynamically adjusts learning rates per parameter so you don’t have to constantly tune them. Huge win for training stability and speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXd9rKakgdBiaoxPylrMow.png" /></figure><h3>🧱 CNNs Preview: When Dense Isn’t Enough</h3><p>The course gave a sneak peek into <strong>convolutional layers</strong> — where instead of every neuron looking at <em>everything</em>, it focuses on small regions (patches). This is huge for tasks like image recognition or ECG analysis. It makes training way more efficient and reduces overfitting.</p><h3>Final Thoughts</h3><p>Weeks 1 and 2 laid an incredible foundation. Here’s what really stood out:</p><p>✅ Neural networks aren’t magic — they’re just stacked logistic regressions with smart activations<br>✅ You can build one from scratch in Python or use TensorFlow’s Sequential API<br>✅ Training is where the magic happens, and understanding loss, activation, and backprop is critical<br>✅ ReLU is your new best friend<br>✅ Adam optimizer makes life easier<br>✅ Use softmax for multiclass, and keep an eye on numerical stability</p><p><strong>Coming Up Next:</strong> Backpropagation, regularization, and digging deeper into model optimization. But for now, I’m going to grab a coffee and reflect on how wild it is that my code can now recognize handwritten digits better than I can.</p><p>If you’re on this journey too, feel free to drop a comment or share your own lightbulb moments. Let’s get smarter together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0964fd5c2366" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ From Real Estate to Regression: Building a Machine Learning App That Predicts Jamaican Airbnb…]]></title>
            <link>https://stefenewers.medium.com/from-real-estate-to-regression-building-a-machine-learning-app-that-predicts-jamaican-airbnb-250bc8178011?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/250bc8178011</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[airbnb]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Sat, 31 May 2025 21:47:07 GMT</pubDate>
            <atom:updated>2025-05-31T21:47:07.955Z</atom:updated>
            <content:encoded><![CDATA[<h3>🇯🇲 From Real Estate to Regression: Building a Machine Learning App That Predicts Jamaican Airbnb Prices</h3><p>Over the past few months, I’ve been diving headfirst into machine learning — not just watching tutorials or tinkering with notebooks, but actually building things that solve real (or at least real-ish) problems.</p><p>Version 1 of my first full-stack ML project is now live:<br>A Streamlit app that predicts the nightly price of an Airbnb in <strong>Jamaica</strong>, based on property features like location, size, and amenities.</p><p>👉 <strong>GitHub repo:</strong> <a href="https://github.com/stefenewers/jamaican-airbnb-price-estimator">github.com/stefenewers/jamaican-airbnb-price-estimator</a></p><h3>🛠 Why I Built This</h3><p>I’m Jamaican. I’ve worked in real estate. And I’m currently on a journey to pivot from proptech and finance into the machine learning and AI space.</p><p>So instead of playing with the Titanic dataset or tuning yet another iris classifier, I decided to build something that connects with my background and interests: <strong>Jamaican Airbnbs</strong>.</p><p>And instead of just training a model and calling it done, I set out to:</p><ul><li>✅ Train it</li><li>✅ Evaluate it</li><li>✅ Wrap it in a real web app</li><li>✅ Interact with it like a product</li></ul><h3>📦 What the App Does</h3><p>The app is simple (on purpose). You enter:</p><ul><li>Number of bedrooms and bathrooms</li><li>How many guests the place accommodates</li><li>Whether it has WiFi, A/C, a kitchen, pool, or parking</li><li>And which parish it’s located in (Kingston, Negril, Montego Bay, etc.)</li></ul><p>Then it returns a predicted nightly price in USD, based on a trained ML model using a mock dataset inspired by real Airbnb pricing data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5eQPNOFF4ciU7MXKLEkBA.png" /></figure><h3>🧠 How It Works</h3><h3>📂 Dataset</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*vHGzHSQHtB-OOY25VlqYRw.png" /></figure><p>I generated a mock dataset of <strong>1,000 Jamaican Airbnb listings</strong> with features like:</p><ul><li>location</li><li>bedrooms, bathrooms, accommodates</li><li>has_wifi, has_pool, has_ac, has_kitchen, has_parking</li><li>price (target)</li></ul><p>Prices were generated using statistical trends from various Jamaican regions — Negril and Montego Bay being higher-end, Kingston skewing more affordable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*fxEMox7hoP79nG1CVlVzeg.png" /></figure><h3>🏗️ Model Pipeline</h3><ul><li>Used <strong>pandas</strong> to clean and structure the data</li><li>Encoded the location column using one-hot encoding</li><li>Trained a simple <strong>Linear Regression</strong> model from scikit-learn</li><li>Evaluated it using <strong>Mean Absolute Error (MAE)</strong> — scored around <strong>$18</strong></li><li>Saved the model using joblib</li></ul><h3>💡 Streamlit Integration</h3><p>The app itself is powered by <strong>Streamlit</strong> — one of the easiest ways to wrap a Python model into something interactive and actually usable.</p><p>The app takes user input, formats it to match the model’s expected structure, then returns a prediction.</p><h3>🗂 Project Structure</h3><pre>📁 src/         → ML training and model saving  <br>📁 app/         → Streamlit interface  <br>📁 data/        → Mock dataset (CSV)  <br>📁 notebooks/   → Jupyter notebook for exploration  <br>📄 README.md    → Project documentation</pre><h3>📈 Example Use Case</h3><p>Imagine you own a 2-bedroom villa in Negril with:</p><ul><li>WiFi ✅</li><li>A/C ✅</li><li>Pool ✅</li><li>Private parking ✅</li></ul><p>→ The app predicts your average nightly rate should be <strong>around $140 USD/night</strong>.</p><p>Simple, but useful. Especially for hosts trying to benchmark pricing.</p><h3>💭 What I Learned</h3><p>✅ Training a model is the <strong>easiest</strong> part.<br>✅ Matching production input to model input is the <strong>real challenge</strong>.<br>✅ Building a user-facing app forces you to think like a <strong>product owner</strong>, not just a data scientist.</p><p>Most importantly, I learned more from this one project than I did in two weeks of passive learning.</p><h3>🔮 What’s Next (Version 2 Ideas)</h3><p>Now that Version 1 is complete, here’s where I’m taking this next:</p><ul><li>Replace Linear Regression with <strong>Random Forest</strong> or <strong>XGBoost</strong></li><li>Use <strong>real scraped Airbnb data</strong> via API or BeautifulSoup</li><li>Add <strong>SHAP or feature importance</strong> explanations</li><li>Let users upload a <strong>CSV for batch predictions</strong></li><li>Deploy the app on <strong>Streamlit Cloud</strong> or <strong>HuggingFace Spaces</strong></li></ul><h3>🧠 Why This Project Mattered to Me</h3><p>As someone transitioning into ML/AI from real estate and fintech, I want my portfolio to reflect both:</p><ul><li>My technical growth</li><li>My connection to real-world problems I care about</li></ul><p>This project did exactly that. It’s not perfect — but it’s real, functional, and personal.</p><p>And for a Version 1, I’m proud of that.</p><h3>🙌 Want to Try It or Build Your Own?</h3><p>The full repo (with code, notebook, and Streamlit app) is open-source and beginner-friendly:</p><p>👉 <a href="https://github.com/stefenewers/jamaican-airbnb-price-estimator">github.com/stefenewers/jamaican-airbnb-price-estimator</a></p><h3>Follow the Journey</h3><p>I’m documenting my pivot into ML &amp; AI through projects like this — grounded in real estate, culture, and applied machine learning.</p><p>If you’re on a similar path or just want to connect:</p><ul><li>Follow me on <a href="https://github.com/stefenewers">GitHub</a></li><li>Let’s connect on <a href="https://www.linkedin.com/in/stefen-ewers/">LinkedIn</a></li></ul><p><strong>Thanks for reading!</strong></p><p>— Stefen</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=250bc8178011" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Week 3 of Stanford’s ML Course: From Predicting Prices to Predicting Spam]]></title>
            <link>https://stefenewers.medium.com/week-3-of-stanfords-ml-course-from-predicting-prices-to-predicting-spam-9b587979f62b?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b587979f62b</guid>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[regularization]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Wed, 28 May 2025 15:35:54 GMT</pubDate>
            <atom:updated>2025-05-28T15:35:54.914Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve officially moved from guessing numbers to making decisions. This week, it was all about <strong>classification</strong> — figuring out if something is a yes or no, 0 or 1, cat or dog, spam or legit.</p><p>And the algorithm carrying us through? <strong>Logistic Regression</strong>. Despite the name, it has nothing to do with regression. Yeah… I was confused too at first.</p><h3>🧠 Classification 101: What’s the Deal?</h3><p>In regression, we predict a value like 248.9. In classification, we ask: <em>Is it class 0 or class 1?</em></p><p>Typical examples:</p><ul><li>Is this email spam?</li><li>Is a tumor malignant?</li><li>Did they swipe right?</li></ul><p>The model gives us a <strong>probability</strong> between 0 and 1 — and we threshold that (usually at 0.5) to make a final call.</p><h3>📉 Why Linear Regression Doesn’t Work Here</h3><p>Linear regression predicts any real number. So you might end up with results like -0.6 or 1.8 — which makes zero sense for a yes/no problem.</p><p>Also, outliers can totally mess up the decision boundary.</p><h3>📈 Logistic Regression to the Rescue</h3><p>Logistic regression uses the <strong>sigmoid function</strong> to squash predictions into a [0, 1] range.</p><p><strong>Formula:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*SmS_vBrhRclPqn8AvHoQ3A.png" /></figure><p>Where z = w · x + b</p><ul><li>If f(x) &gt; 0.5 → predict 1</li><li>If f(x) &lt; 0.5 → predict 0</li></ul><p>So instead of raw predictions, we’re working with confidence scores. Cleaner and more stable.</p><h3>⚖️ The Decision Boundary</h3><p>The decision boundary is where the model is right on the fence — not sure whether to call it a 0 or a 1. This happens when:</p><pre>z = w · x + b = 0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*idlQQ1esaIFkrX9_yqTAJg.png" /></figure><p>This line (or surface) separates the two classes. With just raw features, it’s linear. Add polynomial features and it curves, circles, or bends based on the data.</p><h3>💸 The Cost of Being Wrong: Log Loss</h3><p>Squared error doesn’t work well here — it creates a non-convex cost surface and makes gradient descent unpredictable.</p><p>Instead, we use <strong>log loss</strong> (also called cross-entropy loss):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHsyurHYm6ttRexmQpmL5Q.png" /></figure><h3>🔧 Training the Model: Gradient Descent</h3><p>We still use gradient descent to update our parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkRAbyFCq7v87h05EyeP2g.png" /></figure><p>This helps the model learn step-by-step where it’s going wrong and course-correct.</p><h3>😬 Overfitting: When the Model Tries Too Hard</h3><p>Add too many features and your model might fit every training point perfectly… and fail on new data.</p><p><strong>How to fix it:</strong></p><ol><li><strong>Get more data</strong> — gives the model a better foundation</li><li><strong>Feature selection</strong> — drop the noise</li><li><strong>Regularization</strong> — keep the weights from getting out of control</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tuNtf8pGm_FgztM8xgNFAA.png" /></figure><h3>🧘 Regularization = Chill Pills for Your Weights</h3><p>We modify our cost function to penalize huge weights:</p><p><strong>For linear regression:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*bYdOaapQa3VjOyAfkeL-Xw.png" /></figure><p><strong>For logistic regression:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_m9oVM63GxNXQWFNIqygg.png" /></figure><h3>🧠 Final Thoughts</h3><p>Week 3 was a shift in perspective. We moved from predicting “how much” to predicting “what.” I learned:</p><ul><li>Logistic regression is surprisingly powerful and still easy to understand</li><li>The sigmoid keeps things grounded</li><li>The right loss function really matters</li><li>Regularization is your friend when the model starts getting cocky</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b587979f62b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Week Few in the ML/AI Matrix: Linear Regression Grows Up]]></title>
            <link>https://stefenewers.medium.com/week-few-in-the-ml-ai-matrix-linear-regression-grows-up-adc200c73aca?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/adc200c73aca</guid>
            <category><![CDATA[andrew-ng]]></category>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Wed, 21 May 2025 13:29:45 GMT</pubDate>
            <atom:updated>2025-05-21T13:33:10.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>📊 Week Few in the AI Matrix: Linear Regression Grows Up</h3><p>So I just wrapped up Week 2 of Stanford’s “Supervised Machine Learning” course by Andrew Ng and let’s just say… linear regression hit puberty.</p><p>Week 1 was cool.. we flirted with basic regression and made our little cost functions dance. But Week 2? We’re scaling up. Multiple variables, vectorization, gradients flying around like fighter jets.</p><h3>🔍 From Baby Steps to Big Leagues: Multivariable Regression</h3><p>Linear regression went from “size of house” to “size, number of bedrooms, number of floors, and how crusty the house is.” Aka: <em>multiple input variables</em>. It’s giving real-world.</p><p>Instead of our model just being:</p><pre>f(x) = w * x + b</pre><p>We’re now rocking:</p><pre>f(x) = w1 * x1 + w2 * x2 + ... + wn * xn + b</pre><p>Or for those in the vectorized life:</p><pre>f(x) = w · x + b</pre><h3>🚀 Vectorization: The Cheat Code We Didn’t Know We Needed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WS3whPxObi6wfMFjqseDzQ.png" /></figure><p>Say goodbye to basic for-loops. Python + NumPy let us go from:</p><pre>python<br>f = 0<br>for j in range(n):<br>    f += w[j] * x[j]<br>f += b</pre><p>to:</p><pre>python<br>f = np.dot(w, x) + b</pre><p>One line. Cleaner. Faster. Makes your MacBook fan stop screaming during training. Love to see it.</p><h3>📈 Gradient Descent, Now with More Firepower</h3><p>We’re no longer nudging one weight at a time. We’re updating the whole squad in one go:</p><pre>w = w - α * dw<br>b = b - α * db</pre><p>And yes, vectorized again. The CPU/GPU handles it like it’s eating cereal.</p><h3>🎯 Feature Scaling: The Hidden Sauce</h3><p>Imagine one feature is house size (300–2000 sq ft), and another is bedroom count (0–5). If you don’t scale, the model will treat size like a god and bedrooms like an afterthought.</p><p>So we scale. Min-max, mean normalization, z-score… whatever works. The goal: get everything vibing in the same range so gradient descent doesn’t zigzag like a drunk uncle.</p><h3>🧪 Feature Engineering = Street Smarts</h3><p>I loved this part.</p><p>Turns out, feeding the model smarter features is more powerful than just praying to the tuning gods. You’ve got:</p><ul><li>Raw features (width, depth)</li><li>Engineered features (width × depth = area 🔥)</li><li>Polynomial features (x², x³, √x) if you wanna flex nonlinear thinking</li></ul><p>Moral of the story? Sometimes the best model tweak is just thinking like a human with a calculator and vibes.</p><h3>🎡 Learning Rate Drama</h3><p>If your cost function graph looks like a rollercoaster at Six Flags… your learning rate’s too high my guy… or girl.. or my people… or AI.</p><p>Start small. Watch the cost function drop smooth and steady. Adjust until it’s just right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44RxmAf74mZ4YQGfmS2FoA.png" /></figure><h3>📉 Watch the Curve, Not Just the Code</h3><p>This week emphasized visual debugging. Watching your cost function flatten out across iterations? That’s your green flag. Cost going up? Hit pause, regroup, and maybe cry a little.</p><h3>TL;DR: Week 2 Gave Me These Life Gems</h3><ul><li>Vectorize everything. Save time, save code, save energy bills.</li><li>Feature scaling is underrated. Think of it as leveling the playing field.</li><li>Feature engineering isn’t just coding .. it’s storytelling.</li><li>Learning rate isn’t “set it and forget it.” It’s “test it and finesse it.”</li></ul><p>Next up is classification, which means we stop predicting “how much” and start predicting “which one.” Let’s goooo.</p><p>Follow my AI journey as I prep for Georgia Tech’s Computational Analytics Master’s and slowly transform from a proptech head into a machine learning menace.</p><p>Hit that follow if you’re riding this ML wave too. We’re all just trying to make sense of the matrix; one dot product at a time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adc200c73aca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Week 1 of Stanford’s Machine Learning  Course: My AI Journey]]></title>
            <link>https://stefenewers.medium.com/week-1-of-stanfords-machine-learning-course-my-ai-journey-d25eb188ce72?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/d25eb188ce72</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[andrew-ng]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning-course]]></category>
            <category><![CDATA[stanford]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Mon, 19 May 2025 19:34:22 GMT</pubDate>
            <atom:updated>2025-05-19T19:34:22.143Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently kicked off the Stanford Machine Learning course by Andrew Ng, one of the most widely recommended starting points in the field. As someone prepping for Georgia Tech’s Master’s in Computational Analytics program this fall, I realized something pretty quickly: passively watching videos wasn’t going to cut it.</p><p>So, here I am, blogging my way through every concept I learn — not just for others, but for myself. It’s like <em>reinforcement learning</em> for my brain… and maybe a bit of <em>deep learning</em> too (pun fully intended 😏).</p><p>Here’s a breakdown of what I learned in Week 1 — from core concepts like supervised learning to training models with gradient descent — written for both the future and anyone else trying to get a grip on this stuff.</p><h3>📚 Machine Learning, Defined</h3><p>Arthur Samuel gave us the true OG definition in 1959:</p><blockquote>“Machine learning is the field of study that gives computers the ability to learn without being explicitly programmed.”</blockquote><p>It’s basically the art of teaching machines to make decisions or predictions based on data — and the more opportunities the algorithm has to learn from examples, the better it typically performs.</p><h3>Types of Machine Learning</h3><p>The two primary flavors of ML are:</p><ul><li><strong>Supervised Learning:</strong> You give the model both the input (x) and the correct output (y), and it learns to map x → y.</li><li><strong>Unsupervised Learning:</strong> The model tries to find patterns or structure in data <em>without</em> being given the correct answers.</li></ul><blockquote><em>Bonus mention: </em><strong><em>Recommender systems</em></strong><em> (think Netflix or YouTube suggestions) are also widely used and often mix both types.</em></blockquote><h3>Supervised Learning</h3><p>This is where the model learns from labeled examples. Once it’s trained, it can take in brand-new inputs and predict outputs — even for data it’s never seen before.</p><h3>Two Key Subtypes:</h3><ul><li><strong>Regression</strong> — Predicts continuous values (e.g., house prices).</li><li><strong>Classification</strong> — Predicts discrete categories (e.g., spam vs. not spam, yes vs. no).</li></ul><blockquote><em>🔍 </em><strong><em>Note:</em></strong><em> Classification outputs a </em>finite<em> set of values (like 0 or 1), while regression can predict </em>any<em> number — even something in-between like 0.5 or 7.8.</em></blockquote><h3>Unsupervised Learning</h3><p>Here, the model explores the structure of the data without labels.</p><h3>Common Unsupervised Tasks:</h3><ul><li><strong>Clustering:</strong> Grouping similar data points together.</li><li><strong>Dimensionality Reduction:</strong> Simplifying large feature sets while retaining meaningful patterns.</li><li><strong>Anomaly Detection:</strong> Spotting data points that don’t fit the norm.</li></ul><h3>Linear Regression: Predicting with a Straight Line</h3><p>Linear regression is one of the simplest models in ML, used to predict continuous outcomes. Given some training data (house size, for example), the model learns a line that best fits the data to estimate prices.</p><p>Key notation:</p><ul><li>x: input feature</li><li>y: actual output (target)</li><li>ŷ (y-hat): predicted output</li><li>f(x): model function mapping x → ŷ</li><li>m: number of training examples</li></ul><blockquote>This part was hands-on too — I built a simple linear regression model using NumPy and Matplotlib to predict housing prices. Seeing the line adjust in real time as I tweaked the weights was 🔥</blockquote><h3>💸 The Cost Function: Measuring Mistakes</h3><p>To improve a model, you need a way to measure how wrong it is. That’s what the <strong>cost function</strong> does — it calculates the average squared error between predictions and actual values.</p><p>The formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A7GTdXTvxehs8RrxXWgPCw.png" /></figure><p>Why square the error?</p><ul><li>Ensures all errors are positive</li><li>Penalizes larger mistakes more</li><li>Keeps the math smooth and convex (important for optimization)</li></ul><h3>📉 Gradient Descent: How the Model Learns</h3><p>Gradient descent is the algorithm that helps the model learn by minimizing the cost function step by step. Here’s how it works:</p><ol><li>Start with initial guesses for parameters (w and b)</li><li>Compute predictions</li><li>Measure the cost</li><li>Calculate the gradient (slope)</li><li>Update w and b in the direction that <em>reduces</em> the cost</li><li>Repeat until convergence</li></ol><h3>Simultaneous Update = 🔑</h3><p>We update both w and b <em>at the same time</em> to ensure a smooth, stable descent toward the optimal values.</p><p>And yes, if you were wondering: batch gradient descent uses <strong>all</strong> the data to compute each step, while <strong>stochastic</strong> and <strong>mini-batch</strong> methods use smaller chunks. For this course, we’re sticking with batch.</p><h3>🤓 Blogging = Reinforcement (Learning) for Me</h3><p>Writing this blog wasn’t just a way to document my learning — it’s how I’m reinforcing what I’ve studied. Georgia Tech’s program is going to be intense, and this process is helping me internalize everything more deeply.</p><p>Just like in machine learning, feedback matters — and this blog is part of my feedback loop.</p><p>So if you’re also diving into ML or prepping for grad school, consider writing down what you learn. It’s like building your own dataset of understanding, one post at a time.</p><h3>Coming Up Next:</h3><p>In Week 2, I’ll dive into <strong>multiple input variables</strong> and implement gradient descent using <strong>vectorization</strong> — stay tuned for that update.</p><p>Until then, thanks for reading — and feel free to reach out if you’re also on this ML journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d25eb188ce72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Gearing Up for Grad School: My AI / ML & Data Science Glow-Up]]></title>
            <link>https://stefenewers.medium.com/gearing-up-for-grad-school-my-ai-ml-data-science-glow-up-944687208b97?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/944687208b97</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[georgia-tech]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Thu, 01 May 2025 13:44:36 GMT</pubDate>
            <atom:updated>2025-05-01T13:44:36.254Z</atom:updated>
            <content:encoded><![CDATA[<p>With my Master’s in Computational Analytics starting this August at Georgia Tech (yeaaaaa, we’re doing this 💪🏾), I’ve made it my mission to hit the ground running. No way I’m showing up to class like a deer in headlights. I’m walking in with reps under my belt — code written, models trained, and projects shipped.</p><p>Over the past few weeks into months, I’ve gone from Python basics to building ML projects like housing price predictors and even a little alien space shooter game 👾. But now, it’s time to take things up a notch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyei9KjfqkMnP23rVcAp4w.jpeg" /></figure><h3>🔍 What’s Next: IBM’s Data Science Professional Certificate</h3><p>I’ve enrolled in the <strong>IBM Data Science Professional Certificate</strong> — a 12-course series packed with everything from SQL to machine learning to real-world projects. Whether you’re new to the field or trying to sharpen your edge, this program <em>delivers</em>.</p><blockquote><em>✅ </em><strong><em>No prior programming needed</em></strong><em><br>🎯 </em><strong><em>12 courses</em></strong><em> → covering Python, R, SQL, machine learning, and visualization<br>🧠 </em><strong><em>Hands-on projects</em></strong><em> using real datasets, tools, and cloud labs<br>💼 </em><strong><em>Portfolio-worthy work</em></strong><em> + job access through IBM’s Talent Network</em></blockquote><h3>🛠️ Tools I’ll Be Working With</h3><p>Languages &amp; ToolsLibraries &amp; PlatformsPython, SQL, RPandas, NumPy, Matplotlib, SeabornJupyter NotebooksScikit-learn, Scipy, ipython-sqlGitHub, RStudioWatson Studio, IBM Cloud</p><h3>📚 Course Highlights</h3><p>Here’s a peek into what I’ll be building as I go through the program:</p><ul><li>📊 <strong>Graphing financial data</strong> with Pandas</li><li>🔎 <strong>Querying census + crime data</strong> using SQL</li><li>🏠 <strong>Predicting housing prices</strong> with regression models</li><li>✈️ <strong>Creating a dynamic flight dashboard</strong> with Python</li><li>💰 <strong>Training ML classifiers</strong> to predict loan outcomes</li></ul><p>Each project is designed to mimic real-world data problems — and the best part is I’ll walk away with tangible proof of my growth (and some pretty dope code on GitHub too).</p><h3>💡 Why It Matters (And Why Now)</h3><p>Let’s be real: AI and machine learning are shaping <em>everything</em> — from the content we see online to how businesses make billion-dollar decisions. I want to be at the center of that.</p><p>So while the program hasn’t started yet, my learning definitely has. Every hour I spend building, debugging, or Googling why my model accuracy is trash (lol), I’m laying the foundation to hit the ground <em>running</em> in August.</p><p>And I’m not stopping here. I’m continuing to sharpen my skills in:</p><ul><li>✅ Python</li><li>✅ SQL</li><li>✅ R</li><li>✅ Machine Learning &amp; AI concepts</li><li>✅ Data cleaning, modeling, and storytelling</li></ul><h3>📌 What’s Next?</h3><p>My goal isn’t just to be “ready” for school — it’s to thrive in it and beyond. Whether that means building smarter real estate tools, automating underwriting models, or just making dope data dashboards that increase shareholder value (iykyk) — I’m here for it.</p><p>If you’re on a similar journey or just getting started in data science, hit me up. Let’s share the wins, fails, and code snippets along the way.</p><p>Until then… back to the grind 🧠💻</p><p>—</p><p>📂 <a href="https://github.com/stefenewers">Check out my GitHub<br></a>🧠 Past Project: <a href="https://medium.com/@stefenewers/predicting-california-housing-prices-with-machine-learning-ml-in-real-estate-4f6ef563cf9b">California Housing Predictions</a><br>📺 Shoutout to <a href="https://www.youtube.com/watch?v=Wqmtf9SA_kk">NeuralNine</a> for the guidance<br>🎮 Built a cool little <a href="https://medium.com/@stefenewers/building-a-space-shooter-in-python-part-2-adding-aliens-scoreboards-and-game-logic-0eba1b991d53">alien game in Python</a> — because why not?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=944687208b97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Predicting California Housing Prices with Machine Learning: ML in Real Estate]]></title>
            <link>https://stefenewers.medium.com/predicting-california-housing-prices-with-machine-learning-ml-in-real-estate-4f6ef563cf9b?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f6ef563cf9b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[training-data]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[kaggle]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Wed, 30 Apr 2025 23:27:09 GMT</pubDate>
            <atom:updated>2025-04-30T23:27:09.317Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started diving into machine learning, it felt like stepping into a world filled with jargon — <em>regression</em>, <em>model evaluation</em>, <em>feature engineering</em>. But with some help from <a href="https://www.youtube.com/watch?v=Wqmtf9SA_kk">NeuralNine’s beginner-friendly YouTube tutorial</a>, I rolled up my sleeves and took on a new project: predicting housing prices in California using a public dataset from Kaggle.</p><p>It was hands-on, eye-opening, and most of all — fun.</p><p>👉 <a href="https://github.com/stefenewers/machine_learning_housing-_predictions">Here’s the full code on GitHub</a></p><h3>🔍 About the Dataset</h3><p>I used the <a href="https://www.kaggle.com/datasets/camnugent/california-housing-prices">California Housing Prices dataset</a> from Kaggle, which contains features like:</p><ul><li>longitude, latitude</li><li>total_rooms, total_bedrooms</li><li>population, households</li><li>median_income</li><li>ocean_proximity (categorical)</li><li>median_house_value (our prediction target)</li></ul><p>Each row represents a block group in California, giving a rich snapshot of housing conditions across the state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7OMBsBofKmt6DOiwS7X5pQ.png" /></figure><h3>🧠 Key Concepts (Explained Like You’re 5)</h3><h3>📊 1. Train-Test Split</h3><p>To test whether my model <em>really</em> understands the data, I split it into training and testing datasets.</p><blockquote><em>Think of it like teaching a student with notes (training data), and then seeing how well they do on a surprise quiz (test data).</em></blockquote><pre>python<br><br>from sklearn.model_selection import train_test_split<br><br>X = data.drop([&quot;median_house_value&quot;], axis=1)<br>y = data[&quot;median_house_value&quot;]<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)</pre><h3>🧼 2. Data Cleaning</h3><p>Some rows had missing data in the total_bedrooms column, so I dropped them to avoid issues during training.</p><pre>python<br>data.dropna(inplace=True)</pre><p>This step reminded me how important clean data is to any machine learning model.</p><h3>🧠 3. Feature Engineering</h3><p>To prepare the data:</p><ul><li>I separated features (X) from the target (y)</li><li>I used one-hot encoding to convert the text-based ocean_proximity column into numerical values</li></ul><p>Machine learning models only work with numbers, so this was crucial.</p><h3>🔥 4. Visualizing Correlations</h3><p>Using Seaborn’s heatmap, I saw which features had the most impact on house price. One stood out: <strong>median income</strong> had the highest positive correlation.</p><pre>python<br>import seaborn as sns<br>import matplotlib.pyplot as plt<br><br>sns.heatmap(data.corr(), annot=True)<br>plt.show()</pre><p>This was a game-changer for me in understanding how features relate to the target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mT_MV3N0OPOOZQNxyyuvGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtoPJmQkEovtL5J-By4ULQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFvXm_guzH9w90OlAS3mtg.png" /></figure><h3>🤖 5. Model Training with Linear Regression</h3><p>Linear Regression is the simplest ML model. It tries to draw a straight line through your data points that best fits the trend.</p><pre>python<br><br>from sklearn.linear_model import LinearRegression<br><br>model = LinearRegression()<br>model.fit(X_train, y_train)</pre><p>It’s like drawing a line of best fit in middle school math, but with Python.</p><h3>🔍 What I Found</h3><ul><li><strong>Median income</strong> was a strong predictor of house price</li><li>The model performed well on average but struggled with extreme values</li><li>Even this basic model helped me understand the machine learning pipeline end to end</li></ul><h3>📈 Results</h3><p>To evaluate the model, I used Mean Absolute Error (MAE):</p><pre>python<br>from sklearn.metrics import mean_absolute_error<br>predictions = model.predict(X_test)<br>mae = mean_absolute_error(y_test, predictions)<br>print(f&quot;MAE: {mae}&quot;)</pre><p>This metric gave me a solid baseline for accuracy and areas for improvement.</p><h3>🚀 Growth + Takeaways</h3><p>This project helped me understand:</p><ul><li>How to clean and prep data</li><li>The importance of correlation analysis</li><li>How to build and evaluate a simple ML model</li><li>That I <em>can</em> do machine learning (even without a PhD)</li></ul><p>From opening the .csv file to interpreting model results, I felt my confidence grow with every cell I ran.</p><h3>🛠️ What’s Next?</h3><ul><li>Try more advanced models like Random Forest and XGBoost</li><li>Use pipelines for smoother preprocessing</li><li>Deploy this as a simple app or API</li></ul><p>If you’re a beginner like me, I highly recommend this dataset and <a href="https://www.youtube.com/watch?v=Wqmtf9SA_kk">NeuralNine’s walkthrough</a>.</p><p>📂 <strong>Project GitHub Repo</strong>: <a href="https://github.com/stefenewers/machine_learning_housing-_predictions">https://github.com/stefenewers/machine_learning_housing-_predictions</a></p><p>Want help getting your next ML project off the ground? Shoot me a message or drop your favorite datasets below 👇🏾</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f6ef563cf9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting Olympic Medals with Python: My First Machine Learning Project ]]></title>
            <link>https://stefenewers.medium.com/predicting-olympic-medals-with-python-my-first-machine-learning-project-3c7fb29386c2?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7fb29386c2</guid>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[linear-regression]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 23:15:31 GMT</pubDate>
            <atom:updated>2025-04-30T00:32:04.583Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past few weeks, I dove into my first machine learning project — an exciting beginner-friendly journey guided by <a href="https://www.youtube.com/watch?v=Hr06nSA-qww">DataQuest on YouTube</a>. The project? Build a simple linear regression model to predict how many medals a country might win at the Olympics based on how many athletes they send.</p><p>It was both fun and humbling. As someone new to machine learning but with some Python fundamentals under my belt, I found the process incredibly rewarding. Check out the raw files on <a href="https://github.com/stefenewers/machine_learning_olympics/tree/main">my github</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ab7ju8QAjtDdjFBCTEr_2g.jpeg" /></figure><h3>🧠 The Premise</h3><p>The main idea was simple: Countries that send more athletes are likely to win more medals. So we set out to quantify that relationship using real Olympic data and a linear regression model — a classic starter project that packs a lot of important lessons.</p><p>We worked primarily with two CSV files:</p><ul><li>athlete_events.csv — historical athlete-level data</li><li>teams.csv — metadata about each Olympic team</li></ul><p>After cleaning and merging the data, we created a dataset showing how many athletes each country sent to the Olympics, and how many medals they earned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbIc-6i5ce-ht6p3ztotTQ.png" /></figure><h3>📈 Linear Regression in Action</h3><p>The heart of the project was training a <strong>simple linear regression model</strong> to predict medal counts based on athlete participation.</p><p>We used Python libraries like:</p><ul><li>pandas for data manipulation</li><li>matplotlib and seaborn for data visualization</li><li>sklearn for training the linear model</li></ul><p>One of the most satisfying parts of the process was visualizing our data. We used <strong>histograms</strong> to understand the distribution of athlete counts and medal totals, then <strong>scatter plots with regression lines</strong> to visualize the linear relationship.</p><p>It was super validating to see the trend line match our hypothesis — more athletes generally means more medals (though, of course, there are outliers — looking at you, Jamaica 🇯🇲⚡).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*C8maSWKtD_UaK3kVSybOeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*pIITvLUZYRtY8nhx2GEYBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*W1jbXMOLhrhQbJTdaVOEDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*SgZxc0xpiQiSvMqcuglNjw.png" /></figure><h3>🐍 Why Python Helped</h3><p>Having already learned Python fundamentals made this entire experience much smoother. From working with loops and conditionals, to cleaning dataframes, to creating plots — I constantly found myself thinking, <em>“Thank God I learned this stuff earlier.”</em></p><p>This project reinforced the power of Python as the go-to tool for data science and machine learning. I wasn’t stuck learning syntax — I could focus on the actual logic and model-building instead.</p><h3>🛠️ Dealing with Errors and Edge Cases</h3><p>As expected, things weren’t perfect the first time around.</p><p>Two major issues stood out:</p><ol><li><strong>Divide-by-zero errors</strong> — some countries had missing data or zero athletes recorded, which made ratios and predictions break.</li><li><strong>Zero predictions</strong> — our linear model occasionally predicted zero medals for countries that clearly won some, due to how the model generalized.</li></ol><p>We handled these by:</p><ul><li>Filtering out countries with zero athletes</li><li>Setting a minimum threshold for medal predictions (no country can win a negative medal, after all)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_EB3TJvxST9uKRp97L6Dg.png" /></figure><h3>🔍 What I Learned</h3><p>Beyond building the actual model, here are some key takeaways:</p><ul><li><strong>Data cleaning is 80% of the work</strong> — merging datasets, filtering bad rows, and dealing with NaNs takes serious time.</li><li><strong>Visualization is your best friend</strong> — histograms and scatter plots helped us explore patterns and validate model performance visually.</li><li><strong>Linear regression is powerful, but limited</strong> — it’s a great intro, but real-world relationships are rarely that simple.</li></ul><h3>💡 What’s Next?</h3><p>This project was a perfect intro to machine learning. It didn’t try to do too much — but it did just enough to show me what’s possible.</p><p>I’m excited to build on this and start tackling more advanced models and real-world problems. Maybe classification models next? Maybe something with neural networks?</p><p>For now, I’ll celebrate this milestone. One project down. Many more to go.</p><p>If you’re just getting started with ML and Python, I highly recommend giving this project a try. It’s proof that with the right guidance and a bit of patience, you can go from zero to predictive models faster than you think.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHr06nSA-qww%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHr06nSA-qww&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHr06nSA-qww%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1ca360893b01bfaf398e265a5655a06/href">https://medium.com/media/e1ca360893b01bfaf398e265a5655a06/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c7fb29386c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Building a Space Shooter in Python (Part 2) — Adding Aliens, Scoreboards, and Game Logic]]></title>
            <link>https://stefenewers.medium.com/building-a-space-shooter-in-python-part-2-adding-aliens-scoreboards-and-game-logic-0eba1b991d53?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/0eba1b991d53</guid>
            <category><![CDATA[object-oriented-program]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 01:25:35 GMT</pubDate>
            <atom:updated>2025-04-21T01:25:35.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>👾 Building a Space Shooter in Python (Part 2) — Adding Aliens, Scoreboards, and Game Logic</h3><p>Welcome back!</p><p>In <a href="https://medium.com/@stefenewers/building-a-space-shooter-in-python-part-1-moving-the-ship-firing-bullets-38ab43865292">Part 1</a> of this series, I shared the early stages of my Python space shooter game — a simple arcade-style project where you could move a spaceship and fire bullets. That was just the beginning.</p><p>Now I’m happy to say: <strong>The game is complete!</strong></p><p>✅ Aliens spawn and descend in fleets</p><p>✅ Bullets can collide with enemies</p><p>✅ A scoreboard tracks your score and high score</p><p>✅ The game resets when you run out of ships</p><p>✅ Difficulty ramps up after each level</p><p>You can check out the full code here on GitHub:<br>👉<a href="https://github.com/stefenewers/alien_invasion_game"> GitHub Repo — Alien Invasion Game</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F1077156020%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F1077156020&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F2007119348-ac132e65e4aacaf2ab4cb63b926e54c2c850b7f1627ce2b4893e6a27530a366d-d_1280&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1200" frameborder="0" scrolling="no"><a href="https://medium.com/media/87315cf97c1c5f85ec8a34a02d185323/href">https://medium.com/media/87315cf97c1c5f85ec8a34a02d185323/href</a></iframe><h3>🔍 Code Overview — What’s New in Part 2</h3><p>I built on the original files and added new modules to manage different responsibilities:</p><h3>📦 alien.py</h3><ul><li>This file defines the <strong>Alien</strong> class. Each alien moves side-to-side and down the screen.</li><li>The logic for edge detection and downward shifting is handled here, helping to simulate that “space invaders” motion.</li></ul><h3>📦 game_stats.py</h3><ul><li>Tracks game statistics like current score, high score, level, and remaining ships.</li><li>Makes it easy to reset the game when a player loses.</li></ul><h3>📦 scoreboard.py</h3><ul><li>Renders the score, high score, and level using Pygame fonts.</li><li>Positioned neatly on-screen for real-time feedback.</li></ul><h3>📦 button.py</h3><ul><li>Creates a “Play” button to start the game.</li><li>Helps handle the game’s reset state and transitions from idle to active.</li></ul><h3>🔁 alien_invasion.py</h3><ul><li>The game’s brain. It now includes logic for:</li><li>Creating and managing alien fleets</li><li>Detecting bullet-alien collisions</li><li>Leveling up and increasing difficulty</li><li>Managing game state transitions (active/inactive)</li><li>Redrawing the game screen every frame</li></ul><h3>🧠 What I Learned</h3><p>This project reinforced several key Python and game dev concepts:</p><h3>1. Modular Code is Maintainable Code</h3><p>Breaking out logic into separate classes (Ship, Alien, Bullet, Button, Scoreboard, etc.) made the game easier to build and debug. It taught me how to manage complexity using modular design.</p><h3>2. Game Loops and State Management</h3><p>Handling game state (e.g., game active vs. game over) required a solid understanding of control flow. It also made me more comfortable with while loops, flag variables, and event listeners in real-time applications.</p><h3>3. Working with Pygame Groups</h3><p>Using pygame.sprite.Group() helped me manage collections of bullets and aliens. I could update or draw all items in a single line, and it made collision detection cleaner and more efficient.</p><h3>4. Collision Detection</h3><p>Implementing collision logic with sprite.groupcollide() and sprite.spritecollideany() helped me understand how spatial logic works in games — a valuable lesson for any real-time application.</p><h3>5. Basic UI Elements</h3><p>Even adding a simple button taught me about rendering rectangles, text alignment, and click detection — skills I can now reuse in other Python GUI projects.</p><h3>🔥 Final Thoughts</h3><p>This project wasn’t just about creating a cool game (though that part was fun!). It was about <strong>learning by building</strong> — applying object-oriented programming, managing a game loop, and understanding real-time interactions.</p><blockquote><em>If you’re learning Python and looking for something practical, I can’t recommend </em>Python Crash Course<em> by Eric Matthes enough. This project comes from the book, and it’s been an incredible hands-on experience.</em></blockquote><h3>🎮 Play It or Fork It!</h3><p>Feel free to clone the project, add your own twists (sound effects? power-ups? boss fights?), or just explore the code to learn more.</p><p>🔗 <a href="https://github.com/stefenewers/alien_invasion_game">View on GitHub</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-PpCf70a1ArDw2ZNJPE-A.png" /></figure><p>Thanks for following along. If you’ve completed this project too, I’d love to hear how it went — drop a comment or share your remix of the game!</p><p>Stay curious and keep building 🛠️</p><p>— Stefen</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0eba1b991d53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Building a Space Shooter in Python (Part 1) — Moving the Ship & Firing Bullets]]></title>
            <link>https://stefenewers.medium.com/building-a-space-shooter-in-python-part-1-moving-the-ship-firing-bullets-38ab43865292?source=rss-779673638c15------2</link>
            <guid isPermaLink="false">https://medium.com/p/38ab43865292</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Stefen Ewers]]></dc:creator>
            <pubDate>Thu, 17 Apr 2025 15:23:22 GMT</pubDate>
            <atom:updated>2025-04-17T15:23:22.759Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Building a Space Shooter in Python (Part 1) — Moving the Ship &amp; Firing Bullets</h3><p>Hey everyone 👋</p><p>I’ve been diving into game development lately using Python, and I wanted to share an exciting project I’ve been working on — a retro-style space shooter game, where a spaceship glides across the screen and blasts bullets into space.</p><p>This is <strong>Part 1</strong> of the project. So far, I’ve got:</p><ul><li>A player-controlled spaceship that can move left and right</li><li>Bullet-firing mechanics using the spacebar</li><li>Clean, organized Python code using object-oriented principles</li></ul><p><strong>Part 2</strong> will include alien invaders, scoring, collisions, and more gameplay dynamics. 👾</p><blockquote><em>The entire project is guided by </em><a href="https://a.co/d/5m6Am3M">Python Crash Course<em> by Eric Matthes</em></a><em> — an amazing book for anyone learning Python. I highly recommend it!</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgCCqcTRKdI_loFiHVYr7Q.png" /></figure><h3>💡 What This Project Taught Me</h3><p>This beginner-friendly project does more than just look cool — it reinforced several key programming concepts:</p><h3>1. Object-Oriented Programming (OOP)</h3><p>Everything in the game is its own class:</p><ul><li>Ship controls the spaceship’s position and rendering</li><li>Bullet defines how bullets move and behave</li><li>Settings contains game-wide configurations (screen size, speed, colors)</li><li>AlienInvasion is the game engine that pulls it all together</li></ul><p>OOP made the project clean, modular, and easy to extend.</p><h3>2. Pygame Basics</h3><p>Pygame is a Python library for creating 2D games. I used it to:</p><ul><li>Create and update a game screen</li><li>Capture keyboard input with event loops</li><li>Animate movements and objects</li><li>Refresh game visuals using pygame.display.flip()</li></ul><p>If you’re just getting into game development, Pygame is a fantastic starting point.</p><h3>3. Keyboard Events &amp; Sprite Management</h3><p>I learned how to handle continuous movement using KEYDOWN and KEYUP events, as well as how to:</p><ul><li>Fire bullets only when the spacebar is pressed</li><li>Use pygame.sprite.Group() to manage multiple bullets</li><li>Remove bullets when they move off-screen (to avoid memory buildup)</li></ul><h3>🕹️ Current Features</h3><p>Here’s what the game can do right now:</p><p>✅ Move the spaceship left and right using the arrow keys<br>✅ Fire bullets upward using the spacebar<br>✅ Clean up off-screen bullets automatically</p><p>It’s basic — but it’s already starting to feel like a real game!</p><h3>📂 Code Structure</h3><p>The current version of the project includes the following files:</p><ul><li>alien_invasion.py – Main game loop and engine</li><li>ship.py – Ship class for movement and rendering</li><li>bullet.py – Bullet behavior and updates</li><li>settings.py – Stores configuration for game speed, size, etc.</li><li>pip install pygame.py – (just a helper file for installing Pygame)</li></ul><h3>📚 Learning Resource</h3><p>If you’re considering learning Python or just want a fun way to build something, check out <a href="https://a.co/d/5m6Am3M"><em>Python Crash Course</em> by Eric Matthes</a>. This project is based on the Space Invaders game from the book, and it’s been a game-changer (pun intended) for my learning.</p><h3>🔮 What’s Next?</h3><p>In <strong>Part 2</strong>, I’ll be adding:</p><ul><li>A fleet of alien enemies</li><li>Collision detection between bullets and aliens</li><li>A scoring system</li><li>Game-over conditions</li><li>Maybe even some sound effects and visual polish 🎯</li></ul><p>I’ll post a follow-up once it’s done with a deeper dive into the mechanics and what I learned during that phase.</p><p>Thanks for reading! If you’re working on your own Python game or have ideas for what to add next, drop a comment or connect. Always down to learn from others in the dev community.</p><p>Until next time — keep building. 🚀</p><p>— Stefen</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38ab43865292" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>