47. Month 1 Final Project Direction
Goal:
Truth Layer / Scam Detector
Baseline:
Text
↓
TF-IDF
↓
Logistic Regression
↓
Scam / Not Scam
Then PyTorch version:
Text
↓
Text representation
↓
Dataset
↓
DataLoader
↓
Neural Network
↓
Prediction
Compare:
TF-IDF + Logistic Regression
VS
PyTorch Neural Network
Possible comparison metrics: - accuracy - precision - recall - F1 - training time - inference time - implementation complexity
Goal: understand neural-network training. The PyTorch model does not need to beat Logistic Regression.
48. Current Learning Progress
Python Fluency ✅
NumPy ✅
Pandas ✅
Jupyter ✅
Essential ML Fundamentals ✅
scikit-learn ✅
Model Evaluation ✅
Preprocessing/Pipelines ✅
Cross-Validation ✅
Basic FastAPI Model Serving ✅
PyTorch:
Tensors ✅
Dataset / DataLoader ✅
Neural Network / nn.Module ✅
Basic ReLU ✅
Next:
Activation Functions ⏳
Loss Functions ⏳
Autograd / Backpropagation ⏳
Optimizers ⏳
Training Loops ⏳
Validation / Evaluation ⏳
GPU / Device Handling ⏳
Save / Load PyTorch Models ⏳
Final Text Classification ⏳
49. High-Value Cheat Sheet
Python
def function(x: int) -> int:
return x * 2
items = [x * 2 for x in range(5)]
try:
...
except ValueError:
...
with open("file.txt") as file:
...
Pandas
df = pd.read_csv("data.csv")
df.head()
df.info()
df.describe()
df.isna().sum()
X = df.drop(columns=["target"])
y = df["target"]
scikit-learn
X_train, X_test, y_train, y_test = train_test_split(
X,
y,
test_size=0.2,
random_state=42,
stratify=y
)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
PyTorch
tensor = torch.tensor(
[1, 2, 3],
dtype=torch.float32
)
dataset = TensorDataset(X, y)
loader = DataLoader(
dataset,
batch_size=32,
shuffle=True
)
class NeuralNetwork(nn.Module):
def __init__(self):
super().__init__()
self.network = nn.Sequential(
nn.Linear(2, 4),
nn.ReLU(),
nn.Linear(4, 1)
)
def forward(self, x):
return self.network(x)
50. Concepts You Should Be Able to Explain
Before finishing Month 1, aim to explain these without relying on memorized code:
- What is the difference between a feature and a target?
- Classification vs regression?
- Why separate training and test data?
- What is data leakage?
- Overfitting vs underfitting?
- Precision vs recall?
- Why use preprocessing pipelines?
- Parameter vs hyperparameter?
- What is a tensor?
- What does tensor shape mean?
- Dataset vs DataLoader?
- What is a batch?
- What is an epoch?
- What is a neuron?
- What are weights and biases?
- What does
nn.Lineardo? - What does
forward()do? - Why do neural networks need nonlinear activation functions?
- What changes when a neural network learns?
- Why might Logistic Regression still beat a neural network?
51. Mental Model to Keep
The complete workflow we're building toward is:
RAW DATA
↓
CLEAN / PREPROCESS
↓
FEATURE REPRESENTATION
↓
TENSORS
↓
DATASET
↓
DATALOADER
↓
BATCH
↓
NEURAL NETWORK
↓
PREDICTION
↓
LOSS
↓
BACKPROPAGATION
↓
OPTIMIZER
↓
UPDATE WEIGHTS
↓
REPEAT ACROSS BATCHES / EPOCHS
↓
EVALUATE ON UNSEEN DATA
↓
SAVE MODEL
↓
SERVE / USE FOR INFERENCE
If you understand why each box exists, you are building the right foundation for AI engineering.