- Code & Capital
- Posts
- [how to] build your first machine learning model! (a *very* requested edition)
[how to] build your first machine learning model! (a *very* requested edition)

Welcome to another issue of Code & Capital! We bring you moves in the stock market, the latest on machine learning and career opportunities in finance and engineering!
A Simple Guide on Building Your First Machine Learning Model
Pick a problem & choose the right model
Decide what you want to predict. A baseline model or a number, probably will use a Linear Regression, classifying something (yes/no, fraud/not fraud) likely will use a Logistic Regression or a more complex patterns may need a XGBoost model
Keep it simple, especially your first time around, I would recommend using and finding a problem well suited to use a linear regression or a logistic regression
Load & explore your dataset
For starters, use pandas to load your dataset and I highly recommend checking out an API you are familiar with to pull data from or a Kaggle.com dataset as well
You want to look for missing values, weird outliers, data types, and imbalances. The goal is to look through the data you are working with and understand it
Prep your data for modeling
This is probably the most important and overlooked part unfortunately. But people and schools I find don’t emphasize or teach this part enough. Models can’t handle messy data, so the better the quality data you have the better prediction you’ll be able to make. This is where you want to:
Fill or drop missing values
Convert categories to numbers
Split your data into training and testing sets
Train your model
Import your model, fit it, and let it learn patterns from the training data.
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
model.fit(X_train, y_train)
Look out for overfitting, which is very common. You’ll be able to tell if your model is overfitting if the model performs perfectly on training data but flops on test data, like this: training accuracy ~99%, test accuracy ~60–70%.
To fix it try a simpler model, look at your data, or use cross-validation
Evaluate & improve
This is where beginners learn what actually matters in machine learning which is performance on unseen data.
Some of the most common metrics to use are
Accuracy → simple, but misleading if data is imbalanced
Precision → “Of all the ones I predicted as fraud, how many were right?”
Recall → “Of all real fraud cases, how many did I catch?”
F1-score → balance between precision and recall
And this is just the tip of the iceberg on building your first ML model….
What I’ve been working on
Sometimes it’s hard to just look at a simple 5 step guide to fully understand how to get started building a machine learning model, because in all honestly it’s way better to have someone with experience actually explain it to you.
So I decided to take everything I learned (and everything I wish someone had told me early on) and turn it into a project-based course for true beginners in Python. We’ll build a real predictive model step-by-step, together. You’ll get code templates, walkthroughs, hands-on exercises, and explanations that actually click without any guessing, no confusion, very few “why isn’t my model working??” moments.
One of the best parts about the creation of this is what my community asked me for this and now thanks to Teachable I am able to give the gift and package my skills and experience into something that can transform the lives of others.
A course like this can lead to the completion of a new project (because starting is the hardest part), a new job, a new career opportunity in a different sector or just learning a new skill because it’s a passion project!
If you have a skill or hobby you want to share with the world Teachable is a great place to start exploring and sharing your content for others, and if you just want to learn more about how to get started making money with your hobby check out this guide here for more info!

Job Opportunities
Looking to make a mark in the world of technology and finance? Check out these handpicked opportunities:
Plaid, Software Engineer - Platform
Anthropic, Applied AI - Startup Partnerships
Vercel, Product Manager - AI Security
Tower Research Capital, Quantitative Trader (2026)
OpenAI, AI Support Engineer
Keep innovating,
Mar <3