<?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 Dan Anderson on Medium]]></title>
        <description><![CDATA[Stories by Dan Anderson on Medium]]></description>
        <link>https://medium.com/@danoand?source=rss-871fd6309425------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ljMmhft74iaqAXPw.jpeg</url>
            <title>Stories by Dan Anderson on Medium</title>
            <link>https://medium.com/@danoand?source=rss-871fd6309425------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:25:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danoand/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’s Your City’s Score?]]></title>
            <link>https://danoand.medium.com/whats-your-city-s-score-dc0b6709086a?source=rss-871fd6309425------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc0b6709086a</guid>
            <dc:creator><![CDATA[Dan Anderson]]></dc:creator>
            <pubDate>Wed, 03 Mar 2021 03:25:12 GMT</pubDate>
            <atom:updated>2021-03-04T02:07:21.225Z</atom:updated>
            <content:encoded><![CDATA[<p>I am coming up to the end of my Lambda School journey. The last leg is a “labs” project where students in the web, mobile, and data science tracks build apps as a part of a cross-functional team simulating an authentic project. As a Data Science student, I joined just such a team of seven developers and our intrepid TL (thanks Sammy!) as our project steward.</p><h3>The Problem &amp; Customer</h3><p>The primary role I played prior to Lambda School was as a software Product Manager. Sometimes this was in large companies and often in small companies and startups. For me, the first question to ask is what’s the problem we’re solving, and for whom are we delivering a solution. This real-world inspired lab project was no different.</p><p>Our customers/users are people researching a city location with the intent to move or visit. Their problem was how to easily size up a city and compare its “livability” across multiple geographic options.</p><h3>A Possible Solution</h3><p>I am a big fan of the concept of a business or lean canvas. A business canvas is typically a succinct document — ideally one page — that summarizes the key elements of a business or product. (Check out Ash Murya’s Lean Stack <a href="https://leanstack.com/">offering</a>… highly recommended!)</p><p>Those key elements include sections for brainstorming &amp; refining ideas regarding customers, problems, solutions, and our value proposition among other business drivers.</p><p>For me, identifying customers and problems is always a “chicken or egg” scenario. Those concepts need to be thought of together — not in isolation. That is customers have problems &amp; those problems aren’t meaningful unless describable people live them.</p><p>At a high level, a solution would enable people to find cities they are interested in and dig into details that are central to understanding the city’s livability. A key to the solution will be to size up a city quickly without confusing the user with a wave of data or details. In other words, we want the user to be able to clearly see the forest rather than peer through a universe of trees. And finally, enable the user to compare that city’s forest (its comprehensible livability assessment) with other cities.</p><h3>The Critical (Data) Path</h3><p>After getting a grip on who our customer is, the problem they have, and our take on how we think they want to solve that problem, the next step was finding the data we’d need to fuel the solution.</p><p>We had varying success finding data associate with these domains of city life: <strong><em>rent</em></strong>, <strong><em>crime</em></strong>, “<strong><em>walkability</em></strong>” (can I get around without transportation), and <strong><em>air quality</em></strong>.</p><p>On a lean budget (well… $0 on top of our Lambda School tools) we found some raw data in these dimensions. That data typically described a point in time (e.g. YR2019) and was static in nature. That probably eliminated sophisticated predictive modeling — so a solid but not a great set of data sources.</p><p>Given our reasonable data expectations was the game up? To answer that question we harkened back to our first principles — what’s the problem we’re solving and for whom are we solving it? I think our prospective users want some good insight and guidance. If rent or crime diverged a bit from what a whiz-bang predictive model would produce, I don’t think it would matter. So we pushed onward!</p><h3>What’s the Score?</h3><p>We surmised our users want ease, brevity, and a frame of reference to compare multiple cities. With reasonable, not great data sources, we landed on the trusty <strong>1–5</strong> scoring spectrum to present the city’s livability.</p><p>Ah yes that 1 to 5 range was not invented by a surveying monkey in the late ’90s but has been a staple of the customer, user, student, parent, and voter study for what seems like forever. Boring… maybe. Effective… yes!</p><p>Armed with this tried and true approach we thought we could counter our concerns of less than stellar data and pedestrian data analysis. The data strategy was to calculate data “scores” that could translate to an easy-to-understand score — 5 (highest) to 1 (lowest). We accomplished that by leveraging Facebook’s Prophet module for automatic forecasting (rent) and sklearn’s <em>minmax</em> scaler to standardize across locations such as a crime “score”.</p><p>The interim result translated to scores by city. As an added benefit, we could ask users to weigh each city dimension based on their personal preference from <strong>1</strong> (lowest importance) to <strong>10</strong> (highest importance). For example, the user could weigh crime very important while deemphasizing air quality. I think this allowed us to wring even more value out of our data while presenting results that seemed to be more tailored to our users’ needs.</p><h3>Don’t Get Siloed</h3><p>As we progressed down the data/coding path we resolved to leverage the user’s livability weightings with respect to crime, rent, air quality, and walkability. Calculating a weighted score across those domains is straightforward math.</p><p>Up until this point, those individual scores were generated in each API route handler. So each handler (<em>GET /crime_scr</em>, <em>GET /rent_rate</em>, etc.) included explicit python statements to generate its relevant score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahYtKq6-Zvw42AqgT6NjeA.png" /><figcaption>Singular Route Generating a “Crime” Score</figcaption></figure><p>However, we had another dilemma. A composite, weighted score would need to first calculate each underlying score prior to producing the overall score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*5CxiF6ARw5YayuG4vBTNrw.png" /><figcaption>Composite Score Code vs. Individual Scores Code</figcaption></figure><p>Addressing this dilemma led to a common architecture or code structuring question — leverage logic in multiple places in our app. To execute code that was already in place across multiple API route handlers we could merely duplicate the code (coding “copypasta”?). While this could be effective it runs counter to DRY (<strong><em>D</em></strong><em>on’t </em><strong><em>R</em></strong><em>epeat </em><strong><em>Y</em></strong><em>ourself</em>) programming principles.</p><p>The other option was to extract common code into discrete functions since calculating livability scores could be leveraged in multiple locations in our codebase. This seemed like a better choice as it would structure the logic for future enhancements and extensions.</p><p>My teammate and I dove back into our individual route handlers and pulled out the score calculation code into single-purpose functions. Then we updated our handlers to invoke those functions where needed.</p><p>This turned long, “heavy” handlers into leaner, focused API methods while also making the called functions more easily understood. See the code below for a concise handler that leverages a single function call to generate the primary output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mtEYGyFKGHKH8253wPQCWw.png" /><figcaption>“Leaner” Code Using a Primary Function Call</figcaption></figure><h3>The App</h3><p>As data science team members, our part of the app is abstracted from the end-user and implemented as an API layer to be consumed by the upstream web and mobile app functionality. In short, the API functionality surfaced web service routes that returned livability scores for these dimensions of city life: <em>crime</em>, <em>rent</em>, <em>walkability</em>, and <em>air quality</em>. For our MVP release, as a team, we closed on supporting the top 100 cities by population. The final MVP end-user-oriented route returned a composite or overall city score taking into account the user’s preferred livability weighting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*G33IdfiuKrJ47SsZcFqHOw.gif" /><figcaption>Returning an Overall City Score for New York City</figcaption></figure><p>The API also surfaced supporting routes delivering data to the front-end for transactional purposes. These include routes to return the list of supported cities, city populations, and database connection status information.</p><p><strong><em>The App &amp; Beyond</em></strong></p><p>The primary objective of the project was to engage as a team integrating multiple programming and operating disciplines simulating real-world projects. To that end, we focused on a limited MVP. The project may continue with a new Labs team who could be charged with extending the app. Potential enhancements may include expanding the list of supported cities (ideally nationwide), including additional livability dimensions, map-based searching, and side-by-side city comparisons.</p><p>The next team will face their own set of project challenges. With these potential extensions, finding suitable data sources will always be a task to be tackled with. That will include selecting the appropriate modeling methods: generating scores or metrics, building predictive models, and producing user-friendly visualizations.</p><h3>The End Game</h3><p>I think the project met our expectations. The team worked well together in a very relaxed, supportive manner even when we experienced the loss of a couple of teammates due to other commitments. As a Product Manager, I think my colleagues who were new to development projects experience a very real team experience. This included building a shared vision, communicating issues, documenting resolutions, and integrating our code using common tools such as GitHub, AWS Elastic Beanstalk, and major development frameworks. While the project roadmap was familiar to me, it was a great education to live it from a developer’s mindset as opposed to a Product or Program Manager.</p><p>With that, I come to the end of the path both for this Lambda Labs project and my Lambda School journey. Both represent steps in what I think (and hope) is a much longer trek of learning and growth.</p><p>For me as a Product Manager, the lab experience illustrated many of the elements I observed technical teams address in past lives — defining business goals, understanding requirements, applying design patterns, and refactoring code.</p><p>As for Lambda School, an ancient proverb says that “a journey of a thousand miles begins with a single step” (<a href="https://en.wikipedia.org/wiki/A_journey_of_a_thousand_miles_begins_with_a_single_step">wiki</a>). I think I just took my first step and am looking forward to seeing what comes next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc0b6709086a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Naive Bayes Classifier: A Naive Gopher Approach]]></title>
            <link>https://danoand.medium.com/naive-bayes-classifier-a-naive-gopher-approach-3dd6cfec7fd3?source=rss-871fd6309425------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dd6cfec7fd3</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[lambda-school]]></category>
            <category><![CDATA[bayesian-statistics]]></category>
            <dc:creator><![CDATA[Dan Anderson]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 02:51:56 GMT</pubDate>
            <atom:updated>2020-09-01T01:56:12.655Z</atom:updated>
            <content:encoded><![CDATA[<p>As a fledgling Data Science student at Lambda School, it’s easy to get lost in Python’s vast ecosystem of data science libraries such as pandas, NumPy, and scikit-learn and lose sight of the underlying algorithm we depend on for our analysis.</p><h3>The Objective</h3><p>As a part of our Computer Science (CS) coursework — that we’re sharing with our Lambda Web Development compatriots —our objective is to “take it back to the streets” and implement a common algorithm with native code rather than leaning on an existing library. This exercise would seem to help flex our CS learning and also refresh our understanding of the algorithmic underpinnings of the libraries we use every day. Challenge accepted!</p><p>As a fan of the Go programming language, I decided to add a personal twist and use Go (<a href="https://golang.org/">https://golang.org</a>) instead of Python as the implementation language of choice.</p><h3>Kick It With Go</h3><p>Go is a statically typed, compiled language initially designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson (<a href="https://en.wikipedia.org/wiki/Go_(programming_language)">Wikipedia</a>). It is fast becoming the lingua franca of networked computing leveraged by prominent projects such as Docker, Kubernetes, and Terraform as well as a common choice for server-side systems at companies such as Google, Uber, Twitch, and Dropbox.</p><h3>The Problem: Spam Message Classification</h3><p>A classic problem of the Internet age was combating the major pain point of this new form of communication we embraced called email. That pain was spam — unwanted email messages mostly in the form of tiresome advertisements and outright scams. (How many Nigerian princes are there anyways!)</p><p>The issue is how can a computer program determine that this bunch of text is a birthday wish from Mom and that gaggle of words is asking me to purchase some new form of snake oil.</p><p>One answer lay in the form of Bayesian Inference that builds upon Bayes Theorem to infer or classify email messages such as spam (unwanted) or ham (wanted).</p><h3>Bayesian Inference</h3><p>Bayes Theorem is a mathematical expression that describes the probability of an event occurring in terms of known conditions prior to that event. In the case of our pesky spam message (a nasty event), can we predict that the next email we receive is spam based on what we currently know about the words included in that email?</p><p>We don’t know with absolute certainty that the next message is spam but a smart computer program can quickly read the inbound message’s words and “know” how often those words were included in spam messages observed in the past.</p><p>Computer programs are fast (usually) so the hope is that our program can read the bag of words from the message, assess how those words have been used in messages in the past (humans have marked past messages as spam/unwanted or ham/desired) and classify that message as spam and remove it from our view.</p><p>So we have a possible future event — that my next email will be spam. Let’s call that future event “<strong>A</strong>”. And we have known events that have occurred in the past. That is past emails with a particular <em>set of words</em> that have been considered spam or ham. Let’s call that event “<strong>B</strong>”.</p><p>Bayes Theorem gives us a way to express how the probability of spam (“A”) given the probability that the presence of a bunch of words has resulted in messages deemed to be spam in the past (“B”). Here’s that formula from <a href="https://en.wikipedia.org/wiki/Bayes%27_theorem">Wikipedia</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/0*rlvSFMwikXbmuEO3.png" /></figure><p>One step we can take with our basic spam filtering approach is to assume that each message word is independent of each other. That is we <em>naively </em>assume that if we come across the word “cold” we don’t have any information that the word “beer” will also be in the message as well. This refers to the <strong><em>naive bayesian</em></strong> approach. It may be unrealistic (in the case of my personal network… perhaps extremely so) but we’ll go with it.</p><p>But making this assumption allows us to simplify the Bayes Theorem expression above for spam modeling purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*paskIjuwD6QUOIBf.png" /></figure><p>In short, if we take a naive approach given a set of tokens the probability that a message is spam can be expressed by what we’ve analyzed in our dataset. That is, the probability that those same tokens were in spam divided by the sum of the probabilities that the set of tokens in both spam and ham messages. Intuitively, if a bunch of words is almost always in spam messages but rarely in ham messages, the probability of spam will tend towards 100%. This formulation seems to make intuitive sense.</p><h3>A Message Object</h3><p>We’ll jump into Go code by describing what our program means by a message. Using Go’s struct object, the logic defines a <strong><em>message</em></strong> as a data structure with two attributes: <strong><em>Text</em></strong> (the message string) and <strong><em>isSpam</em></strong> (a true/false flag indicating if the message is spam). Here’s a little snippet of code that makes this definition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwVMVWLFUou27SKn.png" /></figure><p>A bunch of messages such as we’ll use for fitting our model is simply an array of message structs represented by the <strong><em>myMessages</em></strong> variable defined in line 7 above.</p><h3>Tokenize Message Words</h3><p>To mathematically process words in a message, we’ll need to get a handle on how to define words from all of the characters that can be included in a message. For example, how does our process interpret punctuation such as the question mark at the end of this sentence?</p><p>To help, we’ll need to “tokenize” words to eliminate extraneous and ambiguous characters and treat words in a consistent manner across all messages. To do that, we’ll fashion a rudimentary tokenization process using these basic rules:</p><ul><li>generate a unique token string for each allowable word in all messages</li><li>ignore spaces so each word is considered the text between spaces (ie. separate the message string into individual words splitting the string when encountering embedded spaces)</li><li>lowercase all alpha characters</li><li>and… throw out all characters other than lowercase alphanumeric characters <strong><em>a</em></strong> to <strong><em>z</em></strong> and digits <strong><em>0</em></strong> to <strong><em>1</em></strong></li></ul><p>So the message “<em>Hey! hey… Why didn’t you get 2 DQ peanut buster parfaits?!</em>” when tokenized would generate this list of tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fi01umY7KZQKET4p.png" /></figure><p>After tokenizing all of our words we’ll have a count of how many times each word appears in a spam message or ham (non-spam) message. Presumably, some spammy words are far more prevalent in spam messages than not.</p><h3>Create a Classifier Model</h3><p>Similar to what we do with some of the Python ecosystem’s sophisticated statistical inference and machine learning libraries we’ll create a model object to classify our messages. Like messages above, the logic stands up a Go struct object to house the model’s attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v1ADWokulvz8WjPr.png" /></figure><p>We’ll fit our dataset to the model and fill in these object attribute details based on that operation. In particular, we’ll know based on our data:</p><ul><li>our unique set of tokens</li><li>the number of spam messages in which a token is found</li><li>the number of ham messages in which a token is found</li><li>total number of messages we have processed</li><li>with the total the number of spam messages</li><li>… and the number of ham messages</li></ul><p>To fit the classifier model, the code reads in a CSV file of spam/ham messages downloaded from Kaggle (Dataset: <strong><em>Spam Text Message Classification </em></strong>— thanks TeamAI &amp; Kaggle! <a href="https://www.kaggle.com/team-ai/spam-text-message-classification">link</a>)</p><h3>Predicting Spam</h3><p>Okay… the reason we’re here. Let’s do a prediction. Our task is to calculate the naive bayesian metrics generating a value that we can interpret as a prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Va8FHcWNGsc2DUm8.png" /></figure><p>To generate a prediction the logic will:</p><ul><li>accept a string text</li><li>convert the string to a set of tokens</li><li>for each token, calculate the probability of it appearing in a spam and ham message</li><li>for the set of tokens calculate the overall probability of that set appearing in a spam and ham message; in this case, instead of multiplying very small numbers the logic adds up the natural log of each value</li><li>return the set’s spam and ham values and generate the overall naive bayesian metric we talked about above</li></ul><h3>Take a Look!</h3><p>For Go developers or those interested in checking some go code, take a gander at my GitHub repo: <a href="https://github.com/danoand/CS-Data-Science-Build-Week-1">https://github.com/danoand/CS-Data-Science-Build-Week-1</a>. (Still a noob at Go — be gentle!)</p><p>The Go modeling code resides in the <strong><em>modeling.go</em></strong> file in the root of the repo. The comparable Python model can be found in the <strong><em>python/app.py </em></strong>file.</p><p>Better yet! The repo is a web application that displays an interactive web page where you can predict messages from the underlying dataset or type in your own message. You can compare the results from our native Go model and a Python scikit-learn model.</p><p>Navigate to <a href="https://bayes.dananderson.dev/">https://bayes.dananderson.dev</a> to take a look!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dd6cfec7fd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Waiting for Our Autonomous Cars… a Look at Vehicle-Pedestrian Accidents]]></title>
            <link>https://danoand.medium.com/waiting-for-our-autonomous-cars-a-look-at-vehicle-pedestrian-accidents-24130f144a44?source=rss-871fd6309425------2</link>
            <guid isPermaLink="false">https://medium.com/p/24130f144a44</guid>
            <category><![CDATA[lambda-school]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Dan Anderson]]></dc:creator>
            <pubDate>Sat, 07 Mar 2020 02:41:44 GMT</pubDate>
            <atom:updated>2020-03-10T03:14:32.297Z</atom:updated>
            <content:encoded><![CDATA[<p>Technology holds great promise to improve our lives including saving lives. According to a US Department of Transportation study, innovations including autonomous vehicles could save over 35,000 lives a year.</p><p>Until that particular holy grail appears, a tragic set of outcomes are pedestrians who are killed or injured in vehicular accidents each year. According to the CDC, in 2016 alone, almost 6000 pedestrians were killed and 129,000 required emergency care for “non-fatal crash-related injuries” (<a href="https://www.cdc.gov/motorvehiclesafety/pedestrian_safety/index.html"><em>link</em></a>)</p><p>Let’s take advantage of a rich dataset of vehicular-pedestrian accidents and see what findings we can draw.</p><h3>The Data &amp; Data Pre-Processing</h3><p>Our data comes from <a href="https://www.chapelhillopendata.org/">chapelhillopendata.org</a> (<a href="https://www.chapelhillopendata.org/explore/dataset/pedestrian-crashes-chapel-hill-region/export/?disjunctive.city&amp;disjunctive.county&amp;disjunctive.crashsevr&amp;disjunctive.crashyear"><em>link</em></a>) and describes vehicle-pedestrian accidents over 11 years. It is a robust collection of categorical data depicting road conditions, demographic data, and incident observations.</p><h4><strong>GOAL: PREDICT SERIOUS PEDESTRIAN OUTCOMES</strong></h4><p>While the incident data observed on the scene such as the presence of alcohol, driver age group, and pedestrian gender is interesting. Our goal is to use general data such as weather, posted speed limit, and road conditions to <em>determine if pedestrian outcomes can be reliably predicted</em>. (<a href="https://drive.google.com/file/d/1Y5aXWZP54sUNYEREwUnsnDCU5ds10Gzj/view?usp=sharing"><em>notebook link</em></a><em>; </em><a href="https://github.com/danoand/Build_Project_02/blob/master/Chapel_Hill_Vehicle_Pedestrian_Accidents.ipynb"><em>github.com</em></a>)</p><h4><strong>PREP DATA</strong></h4><p>Given our goal above only the a priori data attributes will be used for building a prediction model. This helps prevent <em>data leakage</em> and focuses on dimensions that could be actionable by both policymakers and motorists. So we’ll close on these general data attributes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*JGI4D4e1peTR7BWYdhNH-Q.png" /><figcaption>Focus on General Data Attributes (Outcome = ‘PedInjury’)</figcaption></figure><p>The dataset is very clean but we’ll tweak some of the categorical labels to be a little friendlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*heesGlpAqFgw_sxobFgqkg.png" /><figcaption>Simplify Labels</figcaption></figure><p>So let’s get a sense of the outcomes and see what we’re dealing with. Out of 33,707 incidents, 4,587 (13.6%) resulted in a pedestrian death or serious injury.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*1fxhWw64ewbUTIILNFLyYw.png" /><figcaption>Number of Pedestrians by Type of Outcome (13.6% killed or serious injury)</figcaption></figure><p>Let’s take a sneak peek and look at a potential factor in these incidents — <em>weather</em>. Surprisingly, the vast majority (3,474 out of 4,578 | 76%) of the serious pedestrian outcomes occurred in “clear” weather conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*-18yk0tPVw_pBJaWXcVLkg.png" /><figcaption>“Clear” Weather Conditions for Most Serious Outcome Incidents (~76%)</figcaption></figure><p>How about another attribute that would seem to influence serious outcomes — the hour of the day? In this case, intuition appears to hold as outcomes worsen at night.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*gEZZHvLo6RjHUXXdN0TBjg.png" /><figcaption>Serious Outcomes and Hour of the Day</figcaption></figure><p>At a cursory level, the data contains some intuitive observations (pedestrians experiencing serious injuries, the importance of the time of day ) and some counter-intuitive (clear weather for most bad outcomes).</p><h3>Predictive Modeling</h3><p>The dataset is comprised of categorical attribute data and an outcome variable. Prior to modeling, we’ll execute one more data wrangling operation creating a boolean outcome column in which a <em>True</em> value indicates a pedestrian death or serious injury and <em>False</em> indicates some other outcome.</p><h4>BASELINE MODEL</h4><p>Our first step is to generate a baseline model to which we can compare a predictive model. Using the <em>sklearn</em> package’s <em>DummyClassifier</em> model, simulated guessing yields a prediction score of 76.2%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*FdRa2A65x8roASQMdnKAew.png" /><figcaption>Use sklearn’s DummyClassifier as a Baseline Prediction (.7623)</figcaption></figure><h4>RANDOM FOREST MODEL</h4><p>With a baseline model in hand, we employed a Random Forest Classifier model against categorical data attributes encoded as ordinal integers. The random forest model improves prediction accuracy over the baseline from 76% to 86%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*nK0St1AZ4VMnY-toW33ufA.png" /><figcaption>Random Forest Classifier Model</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*AxPUUpdPVyWVwl02g6bMqg.png" /><figcaption>Improved Accuracy vs. Baseline (.8604 vs. .7623)</figcaption></figure><h4>MODEL EVALUATION</h4><p>An alternative approach using a Logistic Regression model yields similar accuracy scores (0.86) as the classifier model. In this case, we’ll stick with the classifier and get a sense of how that model performs.</p><p>The classifier model’s performance is reflected in its ROC (<em>Receiver Operating Characteristic</em>) AUC score (0.7431) which illustrates how well the model distinguishes between our two outcomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*QCJsSk0DFGyeLuUGo98suA.png" /><figcaption>ROC AUC (0.7431)</figcaption></figure><p>While the prediction accuracy seems good, the ROC score, while better than merely guessing, does not excel but is acceptable for our purposes to draw some insights into the data.</p><h3>Discussion</h3><p>At the end of the day, we have a good, clean dataset depicting an important set of outcomes (pedestrian deaths/injuries from vehicular accidents). A straightforward random forest classifier model appears to do a good job predicting known outcomes with solid performance distinguishing between serious and other types of pedestrian outcomes.</p><p><em>What matters most? Does our initial intuition hold true?</em> We can use <strong><em>Permutation Importance</em></strong> to assess how important an independent feature is to predicting outcomes. The top five important features are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*SGhkb2NvhzR0vDD7QoOxmQ.png" /><figcaption>Top 5 Features by Importance</figcaption></figure><p>All of these features make intuitive sense as outcome factors: Light Conditions, Traffic Controls, Month of the Year, Type of Road, and Speed Limit.</p><p>The least important features are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*r9rBiL3oBoDNFeOaXdYJwg.png" /><figcaption>Bottom 5 Features by Importance</figcaption></figure><p>Perhaps counterintuitively, features such as Weather and certain Road Characteristics were not important in predicting outcomes.</p><p>One deduction we can make is that the visibility of pedestrians by drivers may be a culprit. Important features such as Light Conditions, Month of Crash (winter months mean shorter daylight hours), and even Speed Limit hint that lowered driver visibility may be a major cause.</p><p>A deeper analysis is needed but it seems tangible actions can be taken to improve safety… while we wait for our autonomous vehicles to arrive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24130f144a44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting a Data Science Journey]]></title>
            <link>https://danoand.medium.com/starting-a-data-science-journey-9b047a1f660c?source=rss-871fd6309425------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b047a1f660c</guid>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[lambda-school]]></category>
            <dc:creator><![CDATA[Dan Anderson]]></dc:creator>
            <pubDate>Fri, 10 Jan 2020 04:03:13 GMT</pubDate>
            <atom:updated>2020-01-13T04:54:29.690Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Look at Global Warming</h3><p>I recently began my journey into the world of data science as a member of <a href="https://lambdaschool.com/courses/data-science">Lambda School</a>’s Data Science “DSPT4” cohort. Lambda School is an awesome online coding school where learners can dive into user experience design, full-stack web app &amp; mobile app development, and of course data science. It’s been a great ride of coding, statistics, data wrangling and community. Sounds good? It gets better — students can pay nothing until they land that killa new job.</p><p>At this juncture, a course milestone is to apply our early learnings to a data-driven problem or issue. The question of global climate change is probably one of the most intriguing of our age and unfortunately one that is divisive both socially and politically. Why not jump into the deep end of the pool!</p><h4>Global Climate — Possible Drivers</h4><p>Our planet’s climate and weather processes are some of the most complex systems humans will ever analyze. My humble goal is to do a (very) high-level comparison of two potential drivers of global climate: 1) <strong><em>CO2 driven</em></strong> global warming and 2) a lesser-known concept known as the <a href="https://en.wikipedia.org/wiki/Cosmic_ray#Postulated_role_in_climate_change"><strong><em>cosmic ray hypothesis</em></strong></a>.</p><h4>CO2 Driven Global Warming</h4><p>The dominant explanation of global warming and climate change focuses on increases in atmospheric carbon dioxide (CO2). CO2 is a known “greenhouse gas”. CO2 molecules absorb energy in the form of <a href="https://en.wikipedia.org/wiki/Photon">photons</a> from the sun causing their oxygen atoms to <a href="https://scied.ucar.edu/carbon-dioxide-absorbs-and-re-emits-infrared-radiation">vibrate</a>, increasing the energy of the molecule and surrounding molecules and then releasing a photon back into the atmosphere where the dynamic continues. This process on a large scale generates warming.</p><p>As fossil fuel consumption has dramatically increased over the last 120 years or so, the amount of CO2 in the atmosphere (CO2 concentration) has risen sharply from around 300 parts per million (ppm) to just over 400 ppm. More CO2 in the atmosphere (from anthropogenic or human-induced greenhouse gas emissions) means more energy absorption which leads to more atmospheric warming and a warmer and possibly more chaotic global climate.</p><h4>Cosmic Ray Hypothesis of Global Climate</h4><p>What the heck is this “cosmic ray”, <a href="https://www.imdb.com/title/tt0027623/">Flash Gordon</a> stuff — anybody “memba” the planet Mongo and Ming the Merciless?</p><p>Some compelling reasons exist to look for other climate factors including the nature of energy absorption by CO2, an observed decade long warming “hiatus”, and historical periods of both cooling and warming which featured low CO2 concentration.</p><p><em>CO2 Energy Absorption</em>: All things being equal a doubling of CO2 concentration translates to a roughly 1C increase in warming. Due to this effect, the next batch of CO2 to enter the atmosphere should have less of a warming effect than the last batch — unless there are other forces at play.</p><p><em>A Warming Hiatus?</em>: Some observers note that satellite temperature measurements indicate a “hiatus” or pause in warming between the years 1998 and 2013. This pause has not been clearly explained and remains controversial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*MwMgJZps3iEzGUMcSj7ESA.png" /><figcaption><strong>Warming Hiatus? 1998–2013</strong></figcaption></figure><p><em>Historical Cooling &amp; Warming Periods</em>: Also prior to the industrial age and the increase in fossil fuel burning, there were distinct periods of both warming &amp; cooling such as the <a href="https://en.wikipedia.org/wiki/Medieval_Warm_Period">Medieval Warm Period</a> — MWP (~950 to ~1250) and the Little Ice Age — LIA (~1350 to 1850). The MWP exhibited warming similar to the 20th Century and is thought to have enabled Norse exploration of Greenland and North America. The LIA surfaced dramatic cooling historically depicted in accounts of the harsh winter at Valley Forge during the American Revolution and the routine winter freezing of the Thames River. Both of these periods occurred during a time with low atmospheric CO2 concentrations.</p><p>Alternative theories have been explored including the Cosmic Ray Hypothesis. Cosmic Rays are atomic particles that pound the earth expelled from stars outside of the Earth’s solar system.</p><p>At a high level, the mechanics work in this way. The sun as the dominant energy source in the solar system includes energy in the form of light, infrared radiation, and other forms of electromagnetic radiation. The power of the sun goes in cycles. In times of increased solar activity, the Sun emits high levels of energy pulses that shield the Earth from cosmic rays and in periods of low activity allows more cosmic rays to bombard the planet.</p><p>Cosmic rays <a href="https://physicsworld.com/a/physicists-claim-further-evidence-of-link-between-cosmic-rays-and-cloud-formation/">“seed” cloud cover</a> by ionizing molecules in the Earth’s atmosphere. These charged molecules clump together which enables water vapor to condense around them and produce clouds. Low solar activity leads to a relative increase in cosmic rays which leads to increase cloud cover and cooling.</p><p>High solar activity does the reverse — leading to a relative decrease in cosmic rays and cloud seeding and therefore more warming. Sunspots are a visible proxy for this type of solar activity so more sunspots mean higher solar activity and fewer sunspots mean relatively lower solar activity.</p><h4>Let’s Compare the Theories</h4><p>So let’s use some basic quantitative methods from the data science world to contrast the theories. We’ll start by grabbing some data: <em>Global Temperature</em>, <em>atmospheric CO2 Concentration</em>, and <em>sunspot observations</em> through history.</p><p>Our goal is to get as much data over as long of a time period as possible — ideally hundreds of years.</p><ul><li><strong>GLOBAL TEMPERATURE DATA — </strong>We’ll grab data from the <a href="http://berkeleyearth.org/about-data-set/">Berkeley Earth Surface Temperature Study</a> which includes “1.6 billion temperature reports from 16 preexisting data archives”. What’s great about this data set is that constructed data goes back to the early 1700s. The temperature data comes in the form of anomalies. That is the observations are not absolute temperature readings (e.g. 21C) but differences (-0.4 C, 1.1C, etc.) from a baseline. In our case, the baseline value is the average temperature from January 1951 to December 1980 (<a href="http://berkeleyearth.lbl.gov/auto/Global/Complete_TAVG_complete.txt">data</a>)</li><li><strong>ATMOSPHERIC CO2 CONCENTRATION</strong> — fetched data from <a href="http://sealevel.info/about.html">SeaLevel.info</a> which combines ice core data and CO2 measurements from the Mauna Loa Observatory. This dataset includes observations from 1800 to the present (<a href="https://sealevel.info/co2.html">data</a>)</li><li><strong>HISTORICAL SUNSPOT OBSERVATIONS</strong> — since historically measuring the sun’s electromagnetic flux is not feasible, we’ll use sunspot observations as a proxy data sourced from the <a href="http://www.sidc.be/silso/about">WDC-SILSO</a> (Sunspot Index and Long-term Solar Observations) directorate of the Royal Observatory of Belgium. This organization’s mission is to “to preserve, develop and diffuse the knowledge of the long-term variations of solar activity”. Even better it provides observations from 1700 (<a href="http://www.sidc.be/silso/INFO/snytotcsv.php">data</a>)</li></ul><h4>Wrangle The Data</h4><p>The real world is messy and data describing the real world is even messier so we’ll need to wrangle our data a bit. Even though we have some data from 1700, we only have CO2 concentration data from 1800. And for that data, the first few decades have ice core data every five years. So one bit of wrangling is to “fill in” the prorated CO2 concentration (in ppm) for that missing data.</p><p>Our temperature data is in monthly observations. Because CO2 concentration and the sunspot count are annual data points, I’ve calculated yearly average temperature values.</p><h4>Visualize the Data</h4><p>Let’s see what we got by generating some basic data plots.</p><figure><img alt="CO2 concentration, sunspot counts, and average global temperature anomalies since 1800" src="https://cdn-images-1.medium.com/max/1024/1*jopmF3Nci8Zi-0zcCdXHIQ.png" /><figcaption><strong>Simple Plots: CO2, Sunspot Cycles, Temperature Anomalies</strong></figcaption></figure><p>On the left-hand side, we have CO2 concentration increasing in a nice smooth curve from 280 ppm to over 400 ppm and see clearly that sunspot observations (and presumably solar activity) move in a very cyclical manner — known to be an 11-year cycle.</p><p>On the right-hand side is a plot of our yearly global temperature anomalies. Near 1800 the anomalies appear to be below our baseline as the Earth comes out of the Little Ice age. The temperate anomalies move into positive values depicting a warming planet and the anomalies seem to get “tighter” or less variable but indicate accelerating warming.</p><h4>Correlate the Potential Drivers with Global Warming</h4><p>Now that we’ve got a sense of the data: global warming occurring, CO2 concentration rising sharply, and cyclical sunspot activity, let’s see how warming correlates with our potential factors.</p><p>Data visualizations may help so let’s look at some simple scatterplots comparing temperature anomalies and CO2 concentration &amp; sunspot observations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xu66YebSg9eqV1WQRnbD2w.png" /><figcaption><strong>Scatterplots: CO2 vs. Temperature Anomalies &amp; Sunspots vs. Temperature Anomalies</strong></figcaption></figure><p>From the scatterplots, it looks pretty clear that the average yearly global temperature anomalies have some sort of correlation with CO2 concentration over time. The correlation looks fairly weak between the temperature data and sunspot observations.</p><p>The numbers support our visual assessment. The pairwise correlation between temperature anomalies and CO2 concentration is <strong><em>0.8642</em></strong> over the entire time period — indicating a strong positive correlation.</p><p>The correlation between temperature anomalies and sunspot observations is <strong><em>0.0550</em></strong> — a weak relationship.</p><h4>Drawing Conclusions</h4><p>This an extremely simple exercise addressing an exceedingly complex system. But can we draw any conclusions? I think we can. The planet is warming and that phenomenon has brought at least large parts of the planet out of a cooling period commonly known as the Little Ice Age. That warming appears to have accelerated as CO2 concentration has increased.</p><p>The correlation between sunspots and global warming appears very weak. Obviously a more in-depth analysis is needed to understand a deeply complex global system.</p><h4>A Final (Odd?) Note</h4><p>The visualizations have been helpful but looking back at the scatterplot between temperature and CO2 yields an early phase of dispersed scatter points and a later phase of a more linear relationship.</p><p>Breaking up the pairwise correlation into two time periods expresses what we’re seeing. Before 1900, the correlation coefficient is <strong><em>0.2309</em></strong>, a relatively weak correlation. After 1900, the correlation coefficient is strong: <strong><em>0.9242</em></strong>. The question is why would the relationship between temperature and CO2 concentration differ over time. Possible reasons could be due to raw data capture, data processing, and wrangling. Other possible reasons could be the nature of the physical energy absorption process at the molecular level which is not specifically linear. At this point, this will have to remain a potential question for another post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*kXx_pqUdZ0Hl_pzDAbNUKw.png" /><figcaption><strong>CO2 Concentration vs. Global Temperature Anomalies: 1800 to 1899</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*vDOVUM_2Tmz20KUpM4gLlw.png" /><figcaption><strong>CO2 Concentration vs. Global Temperature Anomalies: 1900+</strong></figcaption></figure><p>Thanks for joining me on this milestone in my data science journey. More to come! (Check out my <a href="https://colab.research.google.com/drive/1CAdLxp42kTW5r2dBg-db2dj3NOfMPaQI">Google Colab Notebook</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b047a1f660c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fn Project & Caddy for Fun & Learning]]></title>
            <link>https://medium.com/fnproject/fn-project-caddy-for-fun-learning-17b96b790437?source=rss-871fd6309425------2</link>
            <guid isPermaLink="false">https://medium.com/p/17b96b790437</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[caddy]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[fn-project]]></category>
            <dc:creator><![CDATA[Dan Anderson]]></dc:creator>
            <pubDate>Mon, 25 Mar 2019 14:49:16 GMT</pubDate>
            <atom:updated>2019-03-25T14:49:16.515Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Product Manager who does some weekend hacking, I love finding open source projects and technologies that help demonstrate important concepts in the web services world. As I crawl up the technology learning curve it’s great to take seemingly abstract concepts such as containers and serverless and employ them in simple but illustrative ways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*4dSyoZ3fE-LBegn9E8yvXw.jpeg" /></figure><p>I was an early user of Iron.io for hosted workers and enthusiastically followed co-founders Chad Arimura (<a href="https://twitter.com/chadarimura"><strong>@</strong>chadarimura</a>) and Travis Reeder (<a href="http://twitter.com/treeder">@treeder</a>) as Iron.io gained traction in the marketplace.</p><p>When I heard that Chad and Travis’ focus moved to the <a href="http://fnproject.io/">Fn Project</a>, I jumped at the chance to try it to build a deeper understanding of serverless and FaaS. I deployed the Fn server to a Digital Ocean “<a href="https://www.digitalocean.com/products/droplets/">droplet</a>” and never looked back. I used the <a href="http://fnproject.io/">Fn Project</a> to support prototypes and personal projects so my requirements were rudimentary such as functions for messaging (text, email) and basic file processing.</p><p>One need that surfaced was invoking functions in a more secure manner. Since my deployment was exposed to the web rather than behind an enterprise or cloud firewall, that meant at least making https requests. What was <strong><em>not</em></strong> on my short list of concepts to learn was complex web server configuration and obtaining SSL certificates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*QdwBb5Iy9JBag6DRMBfwUg.png" /></figure><p>Enter Caddy, one of my other favorite open source projects from Matt Holt (@<a href="https://twitter.com/@mholt6">mholt6</a>) and a team of fellow contributors. Caddy (<a href="https://caddyserver.com/">https://caddyserver.com/</a>) is an open source web server and an early player in automatic provisioning of free SSL certificates (Let’s Encrypt certs).</p><p>Caddy is awesome. A simple download for personal use and a few lines in a config file (the “Caddyfile”) and I can set up a simple proxy, automatically provision &amp; install SSL certificates, serve static sites, and route traffic to other web services running on non-public ports. I had found my answer!</p><h3>Use Caddy as a Proxy to the Fn Server</h3><p>Here’s how to get started.</p><p>Get yourself over to <a href="https://caddyserver.com/">https://caddyserver.com</a> and download Caddy. I downloaded the version applicable to my Digital Ocean Linux server. Caddy has a rich ecosystem of plugins to enable things like integrating with DNS providers and standing up a simple file browser. But for our purposes (use https, proxy to the Fn Server) we can just use Caddy right out of the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*lrgstzzXhSI4OSbNM7vFDw.png" /><figcaption>Caddy download page</figcaption></figure><p><strong>DOWNLOAD AND INSTALL CADDY</strong></p><p>On the server running the Fn server, I opted to use the handy shell script suggested on the Caddy site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*IROrHVjrycWrxo4kWTXtWA.png" /></figure><p>CADDY_TELEMETRY=on curl <a href="https://getcaddy.com/">https://getcaddy.com</a> | bash -s personal</p><p>and you’ll get something like this:</p><pre>% Total % Received % Xferd Average Speed Time Time Time Current<br> Dload Upload Total Spent Left Speed<br>100 7380 100 7380 0 0 31271 0 — : — : — — : — : — — : — : — 31271</pre><pre>Downloading Caddy for linux/amd64 (personal license)…<br>Download verification OK<br>Extracting…<br>Backing up /usr/local/bin/caddy to /usr/local/bin/caddy_old<br>(Password may be required.)<br>Putting caddy in /usr/local/bin (may require password)<br>Caddy 0.11.5 (non-commercial use only)<br>Successfully installed</pre><p>After installation, we’ll configure Caddy.</p><p><strong>CREATE A ‘Caddyfile’ CONFIG FILE</strong></p><p>Caddy reads a configuration file called a Caddyfile. I have a personal domain for small projects so I added a subdomain to point to my Digital Ocean instance. Caddy will use this domain to automatically provision a Let’s Encrypt SSL certificate.</p><p>Here’s a Caddyfile that should do the trick.</p><pre>fnmedium.example.com {<br> proxy / localhost:8080<br> header / X-Custom-Header “Courtesy of Caddy”<br>}</pre><p>A few lines of text will actually accomplish my objectives:</p><ul><li>Provision and install an SSL certificate for my subdomain: fnmedium.example.com</li><li>Listen for requests to http://fnmedium.example.com (port 80) and https://fnmedium.example.com (443)</li><li>Proxy those requests to the Fn Server listening on the default Fn port localhost:8080</li><li>Redirect HTTP to HTTPS with an HTTP 301 redirect</li><li>And just for fun let’s use the Caddy header directive to insert a custom header to ensure Caddy is in the mix</li></ul><p><strong>FIRE UP CADDY</strong></p><p>The install script put Caddy in my path. You can start Caddy in the same folder as the Caddyfile or elsewhere specifying the file’s location.</p><p>caddy -conf ~/app/caddy/Caddyfile</p><p>Caddy will start the certificate provisioning and the output will look similar to:</p><pre>Activating privacy features…</pre><pre>Your sites will be served over HTTPS automatically using Let’s Encrypt.<br>By continuing, you agree to the Let’s Encrypt Subscriber Agreement at:<br> <a href="https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf">https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf</a><br>Please enter your email address to signify agreement and to be notified<br>in case of issues. You can leave it blank, but we don’t recommend it.<br> Email address:</pre><pre>...</pre><pre>[INFO] [fnmedium.example.com] acme: Obtaining bundled SAN certificate<br>INFO] [fnmedium.example.com] AuthURL: <a href="https://acme-v02.api.letsencrypt.org/acme/authz/ks3">https://acme-v02.api.letsencrypt.org/acme/authz/ks3</a>...<br>[INFO] [fnmedium.example.com] acme: use tls-alpn-01 solver<br>[INFO] [fnmedium.example.com] acme: Trying to solve TLS-ALPN-01<br>[INFO] [fnmedium.example.com] The server validated our request<br>[INFO] [fnmedium.example.com] acme: Validations succeeded; requesting certificates<br>[INFO] [fnmedium.example.com] Server responded with a certificate.<br>done.</pre><pre>Serving HTTPS on port 443<br>https://fnmedium.example.com</pre><pre>Serving HTTP on port 80<br>https://fnmedium.example.com</pre><p><strong>INVOKE YOUR Fn FUNCTION</strong></p><p>After starting Caddy let’s test out a function.</p><p>I stepped through the <a href="http://fnproject.io/">Fn Project</a> Go <a href="http://fnproject.io/tutorials/Introduction">tutorial</a> and set up a “Hello World” function. With an external function trigger configured, we can now invoke the function via an HTTP call.</p><pre>Dans-Machine:~ dan$ curl — request GET — url https://fnmedium.example.com/t/myapp/hello<br>{“message”:”Hello World”}</pre><p>Here’s output describing what’s going on under the hood:</p><pre>&gt; GET /t/myapp/hello HTTP/1.1<br>&gt; Host: fnmedium.example.com<br>&gt; User-Agent: xxxx<br>&gt; Accept: */*</pre><pre>&lt; HTTP/1.1 200 OK<br>&lt; Content-Length: 26<br>&lt; Content-Type: text/plain; charset=utf-8<br>&lt; Date: Wed, 20 Mar 2019 18:12:51 GMT<br>&lt; Fn-Call-Id: 01D6E4WJVYNG8G00GZJ000000A<br>&lt; Server: Caddy<br>&lt; X-Custom-Header: Courtesy of Caddy</pre><h3>Mission Accomplished</h3><p>And we’re done.</p><p>What I love about both the <a href="http://fnproject.io/">Fn Project</a> and Caddy is that I can deploy, run, and forget. I’ve been executing a core set of functions for years without any hassle or disruption. I’m able to satisfy my core requirements without complex configuration.</p><p>I definitely recommend Fn for serverless function type calls and Caddy for pain-free web server capabilities.</p><p>Dan Anderson is a Product Manager at <a href="http://jdktech.com/">JDK Technologies</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17b96b790437" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fnproject/fn-project-caddy-for-fun-learning-17b96b790437">Fn Project &amp; Caddy for Fun &amp; Learning</a> was originally published in <a href="https://medium.com/fnproject">Fn Project</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>