promptdojo_

The ML package map — numpy, pandas, sklearn, torch — step 7 of 7

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Checkpoint. Your team keeps a cheat sheet mapping each ML package to its conventional import line — the exact line you should see at the top of an AI-generated file, alias and all. Wire up the lookup.

Write import_line(package): return the conventional line from CONVENTIONS, or the string unknown package: <name> for anything not in the map (the final print asks about scipy, which the sheet doesn't cover).

Expected output:

fast array math: import numpy as np
load a CSV into a table: import pandas as pd
train a small classifier: from sklearn.linear_model import LogisticRegression
build a neural network: import torch
unknown package: scipy

full-screen editor opens — close anytime to keep reading.