-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up onboarding time for new users by at least one order of magnitude #350
Comments
Rough storyline that can be used for both a demo (with animations etc.) and a tutorial notebook:
Only thing I maybe don't like about it that's a bit more "business" than "policy". But a lot of people might find business intuitive, so that might also be a strength, especially if we follow up with a policy example. The model behind it could look like this: import random
def simulate_lemonade_stand(weather, day, price, marketing_spend, hours_open, lemon_cost, special_event=False):
"""
Simulates a day at the lemonade stand, considering various factors including time spent and lemon cost.
Parameters:
- weather: 'sunny', 'cloudy', or 'rainy'
- day: 'weekday' or 'weekend'
- price: Price per cup of lemonade
- marketing_spend: Money spent on marketing that day
- hours_open: Hours the lemonade stand is open
- lemon_cost: Cost per lemon (uncertain variable)
- special_event: Boolean indicating if there's a special event nearby
Returns:
- sales: Number of lemonade cups sold
- profit: Net profit for the day
- time_spent: Total time spent operating the stand
"""
# Base demand model
base_demand = 50 if weather == 'sunny' else 30 if weather == 'cloudy' else 10
# Adjust demand for weekend, special events, and hours open
if day == 'weekend':
base_demand *= 1.5
if special_event:
base_demand *= 2
base_demand *= (hours_open / 8) # Assume max demand if open 8 hours
# Influence of marketing spend (logarithmic growth)
marketing_effectiveness = 10 * (1 - 1 / (1 + marketing_spend / 50))
# Adjust demand for price (demand decreases as price increases, but not linearly)
price_sensitivity = 50 - (price - 1) ** 2 if price < 5 else 20 - (price - 5)
price_sensitivity = max(0, price_sensitivity)
# Calculate final demand
final_demand = base_demand + marketing_effectiveness + price_sensitivity
# Calculate sales and profit
sales = int(final_demand)
cost_per_cup = 0.5 + lemon_cost # Adjusted cost to include lemon cost
profit = sales * (price - cost_per_cup) - marketing_spend
# Time spent at the stand
time_spent = hours_open
return sales, profit, time_spent
# Example simulation with uncertain lemon cost
weather = random.choice(['sunny', 'cloudy', 'rainy'])
day = random.choice(['weekday', 'weekend'])
price = round(random.uniform(1, 5), 2)
marketing_spend = random.randint(0, 100)
hours_open = random.randint(4, 8) # Assume the stand can be open between 4 to 8 hours
lemon_cost = round(random.uniform(0.1, 0.5), 2) # Uncertain purchase price of lemons
special_event = random.choice([True, False])
sales, profit, time_spent = simulate_lemonade_stand(weather, day, price, marketing_spend, hours_open, lemon_cost, special_event)
print(f"Weather: {weather}, Day: {day}, Price: ${price}, Marketing Spend: ${marketing_spend}, Hours Open: {hours_open}, Lemon Cost: ${lemon_cost}, Special Event: {special_event}")
print(f"Sales: {sales} cups, Profit: ${profit:.2f}, Time Spent: {time_spent} hours") |
Early start on: https://github.com/quaquel/EMAworkbench/tree/lemon-notebook |
@quaquel I'm going to revive this effort |
Motivation
Currently, it takes many new users a lot of time to:
This is not ideal. Many (potential) users will unnecessarily find it "hard". Some don't see the value directly. Some have difficulty pitching it to their peers, stakeholders or bosses. While the math and fine details maybe are, at least the general ideas and concept don't have to be.
Goal
The goals is to speed up both understanding the value and grasping the concepts by at least an order of magnitude. This means for value and concepts respectively, going down from hours and days respectively to minutes and hours.*
The goals explicitly is not to allow users to learn the full workbench in hours. Just the value it can offer and the main ideas behind it, so it provides motivation to continue on it and a framework from which to start thinking on. See it as a really good introduction (which can be the foundation on which you build further and deeper knowledge).
* of course this is very hard to measure, and that also isn't the goal. An inverse case of Goodhart's Law.
Potential solutions
I have two ideas to enable this:
This could be in the form of a quick demonstation in the Readme (for the value) and a tutorial notebook for the concepts.
The text was updated successfully, but these errors were encountered: