What is Machine Learning
Machine learning is a branch of computer science that aims to enable computers to “learn” from data and improve their performance at tasks without being explicitly programmed for each specific task. It involves developing algorithms that allow computers to identify patterns, make decisions, and predict outcomes based on data inputs.
The essence of machine learning is in its ability to adapt and improve over time through exposure to data, which is analogous to gaining experience. It is one of today’s most rapidly growing technical fields, lying at the intersection of computer science and statistics, and at the core of artificial intelligence and data science- (Jordan, 2015)
To understand how machine learning works, it is important to develop familiarity with some fundamental terminologies that are commonly used in this field. Please have a look at them below.
- Features: Features, also known as input variables, are the individual measurable properties or characteristics of a phenomenon being observed. In a dataset, features are used by machine learning algorithms to make predictions or classifications.
- Label: The label, also known as the target variable or output variable represents the desired output or outcome for a given set of features. In the case of spam detection, the label could be “spam” or “not spam” for each email.
- Algorithm: A procedure or a set of rules followed to perform a specific task. In the context of machine learning, it refers to the mathematical and computational techniques used to train a machine learning model on data. The algorithm processes data and iteratively adjusts its parameters to minimize errors and improve its performance on the given task. Examples include Linear regression, Logistic regression, Decision tree, SVM algorithm, Naive Bayes algorithm, KNN algorithm, etc.
- Model: A machine learning model is the result of training a machine learning algorithm on a dataset. It represents the learned patterns, parameters, and structures that can be used to make predictions or classifications on new data. The model applies the learned patterns and relationships from the training process to make predictions or decisions on new, unseen data. Examples include Trained Linear Regression Model, Trained SVM Model, and Trained KNN Model.
- Training Data: Training data is a collection of labeled examples used to train a machine learning model. This data consists of input features and their corresponding labels. During the training phase, the model learns the underlying patterns in the data by adjusting its internal parameters. The model’s performance is evaluated using a separate dataset called the test set, which contains examples not used during training.
Origin & History
The history of machine learning is marked by significant theoretical and practical advancements, driven by interdisciplinary collaboration and technological progress. The details discussed in this section are based on the detailed historical account provided by Alexander L. Fradkov in his paper “Early History of Machine Learning“.
I. Early Years (1950s-1960s)
A. Frank Rosenblatt and the Perceptron
The modern concept of machine learning began with psychologist Frank Rosenblatt from Cornell University. In the late 1950s, Rosenblatt developed the “perceptron,” a machine designed to recognize letters of the alphabet by mimicking the neural processes of the human brain.
The perceptron used both analog and discrete signals and included a threshold element that converted analog signals into discrete ones. This work laid the foundation for modern artificial neural networks (ANNs) and was closely related to models of animal and human learning in psychology.
B. Mathematical Foundations
The Novikoff theorem, formulated in 1962, provided conditions for the convergence of a perceptron learning algorithm in a finite number of steps. This period also saw the development of various deterministic and probabilistic approaches to pattern recognition by researchers such as Mark Aizerman, Vladimir Vapnik, and Alexey Chervonenkis.
II. The 1960s: First Boom of Machine Learning
A. Deterministic and Probabilistic Approaches
In the early 1960s, multiple research groups worked on the design and testing of learning recognition systems. Researchers such as Widrow, Bongard, and Braverman contributed to the development of deterministic approaches, while Aizerman, Braverman, and Rozonoer proposed probabilistic statements of the machine learning problem.
B. Gradient-Type Algorithms and Support Vector Machines
During this period, gradient-type algorithms for perceptron learning were developed, constructing separating hyperplanes to classify data. This work led to the development of support vector machines (SVM), a significant advancement in the field.
III. The 1980s: Second Boom of Machine Learning
A. Backpropagation & Neural Networks
The 1980s marked a resurgence in interest in machine learning, driven by the invention of the backpropagation learning algorithm by researchers such as Rumelhart, Hinton, and Williams. This algorithm allowed for the training of multilayer neural networks, significantly improving their learning capabilities. .
B. Convolutional Neural Networks
Kunihiko Fukushima proposed the neocognitron, a hierarchical multilayered convolutional neural network, in 1980. This architecture laid the groundwork for modern convolutional neural networks (CNNs) used in image recognition tasks.
IV. The 2000s: The Rise of Big Data & Deep Learning
A. Big Data & Computational Advances
The early 2000s saw the emergence of Big Data, the reduction in the cost of parallel computing, and advancements in hardware such as GPUs. Technologies like Google’s MapReduce and its open-source counterpart Hadoop facilitated the processing of large datasets, enabling more sophisticated machine learning applications.
B. Deep Learning
The concept of deep neural networks (DNNs) gained prominence, with significant contributions from researchers such as Geoffrey Hinton, Yann LeCun, and Yoshua Bengio. This period saw the development of deep learning techniques that could handle complex data and achieve remarkable performance in tasks like image and speech recognition.
Machine Learning Categories
Machine learning is broadly categorized into four main types: supervised learning, semi-supervised learning, unsupervised learning, and reinforcement learning. Each type addresses different kinds of tasks and uses various approaches to achieve learning.
I. Supervised Learning
Supervised learning involves using labeled datasets to train algorithms for accurate data classification and outcome prediction. As input data is fed into the model, it adjusts its weights to fit the data appropriately. This process includes cross-validation to prevent overfitting or underfitting, ensuring the model’s reliability.
Supervised learning enables organizations to address various real-world problems at scale, such as classifying spam emails into a separate folder from the inbox. By leveraging this approach, highly accurate machine-learning models can be developed to meet diverse needs- (IBM, 2024).
Common machine learning algorithms used in supervised learning:
- Linear Regression
- Decision Trees
- Random Forests
- Support Vector Machines (SVM)
- Neural Networks
II. Unsupervised Learning
Unsupervised learning employs machine learning algorithms to analyze and cluster unlabeled datasets into subsets called clusters. These algorithms identify hidden patterns or groupings in the data without human intervention.
The ability of unsupervised learning to uncover similarities and differences within information makes it ideal for exploratory data analysis, cross-selling strategies, customer segmentation, and image and pattern recognition.
For instance, Google News utilizes unsupervised learning to categorize articles on the same topic from various online news outlets. An example is grouping articles about a presidential election under the “US” news label.
Common machine learning algorithms used in unsupervised learning:
- K-Means Clustering
- Hierarchical Clustering
- Principal Component Analysis (PCA)
- Anomaly Detection Algorithms
III. Semi-Supervised Learning
Combines aspects of supervised and unsupervised learning by using a small amount of labeled data along with a large amount of unlabeled data to improve learning accuracy.
It is not wrong to say that semi-supervised learning can address the issue of insufficient labeled data for a supervised learning algorithm. Additionally, it is beneficial when labeling a large amount of data is too expensive – (IBM, 2024)
Common machine learning algorithms used in semi-supervised learning:
- Semi-Supervised SVM
- Graph-Based Methods
- Self-Training Algorithms
IV. Reinforcement Learning
This machine learning model is similar to supervised learning, but the algorithm isn’t trained using sample data. This model learns as it goes by using trial and error. A sequence of successful outcomes will be reinforced to develop the best recommendation or policy for a given problem.
Reinforcement learning involves training an agent to make a sequence of decisions by rewarding desirable behaviors and penalizing undesirable ones. This method is often used in robotics and game-playing- (Fradkov, 2020).
Common machine learning algorithms used in reinforcement learning:
- Q-Learning
- Deep Q-Networks (DQN)
- Policy Gradient Methods
- Actor-Critic Methods
Machine Learning Tasks/Techniques
Machine learning tasks refer to the specific problems that machine learning models aim to solve. These tasks can be broadly categorized into several types, each addressing different kinds of problems and data. Here are the primary machine-learning tasks:
I. Classification
The Classification task is a Supervised Learning technique that is used to identify the category of new observations on the basis of training data. In Classification, a program learns from the given dataset or observations and then classifies new observations into a number of classes or groups. Example- Yes or No, 0 or 1, Spam or Not Spam, cat or dog, etc. Classes can be called targets/labels or categories. The best example of an ML classification algorithm is an Email Spam Detector.

