Baseball, sport and ball with a sports woman, athlete or pitcher throwing and pitching a ballFantasy sports leagues have long been dominated by stats-savvy players who track athletic performance down to the decimal point, closely monitor injury reports, and build rosters with the precision of a professional analyst. For the average fan, keeping up can feel impossible.

But what if anyone could draft competitive lineups without spending hours poring over data?

That’s the question that led Adam Scharf, an MBA student at Dartmouth’s Tuck School of Business, to develop Smart Roster—a fantasy baseball application that uses a combination of predictive analytics, optimization modeling, and natural language technologies to create a more engaging experience for players of all levels.

Making Daily Fantasy Sports More Accessible

Daily Fantasy Sports (DFS) platforms give players the chance to draft new lineups every day, competing for points and cash prizes based on how well their chosen athletes perform. Of course, there are specific rules a player’s roster must adhere to, from strict salary caps to position constraints.

With thousands of players to choose from and constantly shifting performance data, building the right lineups is both an art and a science.

Scharf realized that existing fantasy sites failed to integrate sophisticated statistical metrics with engagement, leaving many average users, or “managers,” with consistent losses and a frustrating experience.

By combining predictive models with advanced optimization algorithms and natural language, Scharf designed Smart Roster to instantly generate high-performing lineups that win DFS contests. This allows the personalization and interaction that most users crave, while unlocking the horsepower of Gurobi for everyday users.

“I was introduced to Gurobi by two of my professors at Dartmouth Tuck School of Business, Jim Smith and Raghav Singal. Both had used the tool at a highly advanced level for years, so they were able to guide me in the initial steps very quickly,” says Scharf. “With this as a baseline, I began exploring it more deeply and expanding my use cases. The ease of use and power of the tool is why I decided to go forward with Gurobi as my optimization tool of choice over other options.” 

The Underlying Model

Smart Roster uses predictive analytics—analyzing historical data, matchup statistics, injury reports, and more—to forecast player performance. These forecasts serve as essential inputs for the optimization model, which is then run on Gurobi to construct optimal rosters while increasing variance and avoiding overlap with other DFS players.

Leveraging a variety of techniques pioneered in scholarly articles about inefficiencies in fantasy sports, SmartRoster builds optimized lineups based on salaries, variance optimization techniques, and expected point maximization. Scharf weaves DFS techniques with hard-nosed optimization to statistically improve players’ odds.

What goes into a DFS lineup? Much like an actual MLB game, a roster is constructed with one player at each position (e.g., first baseman, second baseman, shortstop, etc.), plus two pitchers (for a total of 10 players per lineup).

Each player is assigned a salary before the game, and each overall lineup of 10 players has a salary cap. Based on real-world performance (like RBIs or runs scored), each player accrues points for the manager’s “team.”

This tees us up for a classic optimization question: How can a savvy manager best allocate their pre-determined salary budget to create the highest scoring lineup?

What’s more, typical DFS contests reward the top 5% of managers—which is why Scharf used Gurobi constraints to crank up the variance in each lineup, optimizing for points and variance to land users in the money.

Constraints that Scharf uses include: 

  • Positions: Enforces positional requirements for DFS baseball (just like in an MLB game).
  • Salary cap: Ensures total salary does not exceed the salary cap.
  • Sequence of five players: Ensures at least one sequence of five players from the same team. Having five players from the same team is incredibly valuable in boosting variance. For example, managers can get a point for a run scored and an RBI at the same time, if both players are on the same team.
  • Low roster percentage: Requires at least two players with a roster percentage below 5%. Adding players with a low roster percentage (the percentage of other fantasy players whose roster contains a particular player) can make a manager stand out from their opponents. To maximize variance, a manager not only needs to be varied in their own lineup, but also varied from opposing managers.
  • Opposing pitchers: Limits the number of hitters selected from the opposing team when selecting a pitcher. If you gain a point for a homerun but lose that same point in ERA for your pitcher, your lineup will trend toward average.
  • Unique lineups: Ensures each lineup generated is unique, differing by at least three players. Scharf enables multi-lineup functionality so that if a manager is submitting a slate of lineups (think three, 10, or even 100 lineups), each lineup will be distinct and varied from the others.
  • AI-Generated: Users can chat with the product to create new constraints on the fly. Say you want a minimum of four New York Mets in your lineup, or even something random—like at least three players whose names start with the letter “D.” SmartRoster can build it! This AI-generated constraint allows for flexible fan-based inputs while still maintaining the core optimization function. Yes, it is writing, creating, and adding Gurobi code on the fly.

Additional Features

By combining advanced optimization with user engagement, Scharf hopes to bring advanced Gurobi techniques to everyone.

With Smart Roster, players can:

  • Get answers to baseball stat questions (the model is trained on the last four years of available data)
  • Identify and choose replacement players for any spot in the lineup
  • Access online articles and late-breaking data about their full lineup or specific players with key, actionable takeaways
  • Get summaries of articles so managers know exactly what’s going on without needing to read through the full content
  • Add new optimization parameters directly into the underlying Gurobi model in natural language, and reoptimize the lineup with those new parameters

SmartRoster demonstrates how predictive analytics (all those forecasts and data) can be used as effective inputs for prescriptive analytics (optimization), leading to better, faster results.

A Better (Optimal) Way to Play

Scharf’s Smart Roster is an illustration of just how versatile mathematical optimization is, and the many ways it can be applied. It’s also a reminder that powerful analytics don’t have to be intimidating—and that optimization can unlock smarter decisions, even in the world of fantasy baseball.

Smart Roster is currently available for beta testing. You can find out more or request to join the private beta here.  

Jerry Yurchisin
AUTHOR

Jerry Yurchisin

Senior Data Science Strategist

AUTHOR

Jerry Yurchisin

Senior Data Science Strategist

Mr. Yurchisin has over ten years’ experience applying operations research, machine learning, statistics, and data visualization to improve decision making. Before joining Gurobi, Jerry (who also goes by Jerome) was a Senior Consultant at OnLocation, Inc. where he customized several linear programming models within the National Energy Modeling System (NEMS) to analyze implementing specific energy policies and utilizing new technologies. Prior to OnLocation, Jerry was an Operations Research Analyst & Data Scientist at Booz Allen Hamilton for over seven years. There he formulated scheduling and staffing integer programming models for the US Coast Guard, as well as led a project to quantify the maritime risks of offshore energy installations with the Research & Development Center. Further, Jerry was the technical lead on several Coast Guard studies including Living Marine Resources and Maritime Domain Awareness, providing statistical analysis and building supervised and unsupervised machine learning models. He also performed statistical analyses, machine learning modeling, and data visualization for cyberspace directorates at DoD and DHS. Jerry has several years of experience teaching a wide variety of college-level mathematics and statistics courses and has a passion for education. He also enjoys golfing, biking, and writing about sports from an analytics point of view. He lives in Alexandria, Virginia with his wife, son, and two dogs. Jerry holds B.S., Ed. and M.S., Mathematics degrees from Ohio University and an M.S. in Operations Research and Statistics from The University of North Carolina at Chapel Hill.

Mr. Yurchisin has over ten years’ experience applying operations research, machine learning, statistics, and data visualization to improve decision making. Before joining Gurobi, Jerry (who also goes by Jerome) was a Senior Consultant at OnLocation, Inc. where he customized several linear programming models within the National Energy Modeling System (NEMS) to analyze implementing specific energy policies and utilizing new technologies. Prior to OnLocation, Jerry was an Operations Research Analyst & Data Scientist at Booz Allen Hamilton for over seven years. There he formulated scheduling and staffing integer programming models for the US Coast Guard, as well as led a project to quantify the maritime risks of offshore energy installations with the Research & Development Center. Further, Jerry was the technical lead on several Coast Guard studies including Living Marine Resources and Maritime Domain Awareness, providing statistical analysis and building supervised and unsupervised machine learning models. He also performed statistical analyses, machine learning modeling, and data visualization for cyberspace directorates at DoD and DHS. Jerry has several years of experience teaching a wide variety of college-level mathematics and statistics courses and has a passion for education. He also enjoys golfing, biking, and writing about sports from an analytics point of view. He lives in Alexandria, Virginia with his wife, son, and two dogs. Jerry holds B.S., Ed. and M.S., Mathematics degrees from Ohio University and an M.S. in Operations Research and Statistics from The University of North Carolina at Chapel Hill.

Guidance for Your Journey

30 Day Free Trial for Commercial Users

Start solving your most complex challenges, with the world's fastest, most feature-rich solver.

Always Free for Academics

We make it easy for students, faculty, and researchers to work with mathematical optimization.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Academic License
Gurobi provides free, full-featured licenses for coursework, teaching, and research at degree-granting academic institutions. Academics can receive guidance and support through our Community Forum.

Search

Gurobi Optimization

Navigation Menu