AI in Python: The Secret of This Language's Algorithms
What do you know about algorithms? Today they are increasingly part of our daily lives: we have all heard something about algorithms in Google or Facebook. Briefly, they are a set of instructions that can be applied in computer programming and its languages. If you want to learn to develop AI algorithms in Python (one of the most valued programming languages by professionals), at Tokyo School we will explain how it works and the various types of machine learning.
Artificial intelligence algorithms are developed to create machines with capabilities similar to human ones.
How is artificial intelligence created?
Want to know the main keys to programming artificial intelligence? This technology has its advantages and disadvantages. Becoming an increasingly important part of computing systems, companies are increasingly in need of specialists capable of programming it.
Artificial intelligence is understood as a technology that allows creating machines that imitate functions related to knowledge, such as problem-solving or reasoning processes. Its operation is based on algorithms, i.e., a set of rules that facilitate the solution of a problem.
AI technologies can be developed to solve many problems: medical applications, search engines, market value analysis, speech recognition, games, facial recognition, robotics, etc.
Types of Artificial Intelligence Algorithms
Artificial intelligence is based on automatic learning or machine learning – a field of computer science responsible for making machines "learn".
AI in Python can be developed using various types of machine learning algorithms. Let's look at them in more detail.
Reinforcement Learning
Also known as RL, the intelligent agent learns through the use of reward or punishment, depending on its successes or failures, without the need for an instructor to tell it what to do.
When using this type of algorithm, agents learn by observing behavior in a given environment and learn to make the right decisions to achieve goals. This type of learning is based on a trial and error system. An example of reinforcement learning is an AI capable of playing chess, such as AlphaZero or DeepMind.
Dynamic programming, Q-Learning, and SARSA (state-action-reward-state-action) are the main algorithms used in this type of learning.

Supervised Learning
Supervised machine learning is based on predictive models that use training data. Using information extracted from the data, the agent is able to produce a certain output. Thus, the model is tuned (trained) to handle the corresponding results.
Autonomous cars are a clear example of this type of learning. It can also be very useful for solving scientific research problems where the system learns to label (classify) certain vectors into specific categories (classes).
Decision trees, Naive Bayes classifiers, logistic regression, support vector machines (SVM), or ordinary least squares regression are the main algorithms used for this type of learning.
Unsupervised Learning
In this type of learning, modeling is done based on sets of examples created only from system records, without any information about the categories of the examples. The system must attempt to recognize patterns to label new records.
In unsupervised machine learning, the algorithm performs self-learning without needing external instructions.
The main algorithms of this type of learning include
- Clustering algorithms
- Principal Component Analysis (PCA)
- Independent Component Analysis (ICA)
- Singular Value Decomposition (SVD)
Semi-supervised Learning
In this type of learning, the algorithm mixes concepts of supervised and unsupervised learning to obtain adequate classification. It uses both labeled and unlabeled data.
Transduction
Although transduction is somewhat similar to supervised learning, the function is not built explicitly. Thus, the system predicts categories of future examples based on input examples, their categories, and new examples.
Multi-task Learning
This type of learning uses knowledge previously acquired by the system to solve tasks similar to those already encountered.


