Your First Program

Programming for ML with no experience — if you can type, you can begin

A program is a list of instructions, written down for the most literal helper you will ever meet. Imagine handing a recipe to a kitchen robot that does exactly what the card says, in exactly the order it says it, and nothing else. It never guesses, never skips ahead, and never fills in what you obviously meant. That strictness sounds annoying, but it is actually the best news in this whole course: if you can write clear instructions, you can program, and everything a computer does for machine learning starts as instructions like these.

The language we will write those instructions in is called Python. It is the language of modern machine learning, and it was designed to be readable: a lot of Python looks close to plain English. You do not need to install anything to follow this course. Every lesson shows you short programs and what they produce, you predict what the code will do, and the practice checks you. If you do want to type along, searching for "online Python" gives you plenty of free pages where you can paste code and run it in your browser.

Here is a complete, genuine Python program. One line.

Where this lives in MLEvery machine learning model you will ever train is started by a program like this one, just longer. A real training script is still a list of instructions read top to bottom: load the data, build the model, fit it, print how well it did. The famous libraries do the heavy lifting, but the file that calls them is plain Python you will be able to read. Playing computer, tracing code line by line,…
▶ Your First Program
← Reading Mathematical NotationVariables & Numbers →