How to learn machine learning
Tags: machinelearning, google, llm, learning
Published: 2024-05-25 22:48:22

## Some notes about machine learning

It's a way in which a machine is able to perform tasks without explicit programming. Theoretical bases have existed since the 1960s, but significant results are possible thanks to dedicated hardware, algorithms capable of exploiting this power and well structured datasets.

## A classification example

A software programmed explicitly to perform image classification would need to identify explicitly the characteristics of the object. This can work if all objects are reasonably simple and similar. But what if the some features of the same object category have an high variance?

### An approach without explicit instructions

We could submit a suitably labeled dataset of image data to the software (i.e. the machine learning model) by performing an appropriate number of training-and-testing cycles on it. Another example could use linear regression to predict prices of houses by their sizes. The common ground here is study the data to form an hypothesis. Adding more data probably will expose errors within the hypothesis, then we can measure the error gap and form an updated hypothesis with a minor error gap.

The machine has to analyze the dataset using some assumptions, e.g. a linear variable that can be represented as a straight line on a Cartesian plane. The machine goal is to test every possibile result to extract the one with the lowest error rate. It's simple with a linear variable, much more complex with some modern machine learning models that have billions of variables, but the principle is the same: the machine start from a random point (or parameters set) and move towards the lowest error rate, cycle after cycle of train and test.

Every train-and-test step give a measure (an "error function" or "loss function") and the repetition of these steps is the "gradient descent" towards the solution.

There are various ways to improve results such as [backpropagation](https://en.wikipedia.org/wiki/Backpropagation) to fine-tune the data parameters and [neural node dropouts](https://machinelearningmastery.com/dropout-for-regularizing-deep-neural-networks/) to reduce overfitting (when the ML model is no longer can generalize well on real world data).

## Some machine learning categories

- [supervised learning](https://cloud.google.com/discover/what-is-supervised-learning): image classification, speech/text recognition, fraud detection
- [unsupervised learning](https://cloud.google.com/discover/what-is-unsupervised-learning): grouping data into clusters or identifying anomalies
- [reinforcement learning](https://www.mathworks.com/discovery/reinforcement-learning.html): the software finds the best solution for a given problem

## Sources to learn more

- [AI and machine learning products](https://cloud.google.com/products/ai/ml-comic-1)
- [Deep Learning with Python, Second Edition](https://www.manning.com/books/deep-learning-with-python-second-edition), by François Chollet
- [IBM: What is machine learning?](https://www.ibm.com/topics/machine-learning)
- [Machine learning, cos’è e come funziona questa branca dell’intelligenza artificiale](https://www.agendadigitale.eu/cultura-digitale/machine-learning-cose-e-come-funziona/)
- [Large language models, explained with a minimum of math and jargon](https://www.understandingai.org/p/large-language-models-explained-with)