II. Regression
Regression analysis models the relationship between a dependent (target) variable and one or more independent (predictor) variables. Specifically, it helps to understand how the value of the dependent variable changes in response to an independent variable while keeping other independent variables fixed.
As a supervised learning technique, regression helps to find correlations between variables and enables the prediction of the continuous output variable based on one or more predictor variables. It is primarily used for prediction, forecasting, time series modeling, and determining causal-effect relationships between variables.
III. Clustering
Clustering, or cluster analysis, is a machine learning technique used to group unlabeled datasets. It is defined as a method of organizing data points into clusters that consist of similar data points. Objects with similar characteristics are grouped together, while those with fewer or no similarities are placed in different groups.
This technique identifies patterns within the unlabeled dataset, such as shape, size, color, and behavior, and divides the data based on the presence or absence of similar patterns. A simple example of clustering is grouping documents according to the topic.
It is important to note that grouping unlabeled datasets is called clustering, however, if the examples are labeled, then clustering becomes classification. The graph illustrated below provides an overview of unlabeled datasets grouped into three clusters.

Machine Learning Algorithms
Machine Learning algorithms are programs designed to learn hidden patterns from data, predict outcomes, and enhance their performance through experience. Multiple algorithms are often used together to build models for achieving different tasks. For example, an automated trading model can be built using algorithms like Logistic Regression, Naïve Bayes, Support Vector Machines (SVM), and their variations.
There are numerous algorithms in the machine learning field, but we will focus on the six most commonly used, particularly in the context of trading.
I. Linear Regression
Linear regression is one of the most popular and straightforward machine learning algorithms used for predictive analysis. It is primarily employed for predicting continuous values, such as salary, age, and other numerical outcomes.
This algorithm models the linear relationship between a dependent variable (y) and one or more independent variables (x). It demonstrates how the dependent variable changes in response to the independent variable.
Linear regression is an efficient algorithm for stock price prediction, providing insights that can help investors make informed decisions. In the paper Stock Market Analysis Using Linear Regression (Rishi, 2022), it was demonstrated that linear regression can effectively predict the closing prices of stocks in the S&P 500.
The study revealed that the most significant predictors are the opening price and the highest and lowest prices of the day. The initial model showed multicollinearity, which was addressed by simplifying the model to include only the most consistent predictor (Open price) along with Volume. The final model achieved a high R-squared value, indicating strong predictive power.
II. Decision Tree
A Decision Tree is a supervised learning technique that can be used for both classification and regression tasks, but it is primarily preferred for solving classification problems. It is a tree-structured classifier, where:
- Root Node: The starting point of the tree where the first test is applied.
- Internal Nodes: Nodes where decisions or tests on data attributes are made.
- Branches: Represent the outcome of the test and lead to the next node.
- Leaf Nodes: Represent the final decision or prediction (e.g., buy, sell, hold).
By analyzing features such as the Open-Close and High-Low differences, decision trees can predict whether stock prices will rise or fall. The paper (Xu, 2024) demonstrates that decision tree classifiers can achieve a good level of accuracy (74%) in predicting stock price movements, making them a useful method for investors and financial analysts
III. Support Vector Machine (SVM) Algorithm
A Support Vector Machine (SVM) is a supervised learning algorithm that can be used for both classification and regression tasks, though it is mainly utilized for classification problems. The objective of SVM is to construct a hyperplane or decision boundary that separates datasets into different classes.
The hyperplane in SVM is the optimal decision boundary that best classifies the data points in an n-dimensional space. While there can be multiple lines or decision boundaries that separate the classes, the hyperplane is the one that maximizes the margin between the different classes, ensuring the best classification.
The data points that determine the position of the hyperplane are called support vectors, which give the algorithm its name: Support Vector Machine.
In algorithmic trading, SVMs can be applied to classify market conditions and identify profitable trading opportunities. While SVMs can classify favorable buy conditions based on historical price data, their performance is highly sensitive to hyperparameter settings and specific market conditions. (Blokker, 2008)
IV. Naïve Bayes Algorithm
The Naïve Bayes classifier is a supervised learning algorithm used to make predictions based on the probability of an outcome. It is named “Naïve Bayes” because it is based on Bayes’ theorem and operates under the naive assumption that variables are independent of each other. Bayes’ theorem relies on conditional probability, which calculates the likelihood of event A occurring given that event B has already occurred.
By leveraging the Gaussian Naïve Bayes algorithm and appropriate feature scaling and extraction techniques, investors and analysts can enhance the accuracy of their stock market predictions, (especially when combined with Linear Discriminant Analysis) potentially leading to better investment decisions and reduced risks- (Ampomah, 2021).
V. K-Nearest Neighbour (KNN)
K-Nearest Neighbour (K-NN) is a supervised learning algorithm used for both classification and regression tasks. It operates on the assumption that similar data points exist in close proximity to each other. By comparing a new data point to the existing data points, K-NN assigns the new data to the category that is most similar to its nearest neighbors.
Known as a lazy learner algorithm, K-NN stores all available data and classifies new instances by calculating similarities to the stored data points using a distance function. This distance function measures how close the new data point is to the existing data, ensuring it is placed in the nearest and most similar category.
In the context of stock price prediction, KNN assumes that similar stock price patterns in the past can help predict future prices. The algorithm’s performance, (particularly with distance weighting), and the ability to handle large datasets demonstrate its capability to provide accurate and reliable stock price predictions, making it a valuable asset for market participants (Urlamma, 2023).
VI. Random Forest Algorithm
Random Forest is a widely used machine learning algorithm within the supervised learning category. It is applicable to both classification and regression tasks. The algorithm is based on ensemble learning, which combines multiple classifiers to solve complex problems and enhance model performance. As its name implies, a Random Forest consists of numerous decision trees generated from various subsets of the dataset. It aggregates the predictions of these trees to improve the overall accuracy.
Instead of relying on a single decision tree, the Random Forest algorithm takes the prediction from each tree, and the final output is determined by the majority vote of these predictions. Increasing the number of trees in the forest typically enhances accuracy and mitigates the risk of overfitting. While the Random Forest model demonstrates the potential for generating profitable trading signals, its application requires careful parameter tuning and robust validation to avoid overfitting.
Random Forest algorithms are highly capable of handling the complex and volatile nature of stock market data, making it a powerful tool for predicting stock price directions. By leveraging multiple decision trees, each trained on different subsets of data, overfitting is reduced and prediction accuracy is increased which makes this algorithm a valuable tool for investors. In some cases, the Random Forest algorithm outperforms other models like SVM, logistic regression, Gaussian discriminant analysis, and quadratic discriminant analysis- (Khaidem, 2016).
The Bottom Line
Machine learning enables computers to learn from data and improve their performance without explicit programming. It uses algorithms to identify patterns, make decisions, and predict outcomes. Positioned at the intersection of computer science and statistics, it is central to artificial intelligence and data science. Key concepts include features, labels, algorithms, models, and training data. Machine learning is categorized into supervised, unsupervised, semi-supervised, and reinforcement learning, addressing various tasks such as classification, regression, and clustering. Algorithms like Linear Regression, Decision Trees, SVM, Naïve Bayes, KNN, and Random Forests are commonly used, especially in trading.