<?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 Benitha Uwituze on Medium]]></title>
        <description><![CDATA[Stories by Benitha Uwituze on Medium]]></description>
        <link>https://medium.com/@benithatuze15?source=rss-14d8559d523a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0bGxzWlTzM91zbhucPdOgw.png</url>
            <title>Stories by Benitha Uwituze on Medium</title>
            <link>https://medium.com/@benithatuze15?source=rss-14d8559d523a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:47:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@benithatuze15/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[What Do AI Data Evaluators Actually Do All Day? (Tasks, Tools, Pay)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://code.likeagirl.io/what-do-ai-data-evaluators-actually-do-all-day-tasks-tools-pay-19e895778ad9?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/630/1*sQfnCwKIHeC9SmRxhzjePw.jpeg" width="630"></a></p><p class="medium-feed-snippet">A look inside AI data evaluation work: how a typical project flows, which tools help, and how pay varies.</p><p class="medium-feed-link"><a href="https://code.likeagirl.io/what-do-ai-data-evaluators-actually-do-all-day-tasks-tools-pay-19e895778ad9?source=rss-14d8559d523a------2">Continue reading on Code Like A Girl »</a></p></div>]]></description>
            <link>https://code.likeagirl.io/what-do-ai-data-evaluators-actually-do-all-day-tasks-tools-pay-19e895778ad9?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e895778ad9</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[remote-work]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 17:45:15 GMT</pubDate>
            <atom:updated>2026-11-20T17:45:15.476Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Testing Ambient AI: How to Catch the Lights-Off Bug using a Simulated Room]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/womenintechnology/testing-ambient-ai-how-to-catch-the-lights-off-bug-using-a-simulated-room-0e6d2030fe07?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/2600/1*4b6ylx7bNlX3XJJ_QPTn5g.png" width="2760"></a></p><p class="medium-feed-snippet">How to reproduce the &#x201C;lights turned off while I was reading&#x201D; bug without sitting in a room for an hour.</p><p class="medium-feed-link"><a href="https://medium.com/womenintechnology/testing-ambient-ai-how-to-catch-the-lights-off-bug-using-a-simulated-room-0e6d2030fe07?source=rss-14d8559d523a------2">Continue reading on Women in Technology »</a></p></div>]]></description>
            <link>https://medium.com/womenintechnology/testing-ambient-ai-how-to-catch-the-lights-off-bug-using-a-simulated-room-0e6d2030fe07?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e6d2030fe07</guid>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 22:42:38 GMT</pubDate>
            <atom:updated>2026-11-10T22:42:38.319Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Learned Python to Build AI Agents. Was It Worth It? (Includes My Python Notes)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://code.likeagirl.io/i-learned-python-to-build-ai-agents-was-it-worth-it-includes-my-python-notes-4c7b0ee41ddc?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/1280/1*t-zwHNIfK_h_eZ2OBtyTkg.jpeg" width="1280"></a></p><p class="medium-feed-snippet">I wanted to build AI agents. Now they can write Python for me. Here&#x2019;s why I&#x2019;d still learn it, and what I&#x2019;d recommend to beginners.</p><p class="medium-feed-link"><a href="https://code.likeagirl.io/i-learned-python-to-build-ai-agents-was-it-worth-it-includes-my-python-notes-4c7b0ee41ddc?source=rss-14d8559d523a------2">Continue reading on Code Like A Girl »</a></p></div>]]></description>
            <link>https://code.likeagirl.io/i-learned-python-to-build-ai-agents-was-it-worth-it-includes-my-python-notes-4c7b0ee41ddc?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c7b0ee41ddc</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[future-of-work]]></category>
            <category><![CDATA[career-advice]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 02:28:34 GMT</pubDate>
            <atom:updated>2026-11-04T02:28:34.463Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How Ambient AI Works: Software That Acts Without Being Asked]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://pub.towardsai.net/how-ambient-ai-works-software-that-acts-without-being-asked-55931b2093a6?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/2400/1*OLICns6Umb-FcGQ7tiwRRQ.png" width="2400"></a></p><p class="medium-feed-snippet">From sensors and context engines to privacy and failure handling, here is what it takes to build it responsibly.</p><p class="medium-feed-link"><a href="https://pub.towardsai.net/how-ambient-ai-works-software-that-acts-without-being-asked-55931b2093a6?source=rss-14d8559d523a------2">Continue reading on Towards AI »</a></p></div>]]></description>
            <link>https://pub.towardsai.net/how-ambient-ai-works-software-that-acts-without-being-asked-55931b2093a6?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/55931b2093a6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 16:01:04 GMT</pubDate>
            <atom:updated>2026-10-24T12:38:10.479Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Two-Database Bug That’s Breaking More RAG Apps Than You’d Think]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/womenintechnology/the-two-database-bug-thats-breaking-more-rag-apps-than-you-d-think-f8be568e05cb?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/1376/1*4P8fOYrF4AQiYvq_wDfJ2Q.jpeg" width="1376"></a></p><p class="medium-feed-snippet">How to stop your vector database from falling out of sync with your DB (PostgreSQL) &#x2014; a step-by-step guide to the Transactional Outbox&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/womenintechnology/the-two-database-bug-thats-breaking-more-rag-apps-than-you-d-think-f8be568e05cb?source=rss-14d8559d523a------2">Continue reading on Women in Technology »</a></p></div>]]></description>
            <link>https://medium.com/womenintechnology/the-two-database-bug-thats-breaking-more-rag-apps-than-you-d-think-f8be568e05cb?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8be568e05cb</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Sat, 10 Oct 2026 10:16:01 GMT</pubDate>
            <atom:updated>2026-10-10T10:16:01.565Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[When PyTorch Loss Explodes to NaN: A Production Diagnostic Checklist]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://python.plainenglish.io/when-pytorch-loss-explodes-to-nan-a-production-diagnostic-checklist-1e256b0eaff2?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/1408/1*eOg3q6JRbriDTvEW5pTdDg.jpeg" width="1408"></a></p><p class="medium-feed-snippet">How to isolate and resolve numerical crashes across FP16 AMP, exploding gradients, and underflows.</p><p class="medium-feed-link"><a href="https://python.plainenglish.io/when-pytorch-loss-explodes-to-nan-a-production-diagnostic-checklist-1e256b0eaff2?source=rss-14d8559d523a------2">Continue reading on Python in Plain English »</a></p></div>]]></description>
            <link>https://python.plainenglish.io/when-pytorch-loss-explodes-to-nan-a-production-diagnostic-checklist-1e256b0eaff2?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e256b0eaff2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 17:02:12 GMT</pubDate>
            <atom:updated>2026-09-23T17:02:12.932Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why AI-Generated PyTorch Code Compiles Cleanly — and Still Fails to Train]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/womenintechnology/silent-ai-bugs-major-errors-ai-coding-assistants-leave-in-your-code-ml-data-science-edition-27c346e94572?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/2560/1*cw-DTMopzaDk76uONlJoEw.jpeg" width="2560"></a></p><p class="medium-feed-snippet">AI assistants write syntactically valid code that silently breaks autograd, stacks gradients, and wastes hours of GPU compute time.</p><p class="medium-feed-link"><a href="https://medium.com/womenintechnology/silent-ai-bugs-major-errors-ai-coding-assistants-leave-in-your-code-ml-data-science-edition-27c346e94572?source=rss-14d8559d523a------2">Continue reading on Women in Technology »</a></p></div>]]></description>
            <link>https://medium.com/womenintechnology/silent-ai-bugs-major-errors-ai-coding-assistants-leave-in-your-code-ml-data-science-edition-27c346e94572?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/27c346e94572</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 10:36:01 GMT</pubDate>
            <atom:updated>2026-09-21T21:26:43.986Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[You Graduated; No One Is Hiring. Now what?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://code.likeagirl.io/you-graduated-no-one-is-hiring-now-what-91d9cd3d3454?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/1672/1*10Zn3V7Tv-uonWvBAsRiPA.png" width="1672"></a></p><p class="medium-feed-snippet">You don&#x2019;t need an employer&#x2019;s permission to start your tech career. Here is how to earn and build proof of your skills while you apply</p><p class="medium-feed-link"><a href="https://code.likeagirl.io/you-graduated-no-one-is-hiring-now-what-91d9cd3d3454?source=rss-14d8559d523a------2">Continue reading on Code Like A Girl »</a></p></div>]]></description>
            <link>https://code.likeagirl.io/you-graduated-no-one-is-hiring-now-what-91d9cd3d3454?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/91d9cd3d3454</guid>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[freelancing]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[side-hustle]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 12:51:01 GMT</pubDate>
            <atom:updated>2026-09-21T20:53:56.530Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Stop Shipping Fragile Notebooks: How to Refactor Messy ML Code into Clean Python Packages]]></title>
            <link>https://medium.com/@benithatuze15/stop-shipping-fragile-notebooks-how-to-refactor-messy-ml-code-into-clean-python-packages-513b02d8402e?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/513b02d8402e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 11:12:12 GMT</pubDate>
            <atom:updated>2026-08-30T20:50:15.104Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jJpeAEuIDfbZnMLONGH68A.jpeg" /><figcaption>Fig. 1: Image by <a href="https://www.pexels.com/@googledeepmind/">Google DeepMind</a> on Pexel</figcaption></figure><p>You run a few cells, tweak a hyperparameter, re-run cell 12 out of order, and suddenly your accuracy jumps to 94%. But when you restart the kernel and run the notebook from top to bottom, the code crashes with a missing variable error.</p><p>Jupyter notebooks are great for fast data exploration, visual inspection, and model experimentation. But shipping raw .ipynb files into production creates hidden state, unmaintainable dependencies, and fragile pipelines.</p><p>This guide shows you how to turn a messy, stateful notebook into a clean, reproducible Python package using standard software engineering practices.</p><h4>The Target Architecture: What Your Project Should Look Like</h4><p>Before refactoring any code, set up a directory structure that separates concerns. Business logic, configurations, and entry points belong in dedicated modules.</p><p>Here is the repository layout to aim for:</p><pre>ml-project/<br>├── configs/<br>│   └── config.yaml          # Hyperparameters &amp; path management<br>├── src/<br>│   ├── __init__.py<br>│   ├── data/<br>│   │   ├── __init__.py<br>│   │   └── loader.py        # Data ingestion &amp; cleaning<br>│   └── models/<br>│       ├── __init__.py<br>│       └── trainer.py       # Model initialization &amp; training pipeline<br>├── main.py                  # Single CLI entry point<br>├── pyproject.toml           # Package metadata &amp; local dependencies<br>└── README.md</pre><p>This layout separates data logic from model code and decouples runtime settings from core business execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7n1c0nppHtgrKb51a690SA.png" /><figcaption>Fig. 2: Monolithic notebook vs. decoupled ML architecture: breaking monolithic .ipynb code into dedicated configs/, src/, and entry point modules.</figcaption></figure><h4>Step 1: Deconstruct the Notebook into Pure Functions</h4><p>In exploratory notebooks, operations live in global scope. Variables linger in memory, and functions silently depend on variables declared five cells above them.</p><p>To fix this, extract operations into pure, deterministic functions where every dependency is explicitly passed as an argument.</p><p><strong>The Before State: Chaotic Global Scope</strong></p><p>Here is a typical notebook cell where data loading, feature engineering, and model training run in global space:</p><pre># cell_14.ipynb - Unstructured execution in global scope<br>import pandas as pd<br>from sklearn.ensemble import RandomForestClassifier<br>from sklearn.model_selection import train_test_split<br><br># Global variables hardcoded inline<br>df = pd.read_csv(&quot;data/raw_data.csv&quot;)<br><br># Data manipulation relying on global state<br>df[&quot;age_imputed&quot;] = df[&quot;age&quot;].fillna(df[&quot;age&quot;].median())<br>df = pd.get_dummies(df, columns=[&quot;gender&quot;])<br><br>X = df.drop(columns=[&quot;target&quot;, &quot;id&quot;])<br>y = df[&quot;target&quot;]<br><br># Model initialized in global scope<br>X_train, X_test, y_train, y_test = train_test_split(<br>    X, y, test_size=0.2, random_state=42<br>)<br>model = RandomForestClassifier(n_estimators=100, max_depth=5, random_state=42)<br>model.fit(X_train, y_train)<br><br>print(f&quot;Train Score: {model.score(X_train, y_train)}&quot;)</pre><p><strong>The After State: Isolated Modules</strong></p><p>Move data loading and transformation logic into src/data/loader.py:</p><pre>import pandas as pd<br><br><br>def load_and_clean_data(file_path: str) -&gt; pd.DataFrame:<br>    &quot;&quot;&quot;Loads raw data and handles missing value imputation.&quot;&quot;&quot;<br>    df = pd.read_csv(file_path)<br>    df[&quot;age_imputed&quot;] = df[&quot;age&quot;].fillna(df[&quot;age&quot;].median())<br>    df = pd.get_dummies(df, columns=[&quot;gender&quot;])<br>    return df</pre><p>Next, place feature preparation and training routines into src/models/trainer.py:</p><pre>from typing import Tuple<br>import pandas as pd<br>from sklearn.ensemble import RandomForestClassifier<br><br><br>def prepare_features(<br>    df: pd.DataFrame, target_col: str, drop_cols: list<br>) -&gt; Tuple[pd.DataFrame, pd.Series]:<br>    &quot;&quot;&quot;Separates feature matrix X and target vector y.&quot;&quot;&quot;<br>    X = df.drop(columns=[target_col] + drop_cols)<br>    y = df[target_col]<br>    return X, y<br><br><br>def train_random_forest(<br>    X: pd.DataFrame, y: pd.Series, n_estimators: int, max_depth: int, seed: int<br>) -&gt; RandomForestClassifier:<br>    &quot;&quot;&quot;Initializes and fits a Random Forest classifier.&quot;&quot;&quot;<br>    model = RandomForestClassifier(<br>        n_estimators=n_estimators, max_depth=max_depth, random_state=seed<br>    )<br>    model.fit(X, y)<br>    return model<br></pre><p>By isolating these operations into pure functions, you eliminate reliance on global state and make every component unit-testable.</p><h4>Step 2: Decouple Logic from Configuration</h4><p>Hardcoding hyperparameter values, dataset file paths, and random seeds directly inside source code forces you to modify core logic every time you run an experiment.</p><p>Extract these values into a dedicated YAML configuration file.</p><p><strong>Create </strong><strong>configs/config.yaml</strong></p><pre>data:<br>  file_path: &quot;data/raw_data.csv&quot;<br>  target_col: &quot;target&quot;<br>  drop_cols: [&quot;id&quot;]<br><br>model:<br>  n_estimators: 100<br>  max_depth: 5<br>  random_state: 42</pre><p><strong>Build a Lightweight Config Parser</strong></p><p>In src/utils/config.py, write a simple parser using Python&#39;s native dataclasses to convert configuration dictionaries into typed objects:</p><pre>from dataclasses import dataclass<br>import yaml<br><br><br>@dataclass<br>class Config:<br>    data: dict<br>    model: dict<br><br>    @classmethod<br>    from_yaml(cls, path: str) -&gt; &quot;Config&quot;:<br>        &quot;&quot;&quot;Parses a YAML file into a structured configuration object.&quot;&quot;&quot;<br>        with open(path, &quot;r&quot;) as f:<br>            content = yaml.safe_load(f)<br>        return cls(data=content[&quot;data&quot;], model=content[&quot;model&quot;])<br></pre><p>Now, changing a model parameter like n_estimators or updating a data path only requires editing config.yaml.</p><h4>Step 3: Turn Your Directory into an Installable Package</h4><p>Inserting sys.path.append(&quot;../&quot;) at the top of Python scripts breaks easily and clutters imports. The modern solution is to define package metadata using pyproject.toml so Python treats your src/ directory as a first-class module.</p><p><strong>Create </strong><strong>pyproject.toml</strong></p><pre>[build-system]<br>requires = [&quot;setuptools&gt;=61.0&quot;]<br>build-backend = &quot;setuptools.build_meta&quot;<br><br>[project]<br>name = &quot;ml_project&quot;<br>version = &quot;0.1.0&quot;<br>description = &quot;Refactored production-ready machine learning pipeline&quot;<br>readme = &quot;README.md&quot;<br>requires-python = &quot;&gt;=3.9&quot;<br>dependencies = [<br>    &quot;pandas&gt;=2.0.0&quot;,<br>    &quot;scikit-learn&gt;=1.2.0&quot;,<br>    &quot;pyyaml&gt;=6.0&quot;,<br>]<br><br>[tool.setuptools.packages.find]<br>where = [&quot;.&quot;]<br>include = [&quot;src*&quot;]</pre><p><strong>Install in Editable Mode</strong></p><p>Run the following command in your terminal at the project root:</p><pre>pip install -e .</pre><p>The -e flag installs the repository in editable mode. Any edits you make to files inside src/ instantly reflect across your environment without requiring a re-install. You can now use clean absolute imports anywhere in the codebase:</p><pre>from src.data.loader import load_and_clean_data</pre><h4>Step 3.5: Enforce Automatic Code Quality</h4><p>In notebooks, unused imports and inconsistent formatting accumulate unnoticed. Once modularized into .py files, enforce clean code standards automatically using <a href="https://pydevtools.com/handbook/explanation/ruff-complete-guide/"><strong>Ruff</strong></a>—an extremely fast Python linter and formatter.</p><p>Add a simple configuration section to your pyproject.toml:</p><pre>[tool.ruff]<br>line-length = 88<br>select = [&quot;E&quot;, &quot;F&quot;, &quot;I&quot;] # Enforce style, pyflakes, and auto-sorting imports</pre><p>Now, running a single command cleans and formats your entire repository before you commit code:</p><pre>ruff check --fix .</pre><h4>Step 4: Expose a Single Entry Point with main.py</h4><p>With your logic modularized, configurations externalized, and package installed, create a single command-line interface (CLI) entry point in main.py.</p><pre>import argparse<br>from src.data.loader import load_and_clean_data<br>from src.models.trainer import prepare_features, train_random_forest<br>from src.utils.config import Config<br><br><br>def run_pipeline(config_path: str) -&gt; None:<br>    &quot;&quot;&quot;Orchestrates data loading, feature preparation, and model training.&quot;&quot;&quot;<br>    print(f&quot;[+] Loading configuration from: {config_path}&quot;)<br>    config = Config.from_yaml(config_path)<br><br>    print(f&quot;[+] Processing dataset from: {config.data[&#39;file_path&#39;]}&quot;)<br>    df = load_and_clean_data(config.data[&quot;file_path&quot;])<br>    X, y = prepare_features(<br>        df,<br>        target_col=config.data[&quot;target_col&quot;],<br>        drop_cols=config.data[&quot;drop_cols&quot;],<br>    )<br><br>    print(&quot;[+] Training Random Forest Classifier...&quot;)<br>    model = train_random_forest(<br>        X,<br>        y,<br>        n_estimators=config.model[&quot;n_estimators&quot;],<br>        max_depth=config.model[&quot;max_depth&quot;],<br>        seed=config.model[&quot;random_state&quot;],<br>    )<br><br>    score = model.score(X, y)<br>    print(f&quot;[✔] Pipeline completed successfully. Training Accuracy: {score:.4f}&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    parser = argparse.ArgumentParser(<br>        description=&quot;Run the end-to-end ML training pipeline.&quot;<br>    )<br>    parser.add_argument(<br>        &quot;--config&quot;,<br>        type=str,<br>        default=&quot;configs/config.yaml&quot;,<br>        help=&quot;Path to the YAML configuration file.&quot;,<br>    )<br><br>    args = parser.parse_args()<br>    run_pipeline(config_path=args.config)</pre><p>To run your entire pipeline, execute one terminal command:</p><pre>python main.py --config configs/config.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*lvTeNLPAQVhR_OmcOhUQGQ.png" /><figcaption>Fig. 3: Verifying package installation and watching the end-to-end execution logs run smoothly from start to finish.</figcaption></figure><p>Refactoring notebooks into structured Python packages bridges the gap between experimentation and production. By extracting pure functions, externalizing configuration, and managing dependencies through pyproject.toml, you create codebases that are testable, version-controlled, and ready for deployment automation.</p><p>If you found this guide helpful, leave a few claps or share your thoughts in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=513b02d8402e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Single Preprocessing Line Caused 99% Fake Model Accuracy]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@benithatuze15/how-a-single-preprocessing-line-caused-99-fake-model-accuracy-ce9fc6940b0d?source=rss-14d8559d523a------2"><img src="https://cdn-images-1.medium.com/max/1408/1*ElG9WoFQfUHGweF9MyODww.jpeg" width="1408"></a></p><p class="medium-feed-snippet">Isolating train and test state in Scikit-Learn using Pipelines and ColumnTransformers.</p><p class="medium-feed-link"><a href="https://medium.com/@benithatuze15/how-a-single-preprocessing-line-caused-99-fake-model-accuracy-ce9fc6940b0d?source=rss-14d8559d523a------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@benithatuze15/how-a-single-preprocessing-line-caused-99-fake-model-accuracy-ce9fc6940b0d?source=rss-14d8559d523a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce9fc6940b0d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Benitha Uwituze]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 18:54:06 GMT</pubDate>
            <atom:updated>2026-08-19T19:37:01.925Z</atom:updated>
        </item>
    </channel>
</rss>