Starting Python and machine learning from zero with an assistant as the teacher
The first days of learning Python and machine learning as a chemical engineer with no coding, with the questions the assistant asked, the plan it gave and what two evenings covered.
I am a chemical engineer with a PhD, and when this started I had no coding. I had never written Python and I did not understand what a neural network was. I wanted to do research with machine learning, and with PINNs in particular. PINN stands for physics-informed neural network. It is a neural network where the governing equation of the problem, for example the rate equation of a reactor, goes into the loss, which is the number the training tries to make small.
So at 4 AM one night I asked Claude to teach me machine learning, AI and PINNs from the ground up, as a PhD chemical engineer new to all of it, with examples I can relate to.
It asked me three questions before it started. My answers were: no experience with Python, no understanding of neural networks, and I want both fundamentals and applications. Then it gave me three paths to choose from. Option A was foundation first for 2 to 3 weeks, option B was learn by doing from week 1, and option C was a parallel track. I chose option C, and the first install was going to be Anaconda.
The next day I asked for an online platform instead of a local install and went with Google Colab, which is a Python notebook that runs in the browser. I ran the first cell and saw output. Then I asked for a simple ODE problem, so my first small model was a PINN for a first-order reactor, built in parts: the problem, the network, the physics-informed loss, the training. Training completed and I plotted the results. Colab removes the install step entirely, and I think that is why the first working model took one evening.
A few days later, close to midnight, I started a proper course in a new chat. I asked again, a little differently: teach me the fundamentals and applications of machine learning and deep learning, as a PhD who did not study computer engineering and has done little or no coding, enough to do ML and PINN research. The plan it gave had five phases.
| Phase | Time |
|---|---|
| Python | 2 to 3 weeks |
| Mathematics | 1 to 2 weeks |
| Classical ML | 3 to 4 weeks |
| Deep learning | 4 to 6 weeks |
| PINNs | 3 to 4 weeks |
We started with Python basics on Colab: variables, operations, lists, dictionaries, control flow and functions. Then I went straight on to NumPy the same night, which is the library for arrays, so indexing, operations on arrays, statistics, linear algebra, broadcasting and random numbers.
The next evening I did pandas, from series and dataframes through pivot tables and applying functions. Then matplotlib and seaborn for plots, subplots, error bars, heatmaps and pair plots. Then the scikit-learn workflow, which started with exploring and preprocessing the data and went on to linear regression, polynomial features, ridge and lasso, decision trees, random forests, XGBoost and support vector regression, and after that model comparison, cross-validation and hyperparameter tuning.
So in two evenings I had gone through the topics of the Python phase, which the plan gave 2 to 3 weeks, and I think a good part of what it called classical ML.
Sources
- Google. Colaboratory, a hosted Jupyter notebook service. https://colab.research.google.com/