<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: OLUWAYEMI FISAYO NATHANIEL</title>
    <description>The latest articles on DEV Community by OLUWAYEMI FISAYO NATHANIEL (@fishi).</description>
    <link>https://dev.to/fishi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F811920%2Fec0f6cd9-2765-4c63-9dad-debf4cce88e4.png</url>
      <title>DEV Community: OLUWAYEMI FISAYO NATHANIEL</title>
      <link>https://dev.to/fishi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fishi"/>
    <language>en</language>
    <item>
      <title>I Built a Weather-Aware Truck Router with React and Django (and Why the Fastest Route Isn't Always the Right One)</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Sat, 07 Nov 2026 22:13:18 +0000</pubDate>
      <link>https://dev.to/fishi/i-built-a-weather-aware-truck-router-with-react-and-django-and-why-the-fastest-route-isnt-always-2lhm</link>
      <guid>https://dev.to/fishi/i-built-a-weather-aware-truck-router-with-react-and-django-and-why-the-fastest-route-isnt-always-2lhm</guid>
      <description>&lt;p&gt;If you're driving a car, the fastest route is usually the best route. If you're driving a fully loaded 18-wheeler, 45 mph crosswinds or a band of heavy snow somewhere along the way can turn "fastest" into "dangerous" fast.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Weather-Aware Truck Routing&lt;/strong&gt;: a web app that takes a trip, gets three truck routes, checks the weather at every checkpoint &lt;strong&gt;for the hour the truck will actually be there&lt;/strong&gt;, scores the risk, and recommends the safest route. Drive time is only used as the final tie-breaker.&lt;/p&gt;

&lt;p&gt;It started as a time-boxed full-stack engineering challenge, and I ended up enjoying it way more than I expected.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚚 &lt;strong&gt;Live app:&lt;/strong&gt; &lt;a href="https://weather-aware-truck-routing-5h7c.onrender.com/" rel="noopener noreferrer"&gt;https://weather-aware-truck-routing-5h7c.onrender.com/&lt;/a&gt; (free hosting, so the first load can take about a minute to wake up)&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;Source code:&lt;/strong&gt; &lt;a href="https://github.com/famousfishi/weather-aware-truck-routing" rel="noopener noreferrer"&gt;https://github.com/famousfishi/weather-aware-truck-routing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F33zn0hakj4quvpcd48te.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F33zn0hakj4quvpcd48te.png" alt="Weather-Aware Truck Routing planning a trip from Denver to Chicago" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What the app does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plan a trip:&lt;/strong&gt; enter an origin and destination (with search-as-you-type), a departure time, the load weight, and how often you want weather checkpoints: every &lt;strong&gt;10, 25 or 50 miles&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;See 3 routes on a map:&lt;/strong&gt; the selected route is colored by risk along its whole length. Each checkpoint shows its arrival time, wind, rain, snow, risk level and the &lt;em&gt;reason&lt;/em&gt; for that level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get a recommendation that explains itself:&lt;/strong&gt; not just "take Route B", but &lt;em&gt;why&lt;/em&gt;, e.g. &lt;em&gt;"Fewer Severe miles than Route A: 0 vs 42 mi"&lt;/em&gt;, plus how much extra time it costs compared to the fastest route.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scrub through the next 48 hours:&lt;/strong&gt; a forecast slider (with a play button) animates a weather heatmap over the trip corridor, and a truck icon shows where you'd be at that hour.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare routes side by side:&lt;/strong&gt; distance, drive time, arrival time, miles at each risk level and average risk.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Frontend
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tech&lt;/th&gt;
&lt;th&gt;What I used it for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;React 19&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TypeScript&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Typed API client, typed responses, fewer surprises&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Material UI (MUI 6)&lt;/strong&gt; + Emotion&lt;/td&gt;
&lt;td&gt;Components, theming, layout&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Leaflet&lt;/strong&gt; + &lt;strong&gt;React-Leaflet 5&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Interactive map, route lines, checkpoints, heatmap layer, truck marker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Vite&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dev server and build (proxies &lt;code&gt;/api&lt;/code&gt; to Django locally)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ESLint&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linting&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Backend
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tech&lt;/th&gt;
&lt;th&gt;What I used it for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Python 3.12&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Django 5.2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Web framework, settings, caching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Django REST Framework&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;API views, request validation (serializers), consistent error handling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;requests&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Calling TomTom and Open-Meteo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;python-dotenv&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Loading config from &lt;code&gt;.env&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Redis&lt;/strong&gt; (optional)&lt;/td&gt;
&lt;td&gt;Shared cache; falls back to in-memory caching if not set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gunicorn&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Production WSGI server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WhiteNoise&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Serving the built React app straight from Django&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  External APIs and services
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TomTom&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Truck routing (with vehicle weight), route alternatives, geocoding and place suggestions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Open-Meteo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Hourly forecasts: wind, rain, showers, snowfall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenStreetMap&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Map tiles&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  DevOps
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tech&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Docker&lt;/strong&gt; (multi-stage build)&lt;/td&gt;
&lt;td&gt;Builds the React app, then packages it with the Django API into one image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Render&lt;/strong&gt; (Blueprint via &lt;code&gt;render.yaml&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Hosting on the free plan, one service, one URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitHub Actions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Runs the backend tests and the frontend build on every push and PR&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Fun fact: none of the services needs a payment card.&lt;/p&gt;




&lt;h2&gt;
  
  
  How a trip gets planned
&lt;/h2&gt;

&lt;p&gt;When you hit "Plan trip", the backend runs this pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Places&lt;/strong&gt; – the typed text is geocoded with TomTom (skipped if you picked a suggestion that already has coordinates).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Routes&lt;/strong&gt; – TomTom's &lt;em&gt;truck&lt;/em&gt; routing returns the best route plus up to 2 alternatives. I pass the &lt;strong&gt;gross vehicle weight&lt;/strong&gt; (load + a 35,000 lb tractor-trailer, capped at 80,000 lb) so weight-restricted roads are avoided. If fewer than 3 distinct routes come back, the service asks for routes through points on either side of the trip's midpoint to force some variety.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checkpoints&lt;/strong&gt; – placed at mile 0, every N miles, and at the destination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weather&lt;/strong&gt; – one batched Open-Meteo request fetches hourly wind, rain and snow for every checkpoint and every heatmap cell.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Risk&lt;/strong&gt; – each checkpoint uses the forecast hour closest to its arrival time and gets classified by the rules below.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ranking&lt;/strong&gt; – routes are sorted and the deciding rule is explained in plain English.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heatmap&lt;/strong&gt; – a grid of cells within about 30 miles of every route, with risk precomputed for all 49 hours (0–48).&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The risk rules
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Low&lt;/th&gt;
&lt;th&gt;Moderate&lt;/th&gt;
&lt;th&gt;High&lt;/th&gt;
&lt;th&gt;Severe&lt;/th&gt;
&lt;th&gt;No Travel&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Wind&lt;/td&gt;
&lt;td&gt;&amp;lt; 25 mph&lt;/td&gt;
&lt;td&gt;25–34&lt;/td&gt;
&lt;td&gt;35–44&lt;/td&gt;
&lt;td&gt;45–54&lt;/td&gt;
&lt;td&gt;≥ 55 mph&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rain&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.10 in/hr&lt;/td&gt;
&lt;td&gt;0.10–0.25&lt;/td&gt;
&lt;td&gt;0.25–0.50&lt;/td&gt;
&lt;td&gt;0.50–1.00&lt;/td&gt;
&lt;td&gt;&amp;gt; 1.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snow&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.5 in/hr&lt;/td&gt;
&lt;td&gt;0.5–1.0&lt;/td&gt;
&lt;td&gt;1.0–2.0&lt;/td&gt;
&lt;td&gt;2.0–3.0&lt;/td&gt;
&lt;td&gt;&amp;gt; 3.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Then there are &lt;strong&gt;load rules&lt;/strong&gt;, because a heavy truck in strong wind is a different story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;≥ 55 mph wind → &lt;strong&gt;No Travel&lt;/strong&gt; for any load&lt;/li&gt;
&lt;li&gt;45–54 mph with more than 30,000 lb → &lt;strong&gt;No Travel&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;35–44 mph with more than 40,000 lb → &lt;strong&gt;Severe&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A checkpoint's final level is the &lt;strong&gt;worst&lt;/strong&gt; of wind (after load rules), rain and snow. All of this lives in one small file, written to read exactly like the table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;apply_load_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wind_level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;load_weight_lb&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Heavy loads are riskier in strong wind (the wind level already covers the ≥55 mph rule).&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;wind_level&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SEVERE&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;load_weight_lb&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;NO_TRAVEL_IN_SEVERE_WIND_ABOVE_LB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NO_TRAVEL&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;wind_level&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HIGH&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;load_weight_lb&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;SEVERE_IN_HIGH_WIND_ABOVE_LB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SEVERE&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;wind_level&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;assess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weather&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;WeatherReading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;load_weight_lb&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;RiskAssessment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;wind_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;classify_wind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wind_mph&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;loaded_wind_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;apply_load_rules&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wind_level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;load_weight_lb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;rain_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;classify_rain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rain_in_hr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;snow_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;classify_snow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;snow_in_hr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# ...build human-readable reasons...
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;RiskAssessment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loaded_wind_level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rain_level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;snow_level&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;reasons&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;reasons&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every checkpoint also carries a list of reasons like &lt;em&gt;"Wind 47 mph → Severe"&lt;/em&gt; and &lt;em&gt;"42,000 lb load in that wind → No Travel"&lt;/em&gt;, so the driver never has to guess why something is red.&lt;/p&gt;




&lt;h2&gt;
  
  
  Picking the winner
&lt;/h2&gt;

&lt;p&gt;Routes are ranked by, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fewest &lt;strong&gt;No-Travel&lt;/strong&gt; miles (I added this one so a route you shouldn't drive can never win on other numbers)&lt;/li&gt;
&lt;li&gt;Fewest &lt;strong&gt;Severe&lt;/strong&gt; miles&lt;/li&gt;
&lt;li&gt;Fewest &lt;strong&gt;High&lt;/strong&gt; miles&lt;/li&gt;
&lt;li&gt;Lowest &lt;strong&gt;average risk&lt;/strong&gt; (weighted by miles, 0 = Low to 4 = No Travel)&lt;/li&gt;
&lt;li&gt;Shortest &lt;strong&gt;travel time&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In Python this turned out to be a one-liner, because tuples compare element by element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rank_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RouteDto&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;no_travel_miles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;severe_miles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;high_miles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;average_risk&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;duration_seconds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;ranked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;rank_key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To explain the result, the service walks the same criteria in order and finds the &lt;strong&gt;first&lt;/strong&gt; one where the winner beats the runner-up. That becomes the headline reason shown in the UI.&lt;/p&gt;




&lt;h2&gt;
  
  
  The parts I found most interesting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Weather is checked for &lt;em&gt;when&lt;/em&gt; you'll be there, not &lt;em&gt;now&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A storm that's over Nebraska right now might be gone by the time you get there, or one might roll in. So every checkpoint gets an estimated arrival time, and the risk uses the forecast for that hour.&lt;/p&gt;

&lt;p&gt;I don't just divide distance by average speed either. TomTom returns a distance/time profile along the route, and I interpolate on that, so slow city stretches and fast interstates are timed correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;estimate_arrival&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fraction_of_route&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;departure_time&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Uses the provider&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s (distance, time) profile, so slow city stretches and fast highways are respected.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;meters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fraction_of_route&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;distance_meters&lt;/span&gt;
    &lt;span class="n"&gt;distances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time_profile&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;seconds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time_profile&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;departure_time&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;interpolate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;meters&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;distances&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Checkpoints that "cover" road, so the miles always add up
&lt;/h3&gt;

&lt;p&gt;To say "Route A has 42 Severe miles", each checkpoint needs to stand for a stretch of road. Each one covers the road &lt;strong&gt;halfway back to the previous checkpoint and halfway forward to the next&lt;/strong&gt;. That way the miles per risk level always add up to the full route length, whether you chose 10, 25 or 50 mile spacing.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Fewer weather calls with grid snapping + caching
&lt;/h3&gt;

&lt;p&gt;Three routes between the same cities overlap a lot. So before fetching weather, every point is snapped to a &lt;strong&gt;0.1° grid&lt;/strong&gt; (roughly 7 miles). Points in the same cell share one forecast, all missing cells go out in &lt;strong&gt;one batched request&lt;/strong&gt;, and results are cached for 30 minutes (in memory, or Redis if &lt;code&gt;REDIS_URL&lt;/code&gt; is set).&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Getting around shared-IP rate limits on free hosting
&lt;/h3&gt;

&lt;p&gt;This one surprised me. Open-Meteo's free tier is limited &lt;strong&gt;per IP address&lt;/strong&gt;, and on free hosting, lots of apps share the same outbound IP. So the server could hit the limit without me doing anything wrong.&lt;/p&gt;

&lt;p&gt;The fix: on the live site, the &lt;strong&gt;visitor's browser downloads the forecasts&lt;/strong&gt;, while the server still does all the risk work.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The browser asks the server to plan a trip.&lt;/li&gt;
&lt;li&gt;The server works out exactly which forecasts it needs and responds with the exact Open-Meteo request URLs.&lt;/li&gt;
&lt;li&gt;The browser fetches them (Open-Meteo allows calls from any website) and sends the raw responses back.&lt;/li&gt;
&lt;li&gt;The server parses them and finishes the plan.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each visitor uses their own free allowance, and browser-supplied data is only used for that one request, never cached for other visitors. It's controlled by one flag, &lt;code&gt;WEATHER_FROM_BROWSER&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. A slider that needs zero network calls
&lt;/h3&gt;

&lt;p&gt;The 0–48 hour heatmap is computed up front for all 49 hours in the same response. So scrubbing or hitting play on the slider is instant: React just swaps which hour it's drawing.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Demo mode without touching service code
&lt;/h3&gt;

&lt;p&gt;A tiny &lt;code&gt;container.py&lt;/code&gt; builds each service once and wires its dependencies. Flip &lt;code&gt;USE_FAKE_PROVIDERS=true&lt;/code&gt; and it swaps the real TomTom and Open-Meteo clients for fake ones with built-in data. No API key, no internet, and the same fakes power the tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@lru_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;maxsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tomtom_client&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;USE_FAKE_PROVIDERS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;FakeTomTomClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;TomTomClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TOMTOM_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GEOCODE_COUNTRY_SET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. Thin views, logic in services
&lt;/h3&gt;

&lt;p&gt;The DRF views do three things: validate, call one service, return. All the actual logic lives in small services (places, routes, checkpoints, weather, risk, assessment, recommendation, heatmap, and a planner that ties them together). Errors always come back in one shape, &lt;code&gt;{ "detail": "..." }&lt;/code&gt;: 400 for bad input, 422 when a place or route can't be found, 502 when an upstream API fails.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TripPlanView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;APIView&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;trip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TripPlanRequestSerializer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;trip&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_valid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raise_exception&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;to_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;container&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trip_planner&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;plan_trip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trip&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_trip_request&lt;/span&gt;&lt;span class="p"&gt;())))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Testing and CI
&lt;/h2&gt;

&lt;p&gt;There are &lt;strong&gt;44 backend tests&lt;/strong&gt; covering the risk rules (including the tricky boundaries like exactly 0.25 in/hr), ranking, arrival times, the heatmap, the API client parsers, the API endpoints and the browser-weather flow.&lt;/p&gt;

&lt;p&gt;GitHub Actions runs two jobs on every push and pull request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;backend:&lt;/strong&gt; install requirements, run &lt;code&gt;python manage.py test&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;frontend:&lt;/strong&gt; &lt;code&gt;npm ci&lt;/code&gt; and &lt;code&gt;npm run build&lt;/code&gt; (which also type-checks with &lt;code&gt;tsc&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;I wanted one service and one URL, so the &lt;strong&gt;Dockerfile&lt;/strong&gt; is a two-stage build:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A Node 22 image builds the React app into static files.&lt;/li&gt;
&lt;li&gt;A Python 3.12 image installs the Django API and copies the built frontend in. &lt;strong&gt;WhiteNoise&lt;/strong&gt; serves it at &lt;code&gt;/&lt;/code&gt;, and &lt;strong&gt;Gunicorn&lt;/strong&gt; runs the app.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On &lt;strong&gt;Render&lt;/strong&gt; it's a Blueprint: point it at the repo, it reads &lt;code&gt;render.yaml&lt;/code&gt;, generates the Django secret key, and you only add your TomTom API key. There's a health check at &lt;code&gt;/api/health&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  API at a glance
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;POST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/trips/plan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Plan a trip (routes, checkpoints, risk, recommendation, heatmap)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/places/suggest?q=denv&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Place suggestions for the search box&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/health&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Health check (also reports demo mode)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  What I'd add next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hours-of-Service rest breaks.&lt;/strong&gt; Right now arrival times assume continuous driving. Real drivers have legally required breaks, and those shift &lt;em&gt;when&lt;/em&gt; they hit each stretch of weather.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Suggesting a better departure time&lt;/strong&gt; when every route has No-Travel conditions, instead of just warning about it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Run it yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Backend (Python 3.12)&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;backend
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate        &lt;span class="c"&gt;# Windows: .venv\Scripts\activate&lt;/span&gt;
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env             &lt;span class="c"&gt;# add TOMTOM_API_KEY, or set USE_FAKE_PROVIDERS=true&lt;/span&gt;
python manage.py runserver

&lt;span class="c"&gt;# Frontend (Node 22)&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;frontend
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm run dev                      &lt;span class="c"&gt;# http://localhost:5173&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No TomTom key yet? Set &lt;code&gt;USE_FAKE_PROVIDERS=true&lt;/code&gt; and try Denver to Chicago on the demo data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;The biggest lesson for me: the hard part wasn't calling the APIs, it was making the answer &lt;strong&gt;trustworthy&lt;/strong&gt;. Timing weather to the actual arrival hour, making sure the miles add up, and explaining every decision in plain words is what turns "a map with some colors" into something a driver could actually rely on.&lt;/p&gt;

&lt;p&gt;If you've built anything with routing or weather data, or you have ideas for what a driver would want next, I'd love to hear about it in the comments. And if you check out the repo, a ⭐ is always appreciated.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live app:&lt;/strong&gt; &lt;a href="https://weather-aware-truck-routing-5h7c.onrender.com/" rel="noopener noreferrer"&gt;https://weather-aware-truck-routing-5h7c.onrender.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/famousfishi/weather-aware-truck-routing" rel="noopener noreferrer"&gt;https://github.com/famousfishi/weather-aware-truck-routing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Routing and geocoding by TomTom. Weather by Open-Meteo. Map tiles © OpenStreetMap contributors.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building a Healthcare AI Assistant with RAG, .NET, PostgreSQL, and pgvector</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Tue, 26 May 2026 22:43:33 +0000</pubDate>
      <link>https://dev.to/fishi/building-a-healthcare-ai-assistant-with-rag-net-postgresql-and-pgvector-4aip</link>
      <guid>https://dev.to/fishi/building-a-healthcare-ai-assistant-with-rag-net-postgresql-and-pgvector-4aip</guid>
      <description>&lt;p&gt;Recently, I worked on a project where I used AI and RAG to improve how clinical guideline information can be retrieved and used in a healthcare workflow.&lt;/p&gt;

&lt;p&gt;The main idea was simple:&lt;/p&gt;

&lt;p&gt;Instead of allowing the AI to answer based only on general model knowledge, I wanted the system to first search through trusted clinical guideline content and use that retrieved context to support the response.&lt;/p&gt;

&lt;p&gt;This is where RAG comes in.&lt;/p&gt;

&lt;p&gt;RAG means Retrieval-Augmented Generation. In simple terms, it allows an AI system to retrieve relevant information from a knowledge base before generating an answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;In healthcare, AI responses need to be more than just fluent.&lt;/p&gt;

&lt;p&gt;They need to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relevant&lt;/li&gt;
&lt;li&gt;Grounded&lt;/li&gt;
&lt;li&gt;Structured&lt;/li&gt;
&lt;li&gt;Safe&lt;/li&gt;
&lt;li&gt;Based on trusted information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A doctor may ask about symptoms, possible diagnosis, investigations, treatment options, or drug recommendations. The system should not just generate a generic answer. It should first look through available clinical guideline data and return context that can support a better response.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I worked on a RAG pipeline that does the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads clinical guideline data&lt;/li&gt;
&lt;li&gt;Breaks the content into useful chunks&lt;/li&gt;
&lt;li&gt;Generates embeddings for each chunk&lt;/li&gt;
&lt;li&gt;Stores the embeddings in PostgreSQL using pgvector&lt;/li&gt;
&lt;li&gt;Accepts a doctor’s prompt&lt;/li&gt;
&lt;li&gt;Generates an embedding for the prompt&lt;/li&gt;
&lt;li&gt;Searches for the most relevant guideline chunks&lt;/li&gt;
&lt;li&gt;Retrieves related treatment sections&lt;/li&gt;
&lt;li&gt;Sends the retrieved context to the AI model for a better response&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The backend was built with .NET, PostgreSQL, and pgvector.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why pgvector?
&lt;/h2&gt;

&lt;p&gt;I used pgvector because it allows PostgreSQL to store and search vector embeddings.&lt;/p&gt;

&lt;p&gt;This means I can keep the data in a familiar SQL database while still supporting semantic search.&lt;/p&gt;

&lt;p&gt;Instead of searching only by exact keywords, the system can search by meaning.&lt;/p&gt;

&lt;p&gt;For example, if a doctor describes a condition or symptom, the system can retrieve guideline content that is semantically related to the prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  One important improvement
&lt;/h2&gt;

&lt;p&gt;One thing I worked on was making sure the system did not only return the closest vector matches.&lt;/p&gt;

&lt;p&gt;I also added logic to retrieve treatment-related sections for the top matching condition.&lt;/p&gt;

&lt;p&gt;This helps the AI response include useful information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Treatment goals&lt;/li&gt;
&lt;li&gt;Non-drug treatment&lt;/li&gt;
&lt;li&gt;Drug treatment&lt;/li&gt;
&lt;li&gt;Cautions&lt;/li&gt;
&lt;li&gt;Supportive measures&lt;/li&gt;
&lt;li&gt;Definitive treatment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That part was important because healthcare responses should not stop at possible diagnosis. Doctors also need practical next steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;One major lesson from this project is that RAG is not just about adding AI to an application.&lt;/p&gt;

&lt;p&gt;The quality of the response depends heavily on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How the data is structured&lt;/li&gt;
&lt;li&gt;How the data is chunked&lt;/li&gt;
&lt;li&gt;How retrieval is designed&lt;/li&gt;
&lt;li&gt;How relevant context is selected&lt;/li&gt;
&lt;li&gt;How the prompt guides the final answer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good RAG is not magic. It is engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;AI becomes more useful when it is connected to the right data.&lt;/p&gt;

&lt;p&gt;For healthcare, this can help support doctors with faster access to guideline-based information, while still keeping the human expert in control.&lt;/p&gt;

&lt;p&gt;This project gave me a deeper appreciation for how AI can be used in real products, not just demos.&lt;/p&gt;

&lt;p&gt;I am still improving the retrieval flow, query performance, and response structure, but this was a strong step forward in building practical AI systems with .NET.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;.NET&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;pgvector&lt;/li&gt;
&lt;li&gt;OpenAI embeddings&lt;/li&gt;
&lt;li&gt;Vector search&lt;/li&gt;
&lt;li&gt;RAG&lt;/li&gt;
&lt;li&gt;Clinical guideline retrieval&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still learning. Still building.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rag</category>
      <category>postgres</category>
      <category>vectordatabase</category>
    </item>
    <item>
      <title>How We Predicted Drug Quantities in Healthcare Using Machine Learning — And Why It Matters</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Wed, 18 Jun 2025 21:05:58 +0000</pubDate>
      <link>https://dev.to/fishi/how-we-predicted-drug-quantities-in-healthcare-using-machine-learning-and-why-it-matters-3dbi</link>
      <guid>https://dev.to/fishi/how-we-predicted-drug-quantities-in-healthcare-using-machine-learning-and-why-it-matters-3dbi</guid>
      <description>&lt;p&gt;In healthcare systems, small inefficiencies lead to big problems. One such inefficiency we faced recently involved how drug quantities were being requested, approved, and dispensed across pharmacies and Health Maintenance Organizations (HMOs).&lt;/p&gt;

&lt;p&gt;Sometimes patients received too much medication. Other times, too little. This inconsistency created financial waste, delayed treatments, and friction between stakeholders. So, we asked a simple question:&lt;/p&gt;

&lt;p&gt;Can we predict how much of a drug should be dispensed — before anyone manually reviews the request?&lt;/p&gt;

&lt;p&gt;With the power of ML.NET and historical fulfillment data, we built a predictive engine that made this possible. Here’s how we did it — and why it’s transforming our operations.&lt;/p&gt;

&lt;p&gt;🚑 The Business Problem&lt;br&gt;
In many healthtech environments, prescription fulfillment goes something like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A patient is prescribed medication.&lt;/li&gt;
&lt;li&gt;The health care organization/company submits the request to a partner pharmacy.&lt;/li&gt;
&lt;li&gt;The pharmacy dispenses based on the prescription — often guessing or relying on past habits.&lt;/li&gt;
&lt;li&gt;health care organization/company manually review some cases, often overriding the quantity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process introduces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delays in care due to manual reviews&lt;/li&gt;
&lt;li&gt;Over-dispensation, which increases operational costs&lt;/li&gt;
&lt;li&gt;Under-dispensation, which leads to poor patient outcomes&lt;/li&gt;
&lt;li&gt;Data inconsistencies, making it hard to track trends or audit decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We needed a solution that brought data-driven consistency into the process — fast, scalable, and reliable.&lt;/p&gt;

&lt;p&gt;🧠 Our ML-Based Solution&lt;br&gt;
We used ML.NET to build a machine learning model that predicts the quantity of drugs to be dispensed, based on historical prescription data.&lt;/p&gt;

&lt;p&gt;Instead of guessing or manually overriding, the system now gives a smart prediction — instantly — based on similar past transactions.&lt;/p&gt;

&lt;p&gt;Our model was trained on thousands of past records that included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The drug’s dosage&lt;/li&gt;
&lt;li&gt;Frequency and duration&lt;/li&gt;
&lt;li&gt;Drug strength&lt;/li&gt;
&lt;li&gt;The specific name of the drug&lt;/li&gt;
&lt;li&gt;Its dosage form (tablet, injection, syrup, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These fields gave us a rich foundation for pattern recognition. The only field we did not provide the model during prediction was the quantity — that’s what we asked it to predict.&lt;/p&gt;

&lt;p&gt;🧠 Our ML-Based Journey&lt;br&gt;
🔹 Starting with AutoML&lt;br&gt;
I initially explored this problem using ML.NET AutoML, which simplified the process of selecting the best algorithm and hyperparameters. With minimal code, I was able to train models on historical data and evaluate their performance quickly.&lt;/p&gt;

&lt;p&gt;This approach gave me early insights into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What features contributed most to prediction accuracy&lt;/li&gt;
&lt;li&gt;How regression models responded to healthcare-specific data&lt;/li&gt;
&lt;li&gt;The baseline performance I could expect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AutoML was incredibly helpful for prototyping and learning, but I eventually needed more control and flexibility — especially around how features were transformed and how the model integrated with our system.&lt;/p&gt;

&lt;p&gt;🔹 Moving to the ML.NET API&lt;br&gt;
To take full control, I transitioned to using the ML.NET API manually. This allowed me to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose and configure the exact model&lt;/li&gt;
&lt;li&gt;Define custom pipelines for feature engineering&lt;/li&gt;
&lt;li&gt;Handle data preprocessing, model training, and evaluation step-by-step&lt;/li&gt;
&lt;li&gt;Save and load the model easily for use in our production API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔹 Why Poisson Regression?&lt;br&gt;
I selected LbfgsPoissonRegression, a regression algorithm well-suited for count prediction problems — such as predicting quantities (whole numbers) rather than continuous values.&lt;/p&gt;

&lt;p&gt;Poisson regression worked particularly well because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The target (Quantity) is always a positive count&lt;/li&gt;
&lt;li&gt;It handles skewed distributions in data better than standard linear regression&lt;/li&gt;
&lt;li&gt;It’s optimized for scenarios where the output is based on frequency/intensity — a perfect fit for healthcare dispensing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📊 The Dataset&lt;br&gt;
We trained our model on thousands of historical records containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dose&lt;/li&gt;
&lt;li&gt;Frequency&lt;/li&gt;
&lt;li&gt;Strength&lt;/li&gt;
&lt;li&gt;Duration&lt;/li&gt;
&lt;li&gt;DrugName&lt;/li&gt;
&lt;li&gt;DosageForm&lt;/li&gt;
&lt;li&gt;And the Quantity dispensed (our label)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To prepare the data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We removed incomplete or duplicate records&lt;/li&gt;
&lt;li&gt;Standardized fields like dosage and drug names&lt;/li&gt;
&lt;li&gt;One-hot encoded categorical variables (e.g., drug name, dosage form)&lt;/li&gt;
&lt;li&gt;Split data into training and testing sets&lt;/li&gt;
&lt;li&gt;The Quantity column was not used during prediction — it was the value we wanted the model to learn and forecast.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚙️ The Engine Behind the Prediction&lt;br&gt;
While the internal implementation involved advanced machine learning (we used a Poisson Regression model — great for count-based predictions), we intentionally designed the system to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast: Trains on new data in seconds&lt;/li&gt;
&lt;li&gt;Portable: Can run inside any .NET service&lt;/li&gt;
&lt;li&gt;Accessible: Exposed via a simple web API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two API endpoints were created:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;GET /api/drugquantityprediction/train — trains the model on updated fulfillment data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;POST /api/drugquantityprediction/predict — accepts drug details and returns the predicted quantity&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This allowed other internal tools — like HMO admin dashboards — to request predictions in real-time.&lt;/p&gt;

&lt;p&gt;📊 Results and Business Impact&lt;br&gt;
After integrating this solution into our fulfillment workflow, we saw immediate benefits:&lt;/p&gt;

&lt;p&gt;✅ Reduced manual reviews by over 60%&lt;br&gt;
✅ Improved pharmacy compliance — pharmacists now had a clear reference&lt;br&gt;
✅ Increased trust from HMO partners due to transparent predictions&lt;br&gt;
✅ Lower error rates in dispensation, improving patient outcomes&lt;br&gt;
✅ Enabled data-backed auditing of past drug quantity decisions&lt;/p&gt;

&lt;p&gt;💬 What Makes This Powerful?&lt;br&gt;
No more guesswork: Instead of relying on memory or inconsistent pharmacy habits, we use historical data to guide decisions.&lt;/p&gt;

&lt;p&gt;Smart scaling: The API is stateless and scalable, making it easy to roll out across new partners or platforms.&lt;/p&gt;

&lt;p&gt;Localized intelligence: Because we train the model on our own fulfillment history, the predictions are uniquely tailored to our ecosystem.&lt;/p&gt;

&lt;p&gt;Simplicity for users: Clinicians and pharmacy staff don’t need to understand machine learning — they just get a recommended quantity, right when they need it.&lt;/p&gt;

&lt;p&gt;🔮 What’s Next?&lt;br&gt;
This solution is just the beginning. Here's what we're working on next:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deploying to Azure App Service for public API consumption&lt;/li&gt;
&lt;li&gt;Building a feedback loop to retrain the model as new fulfillment patterns emerge&lt;/li&gt;
&lt;li&gt;Adding confidence scoring to flag low-certainty predictions&lt;/li&gt;
&lt;li&gt;Enabling multi-drug predictions for combo prescriptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🤝 Final Thoughts&lt;br&gt;
This project is proof that machine learning doesn’t have to be a buzzword. When applied thoughtfully, it can solve deeply practical problems — like how much medicine someone should receive — and unlock real efficiency for businesses.&lt;/p&gt;

&lt;p&gt;It’s also a win for the healthcare ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Patients get exactly what they need.&lt;/li&gt;
&lt;li&gt;Pharmacies operate with clarity.&lt;/li&gt;
&lt;li&gt;HMOs reduce waste and build trust.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building for healthtech in Africa or exploring ML.NET for business problems, I’d love to connect.&lt;/p&gt;

&lt;p&gt;Let’s build smarter, faster, and more reliable systems — together.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>healthcare</category>
      <category>healthsolutions</category>
    </item>
    <item>
      <title>Mastering ML.net API: How I Leveraged It for High-Performance Model Training &amp; Deployment</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Mon, 17 Mar 2025 17:04:21 +0000</pubDate>
      <link>https://dev.to/fishi/mastering-mlnet-api-how-i-leveraged-it-for-high-performance-model-training-deployment-nhj</link>
      <guid>https://dev.to/fishi/mastering-mlnet-api-how-i-leveraged-it-for-high-performance-model-training-deployment-nhj</guid>
      <description>&lt;p&gt;In my last post, I shared how AutoML outperformed my manually implemented ML.NET model in prediction accuracy. But instead of stopping there, I dug deeper.&lt;/p&gt;

&lt;p&gt;What if you could achieve even better results while maintaining full control over your model?&lt;/p&gt;

&lt;p&gt;That’s exactly what I did. Instead of relying solely on AutoML, I used its insights to train and optimize a high-performance model using ML.NET API and then deployed it as an API for real-world use.&lt;/p&gt;

&lt;p&gt;Why ML.NET API Still Gives You an Edge Over AutoML&lt;br&gt;
While AutoML is great for quickly generating models, the ML.NET API SDK gives you the ability to:&lt;br&gt;
Customize feature engineering – Tailor data transformations for better predictions.&lt;br&gt;
 Manually fine-tune hyperparameters – Go beyond AutoML’s automatic adjustments for deeper optimization.&lt;br&gt;
 Select the right model evaluation metrics – Focus on performance measures that align with real business needs.&lt;br&gt;
 Deploy models as APIs for real-time predictions – Making ML solutions practical for enterprise applications.&lt;/p&gt;

&lt;p&gt;I applied these principles while working on a healthcare ML solution for accurate drug quantity dispensation for HMOs. Instead of letting AutoML handle everything, I used its insights to strategically fine-tune my ML.NET API implementation—and the difference was huge.&lt;/p&gt;

&lt;p&gt;From Model Training to Deployment: The Real-World Impact.&lt;br&gt;
Rather than stopping at model optimization, I exposed the ML.NET model as an API to integrate it into a larger system. This enabled:&lt;br&gt;
Real-time predictive analytics – Ensuring optimal drug dispensation for patients.&lt;br&gt;
 Scalability and flexibility – The ML model can be updated and improved without disrupting the system.&lt;br&gt;
 Enterprise-ready AI – A structured ML deployment pipeline that integrates seamlessly with healthcare applications.&lt;/p&gt;

&lt;p&gt;Key Takeaways for ML Engineers &amp;amp; Developers&lt;br&gt;
 AutoML is a great starting point, but understanding ML.NET API lets you optimize beyond its defaults.&lt;br&gt;
 Fine-tuning ML models manually gives you control over performance, accuracy, and scalability.&lt;br&gt;
 Deploying ML models as APIs makes AI practical and production-ready for enterprise applications.&lt;/p&gt;

&lt;p&gt;As I continue my ML.NET journey, I’m excited about how machine learning can drive innovation across industries. If you're passionate about ML.NET, AI in production, or deploying scalable ML models, let’s connect!&lt;br&gt;
 Follow for more insights on ML.NET, AI, and .NET development.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>api</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Why Did AutoML Beat My ML.NET Model? The Answer Surprised Me!"</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Mon, 24 Feb 2025 15:49:08 +0000</pubDate>
      <link>https://dev.to/fishi/why-did-automl-beat-my-mlnet-model-the-answer-surprised-me-lej</link>
      <guid>https://dev.to/fishi/why-did-automl-beat-my-mlnet-model-the-answer-surprised-me-lej</guid>
      <description>&lt;p&gt;Last week, I shared my journey using ML.NET to build predictive models, highlighting some key challenges and learnings. (Missed it? Check it out &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:7297761239970021376/" rel="noopener noreferrer"&gt;https://www.linkedin.com/feed/update/urn:li:activity:7297761239970021376/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;But something interesting happened... 🤔&lt;/p&gt;

&lt;p&gt;Despite using the same algorithm (L-BFGS Poisson Regression) in both ML.NET API and AutoML, the AutoML-generated model outperformed my manually implemented one—by a lot.&lt;/p&gt;

&lt;p&gt;So, I dug into the AutoML-generated code to uncover what was really happening behind the scenes. Here’s what I found:&lt;/p&gt;

&lt;p&gt;While working on a machine learning solution to optimize resource allocation, I implemented L-BFGS Poisson Regression using ML.NET. Initially, my manually implemented model didn’t achieve the expected prediction accuracy.&lt;/p&gt;

&lt;p&gt;However, when I tested AutoML-generated models, I noticed a significant difference—better predictions, improved generalization, and optimized hyperparameters.&lt;/p&gt;

&lt;p&gt;Curious about this disparity, I analyzed the AutoML-generated code and uncovered key differences in how model evaluation and optimization are handled behind the scenes.&lt;/p&gt;

&lt;p&gt;Key Takeaways from My Analysis:&lt;/p&gt;

&lt;p&gt;AutoML Does More Than You Think: Unlike the ML.NET API, AutoML optimizes hyperparameters, evaluates multiple models, and fine-tunes configurations, which significantly impacts prediction accuracy.&lt;/p&gt;

&lt;p&gt;Flexibility vs. Automation: The ML.NET API gives full control over model selection, hyperparameter tuning, and data preprocessing, but AutoML automates these steps, making it easier to get high-performing models with minimal effort.&lt;/p&gt;

&lt;p&gt;Experience Matters: While AutoML gives great results out of the box, understanding the ML.NET API helps you fine-tune models beyond AutoML’s defaults, unlocking even greater performance tailored to your dataset.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;🔹 AutoML isn’t just a shortcut—it fills in the gaps that most developers wouldn’t optimize manually.&lt;/p&gt;

&lt;p&gt;🔹 But knowing how AutoML works under the hood gives you an edge, letting you push ML.NET even further.&lt;/p&gt;

&lt;p&gt;🔹 A hybrid approach—leveraging AutoML while refining with the ML.NET API—can deliver highly efficient, production-ready models.&lt;/p&gt;

&lt;p&gt;What’s your experience with ML.NET and AutoML? Have you noticed similar differences in model performance? Let’s discuss!&lt;/p&gt;

&lt;p&gt;Follow for more ML.NET insights as I continue exploring real-world machine learning applications!&lt;/p&gt;

&lt;h1&gt;
  
  
  MLNET #MachineLearning #AutoML #DotNet #ArtificialIntelligence #AI #DataScience #DeepLearning #BigData #NeuralNetworks #PredictiveAnalytics #ML #MLInProduction #SoftwareEngineering #TechInnovation #DataDriven #CloudComputing #Azure #DevOps #AIInnovation #AICommunity #FutureOfTech #CareerGrowth #OpenToOpportunities #TechnologyTrends
&lt;/h1&gt;

</description>
      <category>machinelearning</category>
      <category>automl</category>
      <category>mlnet</category>
    </item>
    <item>
      <title>Leveraging ML.NET to Solve Real-World Problems</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Fri, 21 Feb 2025 00:56:39 +0000</pubDate>
      <link>https://dev.to/fishi/leveraging-mlnet-to-solve-real-world-problems-lhp</link>
      <guid>https://dev.to/fishi/leveraging-mlnet-to-solve-real-world-problems-lhp</guid>
      <description>&lt;p&gt;Over the past six weeks, I’ve been on a transformative learning journey with ML.NET, diving deep into how machine learning can be leveraged to solve real-world problems across various industries—all while staying within the powerful .NET ecosystem.&lt;/p&gt;

&lt;p&gt;As a .NET engineer, I’ve always been driven by the challenge of solving complex problems with innovative solutions. ML.NET has not only enhanced my technical skill set but has also opened my eyes to the potential of machine learning in applications ranging from healthcare and finance to logistics and retail.&lt;/p&gt;

&lt;p&gt;One of the most rewarding challenges I tackled was developing a solution in the healthcare space—focused on accurate drug quantity dispensation to HMOs for end users. The solution I built uses predictive models to ensure that drug quantities are dispensed accurately and efficiently, significantly improving operational processes.&lt;/p&gt;

&lt;p&gt;Challenges &amp;amp; Learnings Along the Way&lt;br&gt;
As part of the solution, I experimented with various ML algorithms in ML.NET, working through multiple challenges to achieve optimal accuracy in predicting drug quantities. A few notable challenges included:&lt;br&gt;
Tuning Hyperparameters: Ensuring accurate predictions by adjusting models to get the best Root Mean Squared Error (RMSE) and R-squared (R²) values for different ranges of data sets.&lt;br&gt;
Model Selection: Choosing between algorithms like Regression and Decision Trees, testing their performance on both small and large datasets, and ensuring generalization without overfitting.&lt;br&gt;
Cross-validation: Implementing cross-validation to evaluate model performance across different subsets of data, ensuring robustness and minimizing bias.&lt;br&gt;
A screenshot of the current healthcare solution I deployed shows real-time usage of the ML.NET model—further validating how ML.NET can truly drive impactful solutions.&lt;/p&gt;

&lt;p&gt;This project was just the beginning. As I continue to experiment and learn, I’ll be sharing my hands-on experiences in ML.NET, including:&lt;br&gt;
Best practices for working with ML.NET models&lt;br&gt;
Real-world use cases across various industries&lt;br&gt;
Solutions to common challenges like data preprocessing, model training, and evaluation metrics&lt;/p&gt;

&lt;p&gt;🔔 Stay tuned! Every week, I’ll be sharing fresh insights, challenges, and success stories from my ML.NET exploration. Whether you're a recruiter, fellow engineer, or machine learning enthusiast, let’s connect and discuss how ML.NET is transforming industries!&lt;br&gt;
Let’s build and innovate together! &lt;/p&gt;

&lt;h1&gt;
  
  
  MLNET #MachineLearning #DotNet #AI
&lt;/h1&gt;

&lt;h1&gt;
  
  
  DataScience #PredictiveAnalytics #HealthcareInnovation #SDCA #FastForestRegression #LbgfsPoissonRegression #CareerGrowth #OpenToOpportunities #ML #RMSE #RSquared #HyperparameterTuning #CrossValidation #DataScienceEngineering #MLInProduction
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpkkwy64rayu80lbl1px.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpkkwy64rayu80lbl1px.jpg" alt=" " width="800" height="1067"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
    </item>
    <item>
      <title>how to deploy smart contract to the blockchain using scripting</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Tue, 05 Nov 2024 12:36:23 +0000</pubDate>
      <link>https://dev.to/fishi/how-to-deploy-smart-contract-to-the-blockchain-using-scripting-2mc9</link>
      <guid>https://dev.to/fishi/how-to-deploy-smart-contract-to-the-blockchain-using-scripting-2mc9</guid>
      <description>&lt;p&gt;here are steps on how you can deploy your smart contracts using foundry with scripts&lt;br&gt;
N.B : you must have foundry installed in your local machine&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run Anvil : command for running anvil is - "anvil"&lt;/li&gt;
&lt;li&gt;Copy the localhost and paste in command below after --rpc-url&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;forge script script/DeployContract.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --private-key {PRIVATE_KEY}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;our script file will be something like this:&lt;/p&gt;

&lt;p&gt;`// SPDX-License-Identifier: SEE LICENSE IN LICENSE&lt;br&gt;
pragma solidity ^0.8.18;&lt;/p&gt;

&lt;p&gt;import {Script} from "forge-std/Script.sol";&lt;br&gt;
import {Counter} from "../src/Counter.sol";&lt;/p&gt;

&lt;p&gt;contract DeployCounter is Script {&lt;br&gt;
    function run() external returns (Counter) {&lt;br&gt;
        vm.startBroadcast();&lt;br&gt;
        Counter counter = new Counter();&lt;br&gt;
        vm.stopBroadcast();&lt;br&gt;
        return counter;&lt;br&gt;
    }&lt;br&gt;
}`&lt;/p&gt;

&lt;p&gt;Your smart contract should now be deployed to the onchain link&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>smartcontract</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Usage of onTap function in a listTile with Drawer</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Thu, 03 Mar 2022 11:45:58 +0000</pubDate>
      <link>https://dev.to/fishi/usage-of-ontap-function-in-a-listtile-with-drawer-3p70</link>
      <guid>https://dev.to/fishi/usage-of-ontap-function-in-a-listtile-with-drawer-3p70</guid>
      <description>&lt;p&gt;When making use of an onTap function in a ListTile widget in flutter: Use it this way:&lt;br&gt;
&lt;code&gt;Widget buildListTile(String text, IconData icon, Function() tapHandler) {&lt;br&gt;
    return ListTile(&lt;br&gt;
      leading: Icon(&lt;br&gt;
        icon,&lt;br&gt;
        size: 26,&lt;br&gt;
      ),&lt;br&gt;
      title: Text(&lt;br&gt;
        text,&lt;br&gt;
        style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),&lt;br&gt;
      ),&lt;br&gt;
      onTap: tapHandler,&lt;br&gt;
    );&lt;br&gt;
  }&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and not  this way:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Widget buildListTile(String text, IconData icon, Function tapHandler) {&lt;br&gt;
    return ListTile(&lt;br&gt;
      leading: Icon(&lt;br&gt;
        icon,&lt;br&gt;
        size: 26,&lt;br&gt;
      ),&lt;br&gt;
      title: Text(&lt;br&gt;
        text,&lt;br&gt;
        style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),&lt;br&gt;
      ),&lt;br&gt;
      onTap: tapHandler,&lt;br&gt;
    );&lt;br&gt;
  }&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;N.B&lt;/strong&gt; : Look how i defined the function in both&lt;/p&gt;

&lt;p&gt;the second way would run your code into errors while your code would be without errors in the first&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Expanded Vs Flexible in Flutter</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Fri, 25 Feb 2022 03:33:48 +0000</pubDate>
      <link>https://dev.to/fishi/expanded-vs-flexible-2a92</link>
      <guid>https://dev.to/fishi/expanded-vs-flexible-2a92</guid>
      <description>&lt;p&gt;Both Creates a widget that controls how a child of a [Row], [Column], or [Flex] flexes.&lt;/p&gt;

&lt;p&gt;If you come from a CSS background, this is related to flexbox&lt;/p&gt;

&lt;p&gt;The only difference between Expanded and Flexible is Expanded is Flexible that doesnt have a fit property&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;Flexible:&lt;br&gt;
&lt;code&gt;Flexible(&lt;br&gt;
flex: 3,&lt;br&gt;
                fit: FlexFit.tight,)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Expanded:&lt;br&gt;
`Expanded(&lt;br&gt;
flex: 3&lt;br&gt;
                //fit: FlexFit.tight,)&lt;/p&gt;

&lt;p&gt;The fit property in Expanded is commented.&lt;/p&gt;

&lt;p&gt;Both use flex the property&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Using Fold method in dart</title>
      <dc:creator>OLUWAYEMI FISAYO NATHANIEL</dc:creator>
      <pubDate>Fri, 25 Feb 2022 03:24:21 +0000</pubDate>
      <link>https://dev.to/fishi/using-fold-method-in-dart-1878</link>
      <guid>https://dev.to/fishi/using-fold-method-in-dart-1878</guid>
      <description>&lt;p&gt;The fold method in dart is used for:&lt;br&gt;
Reducing a collection to a single value by iteratively combining each element of the collection with an existing value&lt;/p&gt;

&lt;p&gt;Uses [initialValue] as the initial value, then iterates through the elements and updates the value with each element using the [combine] function, as if by:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var value = initialValue;&lt;br&gt;
for (E element in this) {&lt;br&gt;
  value = combine(value, element);&lt;br&gt;
}&lt;br&gt;
return value;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;fold&lt;/strong&gt; method in dart just acts like the &lt;strong&gt;reduce&lt;/strong&gt; method in javascript&lt;/p&gt;

&lt;p&gt;Another example of the fold method in dart :&lt;br&gt;
&lt;code&gt;double get totalNetSpend {&lt;br&gt;
    return groupedTransactionData.fold(0.0, (sum, item) {&lt;br&gt;
      return sum + (item['amount'] as double);&lt;br&gt;
    });&lt;br&gt;
  }&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
