Fundamentals of ML Recap
Fundamentals of ML Recap
CULMINATECH
Types of Machine Learning
CULMINATECH
Types of Machine Learning
Supervised Learning
Where the model learns from labeled data.
In supervised learning, the model uses input-output pairs to
learn a function that can predict outcomes for new data.
Classification: Predicting categorical labels (e.g., spam
or not spam). Apple Banana
CULMINATECH
Types of Machine Learning
Unsupervised Learning
CULMINATECH
Types of Machine Learning
Reinforcement Learning
:Where an agent learns to make decisions by performing actions and receiving rewards.
CULMINATECH
Preparing Data and Engineering Features
Data Pre-processing
Cleaning: Removing errors and inconsistencies from the data.
Transformation: Scaling or normalizing features to ensure uniformity.
Encoding: Converting categorical variables into numerical
representations.
Feature Engineering: Creating new features or transforming existing
ones to improve model performance.
CULMINATECH
Model Evaluation
Why Evaluate a Model?
After training a model, you need to know how well it predicts
new data
Think of regularization as a way to prevent your model from studying "too hard" and just
memorizing data. It gently nudges the model to be more general.
Best Practices in Machine Learning
Data Quality: High-quality data is critical for building robust models.
Algorithm Selection: There is no one-size-fits-all algorithm. Testing different algorithms based
on the problem context is essential.
MORE CODING
The next slides contain snippets of more coding examples.
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
from sklearn.metrics import accuracy_score
print("Accuracy:", accuracy_score(y_test, predictions))
More Data Processing
# Create a new column 'is_child' to indicate whether the passenger is a child
df['is_child'] = (df['Age'] < 18).astype(int)