Bought the Mannequin Coaching Pack however unsure how you can use it? This step-by-step information reveals you how you can load your saved mannequin, get the suitable knowledge from the CFBD API, and begin making predictions, plus how Tier 3 weekly CSV drops can prevent hours.
Since launching the Mannequin Coaching Pack, one of many prime questions I’ve heard is:
“I’ve bought the educated mannequin… now what?”
If that’s you, this information is for you.We’ll stroll by means of:
What sort of knowledge your mannequin must make predictions.The place to get that knowledge from the CollegeFootballData API.Tips on how to load several types of fashions from the pack and run predictions.Tips on how to skip the information prep totally with Tier 3 weekly CSV drops.
1. What Your Mannequin Wants
The fashions within the coaching pack have been all constructed on feature-ready CSV recordsdata.
Meaning:
The CSV has the very same columns because the coaching knowledge.The columns are in the identical order.The numbers are calculated the identical manner (e.g., utilizing stats from video games earlier than the sport you’re attempting to foretell).In case your CSV doesn’t match, your mannequin will throw errors or give unhealthy predictions.
2. Two Methods to Get the Information
Choice 1: Construct it your self
You possibly can pull comparable knowledge from the CollegeFootballData API.Listed here are the endpoints you’d use, at a excessive degree:
Characteristic Group
API Endpoint
Key Fields
Opponent-adjusted group metrics
/wepa/group/season
epa.*, epa_allowed.*, successRate.*, successRateAllowed.*
Superior group metrics (non-opponent-adjusted)
/stats/season/superior
havoc, fieldPosition, pointsPerOpportunity
Sport metadata
/video games
week, homeTeam, awayTeam, neutralSite
Betting knowledge
/traces
traces[*].unfold
Talen composite
/expertise
expertise
Notice: For those who construct your personal CSV, you’ll want to hitch these datasets collectively and ensure your stats solely embrace video games earlier than the prediction week.
Choice 2: Skip the work
Beginning Week 5, Tier 3 patrons will get a weekly CSV that already:
Has all the suitable columns.Is within the appropriate order.Makes use of stats from video games earlier than that week.
With that file, you may go straight to loading your mannequin and operating predictions.
3. Loading and Predicting
After getting your CSV, right here’s how you can use it with every sort of mannequin from the pack.Exchange “week5_features.csv” together with your file and “path/to/mannequin” together with your mannequin file.
Random Forest / Regression (scikit-learn)
import pandas as pd, joblib
# Load your options
X_live = pd.read_csv(“week5_features.csv”)
# Load your mannequin
mannequin = joblib.load(“fashions/sklearn_rf.pkl”)
# Make predictions
preds = mannequin.predict(X_live)
X_live[‘prediction’] = preds
XGBoost
import pandas as pd, xgboost as xgb
# Load your options
X_live = pd.read_csv(“week5_features.csv”)
# Load your mannequin
mannequin = joblib.load(“fashions/xgb_model.pkl”)
# Make predictions
preds = mannequin.predict_proba(X_live)[:, 1]
X_live[‘prediction’] = preds
fastai (tabular)
import pandas as pd
from fastai.tabular.all import load_learner
# Load your options
cat_features = […] # listing out categorical options
cont_features = […] # listing out steady options
X_live = pd.read_csv(“week5_features.csv”)
X_live = X_live[cat_features + cont_features]
# Load your mannequin
be taught = load_learner(“fashions/fastai_model.pkl”)
dls = be taught.dls.test_dl(X_live)
# Make predictions
batch_preds = be taught.get_preds(dl=dls)[0].numpy()
X_live[‘prediction’] = batch_preds
4. Widespread Gotchas
Mistaken column order → reorder to match your coaching knowledge earlier than predicting.
Lacking columns → make sure that your CSV consists of all the pieces from coaching.
Mistaken knowledge sorts → convert strings to numbers the place wanted.
fastai class mismatch → your classes should match what the mannequin was educated on.
5. The Quick Lane
If you wish to:
Keep away from merging a number of datasets,Skip determining lag logic, andBe positive your columns match completely…
…be a part of Tier 3 on Patreon.Each week beginning in Week 5, you’ll get a CSV that’s able to feed straight into your mannequin.
Be part of Tier 3 right here →
6. Your Subsequent Steps
Choose one in every of your fashions from the pack.Seize a CSV, both your personal or from the pack, and run the code above to check.Get your arms on current-season options (DIY or Tier 3) and begin making actual predictions.
Backside line:For those who can construct the CSV your self, nice. You now know precisely what your mannequin wants.If you wish to skip the grunt work and begin predicting in minutes, Tier 3’s weekly CSV drops are your quickest path.