# Foundations of ML

**- Overview**

Machine learning (ML) uses programmed algorithms that receive and analyze input data to predict output values within acceptable ranges. As new data is fed to these algorithms, they learn and optimize their operations to improve performance, developing "intelligence" over time.

ML algorithms are vital for a variety of tasks related to classification, predictive modeling, and analysis of data. There are four types of ML algorithms: supervised, semi-supervised, unsupervised, and reinforcement.

Choosing the right ML algorithm depends on several factors, including but not limited to: data size, quality, and diversity, and what answers a business hopes to derive from that data.

Other considerations include accuracy, training time, parameters, data points, and more. Therefore, choosing the right algorithm is a combination of business requirements, specifications, experimentation, and available time.

Even the most experienced data scientist can't tell you which algorithm will perform best without experimenting with other algorithms. However, we've compiled a "cheat sheet" of machine learning algorithms to help you find the best one for your specific challenge.

Please refer to the following for more details:

- Wikipedia:
**Machine Learning** - Wikipedia:
**Outline of Machine Learning**

**- The Components of A ML Model**

There are four basic types of ML: supervised learning, unsupervised learning, semisupervised learning and reinforcement learning. The type of algorithm data scientists choose depends on the nature of the data.

ML is a set of algorithms learned from data and/or experiences, rather than being explicitly programmed. Each task requires a different set of algorithms, and these algorithms detect patterns to perform certain tasks.

The three components that make a ML model are:

- Representation: How you want to look at your data.
- Evaluation: How good models are differentiated; how programs are evaluated.
- Optimization: The process for finding good models; how programs are generated.

**- Some Basics of ML**

Here are some basics of ML:

- Algorithms: Algorithms play a central role in machine learning. There are four types of machine learning algorithms: supervised, unsupervised, semi-supervised, and reinforced.
- Clustering: Clustering is a fundamental task in machine learning, data mining, and signal processing.
- Neural networks: Neural networks are a subset of deep learning that mimic the human brain through algorithms. They have four major components: inputs, weights, a bias or threshold, and an output.
- Decision trees: Decision trees are a popular tool for classification and prediction problems in machine learning. They describe rules that can be interpreted by humans and applied in a knowledge system such as databases.
- Linear regression: Linear regression is one of the fundamental algorithms in machine learning. It's based on simple mathematics and works on the principle of formula of a straight line, mathematically denoted as y = mx + c.

### - The Ten ML Disciplines

Machine learning (ML) is a type of artificial intelligence (AI) that focuses on building computer systems that learn from data. ML encompasses a broad range of techniques that enable software applications to improve their performance over time.

Machine learning algorithms are trained to find relationships and patterns in data. They use historical data as input to make predictions, classify information, cluster data points, reduce dimensionality, and even help generate new content, as new ML applications such as ChatGPT demonstrate.

The ten methods are the main disciplines in ML. Most ML algorithms fall into one of these categories:

- Regression
- Classification
- Clustering
- Dimensionality Reduction
- Ensemble Methods
- Neural Nets and Deep Learning
- Transfer Learning
- Reinforcement Learning
- Natural Language Processing
- Word Embeddings

**- ML Algorithms in Python**

Machine learning (ML) is the concept of programming a machine to learn from experience and from different examples without being explicitly programmed. It is an application of artificial intelligence (AL) that allows machines to learn on their own. ML algorithms are a combination of mathematics and logic that adjust themselves to perform more incrementally as input data changes.

As a general-purpose, easy-to-learn and understand language, Python can be used for a variety of development tasks. It is capable of many ML tasks, which is why most algorithms are written in Python.

The process of creating a ML algorithm is divided into two parts - the training and testing phases. Although there are many types of ML algorithms, they are divided into the following categories: supervised learning, unsupervised learning, and reinforcement learning.

- Linear regression: Linear regression is a supervised learning algorithm that is used to predict continuous values. It works by finding a linear relationship between the independent and dependent variables.
- Decision trees: Decision trees are supervised learning algorithms that are used to classify data. They work by recursively splitting the data into smaller and smaller subsets until each subset contains only data points of the same class.
- Support vector machines (SVMs): SVMs are supervised learning algorithms that are used to classify data. They work by finding a hyperplane that separates the data into two classes.
- Random forests: Random forests are ensemble learning algorithms that combine the predictions of multiple decision trees to produce a more accurate prediction.
- K-nearest neighbors (KNN): KNN is a supervised learning algorithm that is used to classify data. It works by finding the K most similar data points to a new data point and then predicting the class of the new data point based on the classes of the K nearest neighbors.

**- Machine Learning Workflow**

A machine learning (ML) workflow describes the steps of a ML implementation. The typical phases of an ML workflow include:

- Data collection
- Data pre-processing
- Dataset building
- Model training and evaluation
- Deployment to production

Other steps in the ML workflow include:

- Choosing a model or algorithm
- Training the model
- Evaluating the model
- Parameter tuning
- Making predictions
- Researching the model that will be best for the type of data
- Testing the model
- Improving

**[More to come ...]**