<?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 Granit Zymberi on Medium]]></title>
        <description><![CDATA[Stories by Granit Zymberi on Medium]]></description>
        <link>https://medium.com/@zymberg?source=rss-f9ef62ca3c19------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e9uRipBef4vedA59TPHAkg.png</url>
            <title>Stories by Granit Zymberi on Medium</title>
            <link>https://medium.com/@zymberg?source=rss-f9ef62ca3c19------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:32:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zymberg/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[Beyond Prediction: What Comes After the Forecast]]></title>
            <link>https://zymberg.medium.com/beyond-prediction-what-comes-after-the-forecast-bd163549645f?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd163549645f</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 16:45:23 GMT</pubDate>
            <atom:updated>2026-07-06T16:45:23.257Z</atom:updated>
            <content:encoded><![CDATA[<h3>A framework for turning analytics into action — built with machine learning, driven by business judgment</h3><p>Machine learning has become remarkably good at predicting the future.</p><p>Organizations can estimate customer churn, forecast demand, detect fraud, predict equipment failures, and anticipate countless business outcomes with real accuracy. These capabilities have transformed how organizations spot risk and opportunity.</p><p>But prediction is only half of the decision-making process.</p><p>Knowing what’s <em>likely to happen</em> tells you where to look. Knowing what to <em>do about it</em> is what actually changes the outcome.</p><p>That’s the gap between prediction and decision intelligence. It sounds like a subtle distinction. It isn’t — it changes how a machine learning system should be designed from the ground up.</p><p>Most predictive models stop at a probability. But businesses don’t act on probabilities alone. They act on trade-offs: which customer to call first, which account gets the incentive budget, which asset gets the maintenance slot this week.</p><p>Organizations aren’t rewarded for accurate forecasts. They’re rewarded for better decisions.</p><p>That distinction is the starting point for the recommendation framework described below — a system built to estimate which business actions are most likely to actually <em>improve</em> an outcome, not just predict it. The implementation addressed one specific commercial setting, but the approach generalizes to any environment where an organization repeatedly chooses between a small set of actions and observes what happens next.</p><h3>The real problem isn’t prediction</h3><p>Say a churn model tells you a customer has an 82% chance of leaving in the next six months.</p><p>That’s a strong prediction. It’s also, on its own, useless for deciding what to do.</p><p>Do you call them? Offer a discount? Assign a success manager? Do nothing, and save the budget for someone more save-able?</p><p>The prediction identifies the problem. It doesn’t identify the solution. And the same gap shows up everywhere:</p><ul><li>Marketing flags customers likely to disengage</li><li>Operations flags assets likely to fail</li><li>Healthcare flags high-risk patients</li><li>Lenders flag likely defaults</li></ul><p>Every one of these predictions raises the same next question: <em>which intervention gives the best shot at changing the outcome?</em></p><p>Answering that requires moving from prediction into causal decision support.</p><h3>Why historical data lies to you</h3><p>The obvious move is to look at historical actions and see which ones led to the best outcomes.</p><p>This doesn’t work — because organizations don’t assign actions randomly. People assign them with judgment.</p><p>Struggling accounts get more attention. High-value customers get more engagement. Assets already showing wear get preventive maintenance first.</p><p>That means historical action data is really a record of <em>human judgment about who needs help</em>, tangled up with <em>the effect of the help itself</em>.</p><p>Train a model naively on this data, and it will often learn something backwards: that intervention correlates with worse outcomes — not because interventions cause harm, but because they were disproportionately aimed at already-struggling cases.</p><p>The model ends up describing organizational behavior, not intervention effectiveness. Untangling those two things was the central design problem.</p><h3>Reframing the question</h3><p>Instead of asking:</p><blockquote><strong><em>“Which action usually happened here?”</em></strong></blockquote><p>The question became:</p><blockquote><strong><em>“Which action is expected to produce the biggest improvement for this specific situation, right now?”</em></strong></blockquote><p>That reframing shifts the objective from <em>describing history</em> to <em>estimating incremental value</em>: the difference in expected outcome between taking an action and not taking it, for the same case.</p><h3>The framework</h3><p>Rather than a single model, the system is a pipeline of purpose-built stages, each answering a different question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5szbdc5joNiYr4R9OoBH6Q.png" /></figure><h3>1. Business context, not static profiles</h3><p>Every recommendation starts from a description of <em>where the entity is right now</em> .</p><p>Static attributes are replaced with rolling feature windows built from the recent history preceding each decision point, capturing things like:</p><ul><li>recent performance level and its trend</li><li>volatility in that performance</li><li>engagement and interaction recency</li><li>breadth of products, services, or categories already active</li><li>prior interventions already received</li></ul><p>The point isn’t to describe the account but to describe its trajectory. Recommendations should respond to changing conditions, not a fixed profile.</p><h3>2. Learning how decisions have actually been made</h3><p>Before effectiveness can be estimated, the system needs an honest model of existing behavior.</p><p>For each possible action, a <strong>propensity model</strong> — in practice, logistic regression — estimates the probability that action would have been chosen given the context at the time.</p><p>This step is as diagnostic as it is predictive. The propensity model’s own accuracy tells you how much selection bias exists in the first place. A score near random guessing means the action was assigned close to randomly — little bias to correct. A high score means decision-makers were following strong, consistent patterns, even if no one ever wrote them down.</p><p>In practice, experienced teams tend to have built a remarkably consistent implicit playbook over years of judgment calls. The propensity model just makes that playbook visible.</p><h3>3. Correcting for the bias</h3><p>Understanding historical behavior is a means to an end, not the goal — reproducing it would just automate the existing bias.</p><p>To correct for it, each historical observation is reweighted using <strong>Inverse Probability Weighting (IPW)</strong>. Observations are weighted by the inverse of how likely their assigned action was, given the context:</p><ul><li>Actions taken in unusual, low-probability situations get <strong>more weight</strong> — they’re more informative about what would happen elsewhere.</li><li>Expected, predictable action-context pairs get <strong>less weight</strong> — they add little new evidence.</li></ul><p>Weights are also clipped at the extremes, so a small number of rare cases can’t dominate the model.</p><p>This reweighting rebalances the treated and untreated populations, so the remaining outcome difference reflects the action’s effect — not who tends to receive it.</p><h3>4. Estimating outcomes, one action at a time</h3><p>With bias correction in place, a separate outcome model is trained per action, per goal, using a <strong>T-learner</strong> structure: the model is trained on both treated and untreated cases (weighted by IPW), then queried twice for every entity — once as if the action were taken, once as if it weren’t.</p><p>Gradient-boosted trees (XGBoost) were used here, chosen for their consistent performance on structured, tabular business data and their ability to capture nonlinear interactions between features.</p><p>Outcomes are modeled separately rather than collapsed into a single target, because organizations rarely optimize one number. A realistic system tracks several goals in parallel — for example, adoption of a new product category, short-term revenue growth, and long-term account tier movement — each with its own model and its own weight in the final recommendation.</p><h3>5. Turning predictions into recommendations</h3><p>For every available action, the system compares two counterfactual probabilities:</p><ul><li>the estimated chance of success <strong>with</strong> the action</li><li>the estimated chance of success <strong>without</strong> it</li></ul><p>The gap between them is the action’s expected uplift for that specific case.</p><p>This is what makes the output personalized rather than a historical average. Two accounts that look nearly identical on the surface can receive different recommendations, because the expected value of each action differs for their specific trajectory. Uplifts across goals are then combined into one weighted score — an overall recommended action, with the per-goal breakdown alongside it so a user can see <em>why</em>.</p><h3>Business value beyond accuracy</h3><p>One of the clearest lessons from building this: adoption depends far less on model accuracy than most technical teams assume.</p><p>Nobody adopts a recommendation engine because it improved an AUC by two points. They adopt it because they trust the decision it’s pointing them toward.</p><p>That’s why explainability was treated as a first-class requirement, not an afterthought. Every recommendation ships with supporting context:</p><ul><li>the estimated uplift per goal</li><li>diagnostics showing how much bias was corrected for that action</li><li>a count of how many comparable historical cases informed the estimate</li></ul><p>That last piece matters more than it sounds. A recommendation backed by thousands of similar historical situations is a very different claim than one backed by a dozen — and users should be able to tell the difference at a glance.</p><p>Framed this way, the system’s outputs stop looking like model scores and start looking like something a manager can actually act on and defend.</p><h3>A framework, not a one-off solution</h3><p>The implementation described here was built for one commercial context. But the underlying pattern generalizes:</p><ol><li>Learn how decisions have historically been made</li><li>Correct for the bias that behavior introduces</li><li>Estimate the incremental effect of each option for the specific case at hand</li></ol><p>That pattern applies anywhere an organization repeatedly asks: <em>given what we know today, what should we do next?</em></p><p>That includes prioritizing outreach, allocating limited budget across accounts, scheduling preventive maintenance, recommending clinical interventions, and choosing where to direct investigative or audit resources. The specific actions and outcomes change. The analytical shape of the problem — selection bias, counterfactual estimation, multi-goal trade-offs — stays the same.</p><h3>Final thoughts</h3><p>Predictive analytics has spent years getting better at forecasting. That work has real value.</p><p>But a forecast, by itself, rarely changes an outcome — people acting on it do.</p><p>Machine learning becomes materially more useful once it moves from <em>“here’s what’s likely to happen”</em> to <em>“here’s the action most likely to change what happens, and here’s why we believe that.”</em></p><p>Prediction tells you where to look. Decision intelligence tells you where to act.</p><p>That shift — from forecasting outcomes to influencing them — is arguably one of the highest-leverage things applied machine learning can do inside an organization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd163549645f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Behavioral Engagement Is the Metric That Actually Predicts Retention]]></title>
            <link>https://medium.com/sdg-group/why-behavioral-engagement-is-the-metric-that-actually-predicts-retention-df18de117909?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/df18de117909</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 15:33:22 GMT</pubDate>
            <atom:updated>2026-03-10T15:33:22.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tsMHMvJLR9CKzpDpc5wlPw.png" /></figure><h3>Your Biggest Customers Might Not Be Your Best Ones</h3><p>Most companies rank their customers by revenue. It’s the obvious thing to do. Sales protects the big spenders. Leadership celebrates them. Retention efforts focus on keeping them happy.</p><p>But after working on a loyalty program analytics project involving over 1,200 enrolled accounts, I’ve come to believe this is one of the most common — and quietly costly — mistakes in customer strategy.</p><p>Revenue tells you what happened. It doesn’t tell you whether it will happen again.</p><h3>The Problem With Revenue as a Proxy for Loyalty</h3><p>Here’s a scenario that plays out constantly in B2B businesses:</p><p>Account A spent $180,000 last year. One large order in Q1, then silence.</p><p>Account B spent $42,000 last year. Buying every single month, expanding into new product categories, with three team members actively using your platform.</p><p>Every revenue report will tell you Account A is the more valuable customer. But which one is actually more loyal? Which one is more likely to be there in three years? Which one is quietly building a dependency on your product that makes switching painful?</p><p>The answer is obvious once you frame it this way. The problem is that most analytics infrastructure isn’t built to frame it this way.</p><h3>Rethinking What “Valuable” Means</h3><p>The project I worked on involved a company running a preferred-supplier loyalty program. Enrolled accounts committed to sourcing certain categories through the program in exchange for better pricing and service terms. On paper, the program had strong revenue numbers and healthy enrollment counts.</p><p>But the team had a nagging question they couldn’t answer: <em>which accounts are actually behaving like partners, and which ones are just enrolled?</em></p><p>The revenue data couldn’t answer it. So we had to build something that could.</p><p>The framework we landed on shifted the definition of value from <em>how much they spend</em> to <em>how they spend it</em>. Three dimensions drove the model:</p><p><strong>Consistency over volume.</strong> A customer buying monthly is more valuable than one buying annually at the same total spend. Consistent purchase behavior is a signal of operational dependency — your product is embedded in their workflow, not just occasionally useful.</p><p><strong>Depth over breadth.</strong> An account enrolled in six product categories and actively buying across all of them is more committed than one enrolled in six but only ever buying from one. Category depth measures how embedded the program is in how they actually run their business.</p><p><strong>Integration over transactions.</strong> Are key people at the account actually using your platform? Is the relationship institutionalized, or is it dependent on a single contact? Accounts where multiple team members are active users are structurally stickier than accounts where one person places all the orders.</p><p>None of these dimensions show up in a standard revenue report. They require deliberately measuring behavior, not just spend.</p><h3>What Segmenting by Tenure Changed</h3><p>One of the most important strategic decisions in the project was to stop benchmarking all customers against each other, and instead benchmark them against accounts at a similar stage of the relationship.</p><p>A first-year account that’s buying consistently and expanding into new categories is doing remarkably well. Judged against a five-year account with a long established history, they look modest. Judged against other first-year accounts, they look like a future Band A partner.</p><p>The segmentation — new accounts, early-growth accounts, maturing accounts, established accounts — completely changed the strategic conversations downstream. Instead of one monolithic customer list sorted by revenue, you get four distinct populations with four distinct playbooks:</p><ul><li><strong>New accounts</strong> need habit formation support. The goal is consistency, not volume.</li><li><strong>Early-growth accounts</strong> need category expansion conversations. They’ve shown they’ll buy — the question is whether they’ll go deeper.</li><li><strong>Maturing accounts</strong> are where you look for trend signals. Are they growing with you year over year, or plateauing?</li><li><strong>Established accounts</strong> are your base. The work here is protecting the relationship and looking for signs of quiet erosion before they become visible in the revenue numbers.</li></ul><h3>What the Data Actually Showed</h3><p>Once the scoring model ran across the full account base, the headline finding was exactly what we suspected: revenue ranking and engagement ranking told very different stories.</p><p>Some of the highest-revenue accounts were mid-tier on engagement — large but inconsistent, enrolled but not embedded. Some of the most behaviorally engaged accounts were modest in spend, but buying every month, expanding categories, with full team integration.</p><p>The distribution of engagement scores across tenure groups looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mqbh-ppWt0xl5PsZXk9KQ.png" /></figure><p>A few things worth noting:</p><p>New accounts have the highest at-risk rate — not because they’re bad customers, but because they haven’t yet built the behavioral patterns that make an account resilient. This is where proactive onboarding investment pays the biggest dividends.</p><p>Established accounts have the highest average scores, but not by as much as you’d expect. Longevity doesn’t automatically equal loyalty. Some long-tenured accounts were coasting — enrolled for years, buying on autopilot, but not deepening. These are the accounts most at risk of a quiet exit when a competitor shows up with a better offer.</p><p>The C/D accounts across all groups — roughly 22–37% depending on tenure — represent a concrete, prioritizable at-risk population. Before this framework, that population was invisible. It was buried inside revenue totals that looked fine.</p><h3>The Strategic Value of Naming the Problem</h3><p>Here’s what I find most interesting about this kind of project: the model itself is almost secondary to what it forces the organization to do.</p><p>Building an engagement score requires a team to explicitly define what “good” looks like behaviorally. That conversation — what does a healthy customer actually do? — surfaces assumptions and disagreements that have been sitting unexamined for years. Sales has one answer. Customer success has another. Leadership has a third.</p><p>The process of building the framework creates alignment around a shared definition of customer health. That shared definition then changes how people talk about accounts, how they prioritize their time, and what they ask for in QBRs and renewal conversations.</p><p>The score is a tool. The reframe is the value.</p><h3>The Bigger Shift</h3><p>Loyalty programs, subscription businesses, and any B2B model with ongoing relationships all share the same fundamental challenge: the revenue signal is delayed. By the time an account’s revenue starts declining, the behavioral deterioration usually started six to twelve months earlier.</p><p>Engagement scoring, even a simple version of it, moves the measurement upstream. It gives you a chance to intervene before the revenue signal fires.</p><p>That’s the strategic case for building this kind of infrastructure. Not because it produces a better dashboard, but because it gives the business a fundamentally earlier warning system for customer health.</p><p>Revenue is the scoreboard. Behavior is the game.</p><p>If you’re only watching the scoreboard, you’re always reacting. The teams that win are the ones watching the game.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df18de117909" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sdg-group/why-behavioral-engagement-is-the-metric-that-actually-predicts-retention-df18de117909">Why Behavioral Engagement Is the Metric That Actually Predicts Retention</a> was originally published in <a href="https://medium.com/sdg-group">SDG Group</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decision Science — The Missing Link Between Insight and Execution]]></title>
            <link>https://medium.com/sdg-group/decision-science-the-missing-link-between-insight-and-execution-486e92ec7059?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/486e92ec7059</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 15:22:41 GMT</pubDate>
            <atom:updated>2026-02-01T15:22:41.988Z</atom:updated>
            <content:encoded><![CDATA[<h3>Decision Science — The Missing Link Between Insight and Execution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmrXRIFvU8Q0JS6PHbsvIw.png" /></figure><p>For a long time, progress in analytics was measured by technical capability. Better models, more data, faster pipelines. And to be fair, that progress has been real. Today, many teams can build things that would have been impossible just a few years ago.</p><p>Yet despite all of this advancement, a familiar frustration keeps showing up across organizations: analytics work that is technically solid but quietly ignored. Models are delivered, dashboards are shared, and insights are presented, yet decisions remain unchanged.</p><p>What’s happening isn’t a failure of data science. It’s a sign that analytics itself is evolving.</p><h3>The bottleneck has moved</h3><p>That’s no longer the case for many organizations.</p><p>Today, the bottleneck is rarely technical. It’s human and organizational. Teams struggle not with <em>how</em> to build models, but with questions like:</p><ul><li>Who actually owns this decision?</li><li>What is expected to change because of this analysis?</li><li>How much uncertainty is acceptable?</li><li>What trade-offs matter in practice?</li></ul><p>As analytics capabilities increase, these questions become harder to ignore and more uncomfortable to answer.</p><h3>Why insights alone aren’t enough anymore</h3><p>Traditional analytics often stops at insight. A trend is identified. A pattern is explained. A forecast is produced. From a technical standpoint, the work is done.</p><p>But from a business standpoint, insight is only useful if it reduces the effort required to decide and act.</p><p>When analytics delivers information without clarifying action, the burden shifts back to the user. They must interpret probabilities, reconcile conflicting signals, and decide how much confidence is enough. Over time, this leads to disengagement, not because the work is wrong, but because it’s hard to use under real constraints.</p><p>This is why many organizations are rethinking what they expect from analytics. The question is shifting from <em>“What does the data say?”</em> to <em>“What should we do differently?”</em></p><h3>What decision science emphasizes</h3><p>Decision science isn’t a new discipline, but it reflects a growing emphasis on outcome-oriented analytics.</p><p>At its core, it treats decisions, not models, as the primary unit of value. That changes how work is approached. Success is no longer defined by model performance alone, but by whether a decision becomes clearer, faster, or more consistent.</p><p>This often means:</p><ul><li>Making assumptions explicit instead of burying them in models</li><li>Choosing simplicity when complexity doesn’t meaningfully improve outcomes</li><li>Designing outputs around how decisions are actually made, not how data is structured</li><li>Accepting that judgment and trade-offs are unavoidable</li></ul><p>In this framing, machine learning becomes one tool among many — powerful, but not always necessary.</p><h3>The impact on analytics roles</h3><p>As this shift happens, the role of analytics professionals is changing as well.</p><p>Technical depth still matters, but it’s no longer sufficient on its own. Increasingly, value comes from the ability to frame the right questions, understand business constraints, and decide when precision adds value and when it doesn’t.</p><p>This often requires stepping into ambiguity earlier in the process. It means pushing for clarity around ownership and outcomes before jumping into implementation. And it means being comfortable with the fact that the “right” answer is sometimes a decision framework rather than a model.</p><p>These skills are less visible than code or dashboards, but they tend to be what separates analytics work that gets used from work that quietly fades away.</p><h3>Why this matters now</h3><p>As analytics tools become more accessible and automated, technical differentiation will continue to compress. What won’t be automated as easily is judgment: understanding context, incentives, risk, and human behavior.</p><p>Organizations that recognize this are already adjusting how they structure analytics teams and what they expect from them. The most effective teams are those that treat analytics as part of the decision-making process, not a separate reporting function.</p><h3>Looking ahead</h3><p>Analytics isn’t moving away from data science. It’s building on it. The shift toward decision science reflects a broader realization: the hardest part of analytics isn’t computation — it’s alignment.</p><p>As the field continues to evolve, impact will increasingly come from those who can connect data to decisions, and decisions to action. Not by producing more information, but by helping people make better choices under uncertainty.</p><p>That’s where analytics is heading — and where it creates the most value.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=486e92ec7059" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sdg-group/decision-science-the-missing-link-between-insight-and-execution-486e92ec7059">Decision Science — The Missing Link Between Insight and Execution</a> was originally published in <a href="https://medium.com/sdg-group">SDG Group</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building AI Backward: From Decisions to Data]]></title>
            <link>https://medium.com/sdg-group/building-ai-backward-from-decisions-to-data-c8058af0be10?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8058af0be10</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 14:11:42 GMT</pubDate>
            <atom:updated>2025-12-15T14:11:42.408Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgoQuoSI1eM2Qgz0KWy0wA.jpeg" /></figure><p>A colleague of mine said something recently that stuck with me:</p><blockquote>“At SDG we build solutions backward. We start from the result and then work our way back.”</blockquote><p>At first glance, it sounds simple. Almost obvious. But in practice, it’s the opposite of how most AI projects are built — and it explains why so many of them fail.</p><h3>The Forward Way of Building AI</h3><p>Most AI projects move forward in a straight line:</p><ol><li>Look at the data that exists</li><li>Train a model</li><li>Optimize a metric</li><li>Build a dashboard</li><li>Hand it off</li></ol><p>Technically, nothing is wrong with this flow. Operationally, it produces systems that rarely change behavior.</p><p>The model may be accurate.<br>The pipeline may be robust.<br>The dashboard may look impressive.</p><p>And yet — nothing happens.</p><h3>Starting From Results Changes Everything</h3><p>Building backward means starting with a different question:</p><p><strong>What outcome are we trying to produce?</strong></p><p>Not:</p><ul><li>“What can we predict?”</li><li>“What model should we use?”</li><li>“What data do we have?”</li></ul><p>But:</p><ul><li>What decision should change?</li><li>Who is making that decision?</li><li>What does “better” look like in practice?</li><li>What happens if we’re wrong?</li></ul><p>Only after those are answered does the data — and eventually the model — matter.</p><h3>Predictions Without Decisions Are Dead Ends</h3><p>“Predict churn.”<br> “Score opportunities.”<br> “Forecast demand.”</p><p>These sound useful, but they’re incomplete.</p><p>A prediction only has value when:</p><ul><li>Someone owns the decision it informs</li><li>The timing is clear</li><li>The trade-offs are explicit</li><li>The action is unambiguous</li></ul><p>Without that, the output becomes informational instead of operational. It may be interesting, but it’s not impactful.</p><p>This is where many AI projects quietly stall — not because the model failed, but because the decision was never designed.</p><h3>Why Accuracy Is the Wrong North Star</h3><p>Accuracy feels safe. It’s measurable, familiar, and easy to communicate.</p><p>It’s also often the wrong goal.</p><p>In real systems:</p><ul><li>False positives and false negatives are not equally costly</li><li>Prioritization matters more than classification</li><li>Confidence bands matter more than point estimates</li></ul><p>Optimizing accuracy without understanding the decision context is like tuning a system without knowing what it’s optimizing for. The math improves. The outcome doesn’t.</p><h3>Data Isn’t “Given” — It’s Chosen</h3><p>When teams ask, <em>“What data do we have?”</em> they’re already constraining the solution.</p><p>Backward-built systems ask:</p><blockquote>What information would someone need to confidently act?</blockquote><p>Historical data reflects past incentives, constraints, and behaviors. If those don’t align with the decision you’re trying to improve, the model will faithfully scale the wrong signal.</p><p>More data doesn’t fix that. Better framing does.</p><h3>Dashboards Are Not Decisions</h3><p>Dashboards are a common endpoint for AI projects, but they stop short of changing behavior. They inform, but they don’t direct.</p><p>When users are left to interpret probabilities, compare charts, and translate insights into actions, the system hasn’t reduced complexity — it has shifted it onto the user.</p><p>AI systems that actually drive decisions tend to:</p><ul><li>Rank options instead of displaying raw scores</li><li>Recommend actions rather than surface insights</li><li>Prioritize what matters now, given constraints</li><li>Constrain choices to make action easier</li></ul><p>This is often where teams struggle in practice. Building systems like this requires early alignment across roles — product, analytics, engineering, and the owner of the decision. When that alignment doesn’t happen, models are built in isolation and decisions remain implicit. The result is a system that works technically, but lacks clear ownership, agreed-upon actions, and a shared definition of success.</p><h3>What “Building Backward” Looks Like in Practice</h3><p>AI systems that actually get used tend to share a few traits:</p><ul><li>The decision is defined first (who acts, when, and what changes)</li><li>Metrics reflect real-world trade-offs, not just model accuracy</li><li>Outputs are designed for action (rankings, recommendations, constraints)</li><li>Simplicity is favored over theoretical optimality</li></ul><p>When you build this way, the final model is often simpler — not because the problem is easy, but because the decision it supports is finally well-defined.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8058af0be10" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sdg-group/building-ai-backward-from-decisions-to-data-c8058af0be10">Building AI Backward: From Decisions to Data</a> was originally published in <a href="https://medium.com/sdg-group">SDG Group</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Data to Intelligence: Building an AI-Powered Sales Forecasting System]]></title>
            <link>https://medium.com/sdg-group/from-data-to-intelligence-building-an-ai-powered-sales-forecasting-system-92b94a855f71?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/92b94a855f71</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[mls]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Sat, 11 Oct 2025 01:04:17 GMT</pubDate>
            <atom:updated>2025-10-11T01:09:07.760Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBjH2DZ_xXevl1amX-x94g.jpeg" /></figure><p>In many large organizations, sales and territory teams have access to massive amounts of data — yet lack <strong>decision-ready intelligence</strong>. Reports summarize what happened, but rarely reveal <em>why</em> results differ or <em>where</em> the next opportunity lies.</p><p>Over the past few months, our team has been <strong>building a machine learning–driven intelligence system</strong> designed to close that gap — combining <strong>predictive modeling</strong>, <strong>unsupervised learning</strong>, and <strong>data engineering</strong> to help our client understand customer behavior, estimate sales potential, and prioritize action at scale.</p><p>Our goal is simple: to create a predictive analytics and clustering framework that doesn’t just describe the past, but <strong>infers what’s next</strong> — delivering explainable, operationally relevant insights that guide real business decisions.</p><h4>Understanding the Challenge</h4><p>The client operates across multiple markets and product categories, managing thousands of accounts with diverse purchasing behaviors. Traditional dashboards can aggregate sales data but fail to capture the <strong>dynamics of client behavior</strong> — when a customer shifts from active to dormant, or which factors signal potential churn or growth.</p><h4>Designing the Solution</h4><p>We are designing a learning system that reasons across incomplete data, detects behavioral patterns, and delivers <strong>interpretable machine learning outputs</strong> that scale across territories and product lines.</p><p>Instead of relying on a single monolithic model, our approach is built around a <strong>modular ML architecture</strong> — a collection of interconnected components, each designed to solve a focused analytical task.</p><h4>1. Predictive Behavior Modeling</h4><p>We are building time-based simulation models that represent <strong>client lifecycle states</strong> — <em>active, inactive, recovering,</em> or <em>newly engaged</em>.<br> These models leverage engineered temporal features such as purchase frequency, recency, and inter-purchase intervals to estimate short-term sales probability and reactivation potential.</p><p>Our emphasis is on <strong>interpretability and business alignment</strong>: models that mirror real operational behavior, not just optimize for accuracy.<br> Each iteration is evaluated on both predictive performance and how well it replicates the natural rhythm of customer engagement.</p><h4>2. Clustering for Opportunity Discovery</h4><p>In parallel, we are using <strong>unsupervised learning (KMeans)</strong> to uncover structural patterns in account behavior. By encoding multi-dimensional features such as purchasing cadence, category diversity, and order variability, we identify <strong>behaviorally consistent clusters</strong> within the client base.</p><p>These clusters enable <strong>peer-based benchmarking</strong> — if two accounts share similar behavioral profiles but differ in performance, the model flags the lagging one as a growth opportunity.<br>This framework transforms sales intelligence from isolated metrics to <strong>segment-level opportunity discovery</strong>, revealing signals that traditional reporting can’t surface.</p><h4>Building the Foundation: Scalable MLOps and Data Architecture</h4><p>Underpinning the analytical layer is a <strong>production-grade MLOps framework</strong> built for scalability, reproducibility, and continuous improvement:</p><ul><li><strong>Python (pandas, scikit-learn, NumPy)</strong> for data transformation, feature engineering, and model computation</li><li><strong>Airflow</strong> to orchestrate ingestion, retraining, and inference DAGs with full observability</li><li><strong>MLflow</strong> for experiment tracking, model versioning, and lifecycle governance</li><li><strong>Docker</strong> for environment isolation and reproducible deployments</li><li><strong>Snowflake</strong> for storage, scoring outputs, and real-time BI integration through Duomo dashboards</li></ul><p>This foundation automates ingestion, scoring, and reporting — converting raw transactional data into <strong>continuously updated predictive intelligence</strong> that refreshes with every new cycle.</p><h4>Translating Data into Actionable Insight</h4><p>The strength of this solution lies not only in its models, but in how <strong>machine learning insights translate directly into business decisions</strong>.</p><p>The clustering module offers <strong>contextual segmentation</strong> — showing which accounts share behavioral traits and what differentiates top-performing clusters. The predictive models complement it by estimating <strong>future activity and reactivation probability</strong>, highlighting where sales teams should act first. Together, they form an <strong>inference layer</strong> between analytics and execution — guiding commercial strategy with interpretable, data-driven intelligence.</p><h4>From Impact to Intelligence</h4><p>As we continue to deploy and refine this system, the client gains:</p><ul><li><strong>Dynamic forecasts</strong> of customer activity and growth potential</li><li><strong>Cluster-level insights</strong> revealing peer-based opportunities</li><li><strong>Automated dashboards</strong> that evolve in real time across markets</li></ul><p>What was once static reporting is becoming a <strong>living intelligence system</strong> — one that learns from data, adapts with behavior, and guides action continuously.</p><p>This project embodies <strong>modern applied machine learning</strong>: integrated, explainable, and operational. By combining <strong>MLOps discipline</strong> with analytical modeling, we’re turning predictive systems into sustainable business assets — enabling smarter, faster, and more confident decisions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92b94a855f71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sdg-group/from-data-to-intelligence-building-an-ai-powered-sales-forecasting-system-92b94a855f71">From Data to Intelligence: Building an AI-Powered Sales Forecasting System</a> was originally published in <a href="https://medium.com/sdg-group">SDG Group</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating Airflow DAG Deployment through Automated Terraform Orchestration]]></title>
            <link>https://zymberg.medium.com/accelerating-airflow-dag-deployment-through-automated-terraform-orchestration-cf9c5fed3c4c?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf9c5fed3c4c</guid>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Thu, 25 Apr 2024 18:15:24 GMT</pubDate>
            <atom:updated>2024-04-25T19:04:44.181Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s data-driven world, orchestrating workflows efficiently is crucial. Apache Airflow, a popular workflow automation tool, simplifies this process by allowing users to define, schedule, and monitor workflows as Directed Acyclic Graphs (DAGs). However, deploying custom DAGs across environments can be complex and error-prone, often involving manual steps and environment-specific configurations.</p><p>To streamline this process, I’ve developed a solution that leverages Terraform, an infrastructure as a code tool, to automate the deployment of custom Airflow DAGs. This project aims to simplify the deployment process, reduce errors, and ensure consistency across environments.</p><h4>Overview</h4><p>The project comprises a Terraform configuration that automates the creation of local files from provided DAG templates and triggers Airflow DAG refresh to seamlessly integrate the new DAGs. By abstracting manual steps and providing a standardized deployment approach, this solution enhances deployment efficiency and reduces the risk of errors.</p><h3>How to Use</h3><ol><li><strong>Clone the GitHub Repository:</strong></li></ol><p>Clone the repository to your local machine using the following command:</p><pre>git clone https://github.com/Zymberg/terraform-atomization</pre><p><strong>2. Install Dependencies</strong>:</p><ul><li>If you don’t have Airflow and Terraform installed, follow the instructions provided in the README file of the repository.</li></ul><p><strong>3. Navigate to Airflow Directory:</strong></p><p>Inside the cloned repository, navigate to the airflow directory. You&#39;ll find two folders:</p><ul><li>dags: New DAGs will be placed here after they are created.</li><li>template_dags: Contains template DAGs (welcome_dag.py and goodbye_dag.py).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*I8RhcPE9Fi-AogxrkY_qpw.png" /></figure><p><strong>4. Update Variables:</strong></p><p>Open the terraform/variable.tfvars file and add the following variables:</p><ul><li>new dags file names, new dag ids, template dags file names.</li><li>For testing purposes we’ve added the dags below:</li></ul><pre>dag_filenames  = [<br>    &quot;welcome_john_dag.py&quot;,<br>    &quot;goodbye_john_dag.py&quot;<br>]<br><br>dag_ids  = [ <br>    &quot;welcome_john&quot;,<br>    &quot;goodbye_john&quot;<br>]<br><br>template_filenames = [ <br>    &quot;welcome_dag&quot;,<br>    &quot;goodbye_dag&quot;<br>]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9fsDs3h2I2wcYZl1FuNNw.png" /></figure><p><strong>5. Build Docker Image:</strong></p><p>In your terminal, navigate to the project directory and build the Docker image using:</p><pre>docker build -t my-airflow .d</pre><p><strong>6. Run Docker Compose:</strong></p><p>Start the Airflow container by running Docker Compose:</p><pre>docker-compose up -d</pre><p><strong>7. Initialize Terraform:</strong></p><p>Navigate to the terraform directory and initialize Terraform:</p><pre>terraform init</pre><p><strong>8. Deploy DAGs:</strong></p><p>Apply the Terraform configuration to create and deploy the new DAGs:</p><pre>terraform apply -var-file=&quot;variable.tfvars&quot;</pre><p><strong>9. Approve Deployment:</strong></p><p>When prompted, enter yes to approve the deployment:</p><ul><li><em>Do you want to perform these actions? Terraform will perform the actions described above. Only ‘yes’ will be accepted to approve. Enter a value: yes and press enter.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAc8xph0BTpZyjBBDPaQvg.png" /></figure><p><strong>10. Verify Deployment:</strong></p><p>Once the deployment is complete, you’ll find the new DAGs in the dags directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*kotE_kUnEDP-mQNWFLPfYw.png" /></figure><p>Additionally, navigate to Airflow (localhost:8080) to view the DAGs in the web UI. <em>Note that it may take a few minutes for the DAGs to appear.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Lh_KJkeT2zI0DklvfhYRw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf9c5fed3c4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberGrants - Setting the stage for a powerful social impact]]></title>
            <link>https://zymberg.medium.com/cybergrants-setting-the-stage-for-a-powerful-social-impact-293d05c8671a?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/293d05c8671a</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Thu, 25 May 2023 19:56:20 GMT</pubDate>
            <atom:updated>2023-05-25T19:56:20.046Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of corporate social responsibility, a revolution is underway, fueled by the remarkable force of employee volunteerism. This movement serves as a testament to the unwavering commitment of businesses to shape a better world, transcending profit-driven motives. Today, we venture into the realm of extraordinary success stories, where organizations like Bank of America, Wells Fargo, Citi, Pfizer, and others have harnessed the power of employee volunteerism to drive unparalleled social impact. Within this landscape of change, <a href="https://impact.cybergrants.com/">CyberGrants</a>, a cutting-edge technology platform, has emerged as a catalyst, propelling these programs to new heights and forging an unstoppable alliance in the pursuit of a brighter future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_XSCB85PaTBowmWoE1Oaog.png" /></figure><p>The stage is set, and organizations across diverse industries have taken center stage, dazzling the world with their awe-inspiring employee volunteerism initiatives. A league of visionary organizations have orchestrated symphonies of change, channeling the talents, passion, and dedication of their employees towards vital causes. Through their robust volunteerism programs, these organizations have achieved monumental successes, transforming communities through affordable housing, financial education, childhood hunger eradication, and vibrant community development.</p><p>Yet, their thirst for impact and their desire to make a lasting difference knows no bounds. Enter CyberGrants, the mighty technological powerhouse that strides alongside these organizations, complementing their efforts with unprecedented capabilities. CyberGrants is the beacon of hope that illuminates the path towards revolutionizing employee volunteerism, harnessing the prowess of technology to elevate these programs to unprecedented heights.</p><p>Through CyberGrants, organizations unlock a treasure trove of cutting-edge tech solutions that amplify the impact of employee volunteerism. With effortless grace, the platform streamlines program management, empowering organizations to efficiently orchestrate volunteer opportunities, track employee engagement, and capture invaluable data. Powered by intuitive reporting capabilities and customizable campaign features, CyberGrants not only equips organizations with the tools to measure the true magnitude of their impact but also unveils the story of transformation to the world.</p><p>Together, organizations and CyberGrants transcend conventional boundaries, weaving a tapestry of change that captivates hearts and alters destinies. As technology merges seamlessly with compassion, employee engagement soars to new heights, and a culture of social responsibility permeates every aspect of organizational DNA. With CyberGrants as their steadfast ally, organizations shed the shackles of administrative burden, freeing themselves to focus on the pursuit of lasting change through employee volunteerism.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=293d05c8671a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tech for Good: Unleashing the Power of Technology for Social Impact]]></title>
            <link>https://zymberg.medium.com/tech-for-good-unleashing-the-power-of-technology-for-social-impact-4adcf1a4a178?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/4adcf1a4a178</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Wed, 17 May 2023 16:41:30 GMT</pubDate>
            <atom:updated>2023-05-17T16:41:30.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eIXdmpxKREskRuCe0vs3Kg.png" /></figure><p>In today’s rapidly evolving world, technology has become an integral part of our daily lives. From the ubiquitous presence of smartphones to the growing capabilities of artificial intelligence, technological advancements continue to shape our societies and propel us towards a more interconnected future. However, beyond its role in entertainment and convenience, technology holds immense potential to drive positive social change. By forging a connection between technology and a social purpose, we have the power to make a tangible impact and tackle the pressing challenges confronting our global community.</p><p>Imagine a world where technology transcends its role as a personal convenience and transforms into a powerful force for social good. This is the essence of connecting tech to make a social impact. It surpasses the conventional understanding of technology solely as a means for profit and instead places a strong emphasis on leveraging its potential to empower marginalized communities, address societal issues, and foster inclusivity. By harnessing the transformative power of technology and channeling it towards social causes, we can unlock new opportunities and pave the way for a more equitable and sustainable future.</p><p>Notably, organizations are harnessing technology to drive social impact within their own structures. By employing innovative platforms and digital solutions, companies are empowering their employees and stakeholders to effect positive change. Take, for example, technology-enabled donation platforms that facilitate seamless and transparent giving. These platforms allow individuals to contribute to causes they deeply care about with ease and transparency, amplifying the impact of their contributions. Moreover, organizations are leveraging technology to promote employee engagement in social initiatives. Online volunteering platforms and digital collaboration tools provide employees with the opportunity to participate in meaningful projects and share their skills, irrespective of their geographic location. These tech-driven initiatives cultivate a sense of purpose and community among employees, magnifying the organization’s overall social impact. By harnessing technology in these ways, organizations can maximize their influence, inspire collective action, and foster a culture of social responsibility that extends far beyond the confines of the workplace.</p><p>In this interconnected era, where technology permeates every aspect of our lives, it is essential to recognize and embrace its potential as a catalyst for social change. By leveraging the transformative power of technology and uniting it with a social purpose, we can steer our global society towards a future that is not only technologically advanced but also just, inclusive, and sustainable. Let us seize this opportunity to connect tech for social impact, forging a path towards a better world for all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4adcf1a4a178" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “P” of MVC]]></title>
            <link>https://zymberg.medium.com/mv-c-read-p-7f21c6112dc1?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f21c6112dc1</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 19:39:15 GMT</pubDate>
            <atom:updated>2023-05-17T19:16:58.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>In order to ensure a specific organizational structure for applications, the creators of Rails implemented the model-view-controller (MVC) architecture. Let’s delve into three essential elements that every application must encompass:</p><ol><li>Domain Definition: When developing applications, it is crucial to define a domain. Essentially, the domain represents the foundation of your application and encompasses all its aspects. In other words, it involves modeling your database and establishing relationships between different components.</li><li>Item Behavior Definition: Following the domain definition, you need to determine the capabilities and limitations of the items within your domain. For instance, if you have defined a machine as an item within your domain (e.g., a factory), this step involves specifying the actions that machines can perform and those they cannot.</li><li>Public View Specification: Finally, it’s time to consider which views should be publicly available for your domain. This entails defining how the actions specified in step 2 should be presented. Using the example of machines, if you decided that machines can manufacture cars in step 2, this step involves designing the appearance of the corresponding web page.</li></ol><p>Once you understand these three principles, you can begin to think in terms of the MVC architecture:</p><p>Model or ActiveRecord in Rails (e.g., Factory): This component represents the core of your application, where you define relationships, validations, and behavior for all the items that constitute your domain.</p><p>Controller or ActionController in Rails (e.g., Machine): Acting as an intermediary between the domain and the views, the controller manages the flow of data and interactions. It orchestrates the communication between the domain definition and the views specified in step 3.</p><p>Views or ActionView in Rails: This layer encompasses the implementation of the views defined in step 3. It represents the user-facing part of the application and provides the visual representation of the domain. It is responsible for rendering the final output that users interact with, aligning with the underlying domain.</p><p>Understanding MVC might seem abstract if you’re unfamiliar with it. To provide a real-world analogy, consider the backstage of a performance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sr7Hy2jTDPmvoM4vp9fXRQ.png" /></figure><p>In this example, the user interacts with the application by pressing a button on the Machine (controller) to initiate the production of a new car. The controller then notifies the Model (factory) about this event. Upon receiving the notification, the model generates a new car and sends it back to the controller. The controller, in turn, updates the Viewer, which is responsible for displaying information to the user. Finally, the controller presents the new car to the user.</p><p>In this scenario, the controller acts as the “messenger” that facilitates the communication between different components, making it a crucial part of the MVC architecture. It conveys instructions from the Model (factory) regarding the available buttons. For instance, when the “create new car” button is pressed, the controller automatically notifies the Model. Once the new car is produced, it is sent to the Viewer, which possesses the instructions on how to display the new car to the user.</p><p>For further visual representations and diagrams related to this concept <a href="https://www.google.com/search?q=MVC+rails">click here to view more diagrams</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f21c6112dc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Team work makes the dream work]]></title>
            <link>https://zymberg.medium.com/team-work-makes-the-dream-work-819254e26012?source=rss-f9ef62ca3c19------2</link>
            <guid isPermaLink="false">https://medium.com/p/819254e26012</guid>
            <dc:creator><![CDATA[Granit Zymberi]]></dc:creator>
            <pubDate>Thu, 31 Mar 2022 14:50:38 GMT</pubDate>
            <atom:updated>2022-03-31T14:50:38.058Z</atom:updated>
            <content:encoded><![CDATA[<p>Rails Active Records provide an interface and binding between the tables in a relational database and the Ruby program code that manipulates database records. Ruby method names are automatically generated from the field names of database tables.</p><p>Each ActiveRecord object has a CRUD (Create, Read, Update, and Delete) methods for database access.</p><p>This strategy allows for simple designs and straight forward mappings between database tables and application objects.</p><p>When you have more than one model in your rails application, you would need to create connection between those models. You can do this via associations. Active Record supports three types of associations −</p><ul><li><strong>one-to-one</strong> − A one-to-one relationship exists when one item has exactly one of another item. For example, a person has exactly one birthday or a dog has exactly one owner.</li><li><strong>one-to-many</strong> − A one-to-many relationship exists when a single object can be a member of many other objects. For instance, one subject can have many books.</li><li><strong>many-to-many</strong> − A many-to-many relationship exists when the first object is related to one or more of a second object, and the second object is related to one or many of the first object.</li></ul><p>You indicate these associations by adding declarations to your models: has_one, has_many, belongs_to, and has_and_belongs_to_many.</p><p>Now, you need to tell Rails what relationships you want to establish within the library data system. Let’s see an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*VU7YJlNyFlzjX-pmV7GMtw.png" /></figure><p>We have used a singular subject in the above example, because one Book can belong to a single Subject.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*-0SSpz4k6lUrg-B7PBiqwQ.png" /></figure><p>We have used plural books here, because one subject can have multiple books.</p><h3>What query can be run in ActiveRecord?</h3><p>ActiveRecord has many methods for common tasks. Like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*gSnownziKpKs4CCHM2tMBA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=819254e26012" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>