Machine Learning in Python
Machine Learning in Python
Monday,
January 23,
2023
Topics of the course
• The Python Language
• Implement in technical detail the scripts needed to train and test a model
Monday,
January 23,
2023
What is Artificial Intelligence?
• The term Artificial Intelligence refers to the ability of a machine to
mimic human intelligence and perform tasks that would normally
require human intelligence
• Types of AI: Reactive Machines, Limited Memory, Theory of Mind and
Self-Aware
• Applications of AI: Healthcare, finance, transportation, and
manufacturing
• Advancements in AI: Deep Learning, Reinforcement Learning,
Natural Language Processing
• Challenges in AI: Data privacy, bias, interpretability
• Future of AI: Impact on society, economy and the future of work,
research, and development
Monday,
January 23,
2023
The evolution of AI
The evolution of AI
1943 – Warren McCulloch and Walter Pits published the paper “A Logical Calculus of Ideas Immanent in Nervous Activity” which was the first work on artificial
intelligence (AI) in 1943. They suggested an artificial neuron model.
1949 – Donald Hebb proposed the theory for modifying connection strength between neurons in his book The Organization of Behavior: A Neuropsychological
Theory
1950 – Alan Turing, an English mathematician published “Computing Machinery and Intelligence” in which he proposed a test to determine if a machine has the
ability to exhibit human behavior. This test is famously knows as the Turing Test.
In the same year, Harvard graduates Marvin Minsky and Dean Edmonds built the first neural network computer named SNARC.
1956 – The “first artificial intelligence program” named “Logic Theorist” was constructed by Allen Newell and Herbert A. Simon. This program verified 38 of 52
mathematical theorems, as well as discovering new and more elegant proofs for several of them.
In the same year, the word “Artificial Intelligence” was first adopted by John McCarthy, an American scientist at the Dartmouth Conference and was coined for the first
time as an academic field.
The enthusiasm towards Artificial Intelligence grew rapidly after this year.
1957 – Frank Rosenblatt presents "The Perceptron: A Probabilistic Model for Information Storage and Organization in the Brain".
1959 – Arthur Samuel coined the term machine learning while he was working at IBM.
1966 – Joseph Weizenbaum created the first ever chatbot named ELIZA.
Monday,
January 23,
2023
The evolution of AI
1972 – The first humanoid robot was built in Japan named WABOT-1.
1974 to 1980 – This period is famously knows as the first AI winter period. Lot of scientists could not pursue/continue their research to the best extent
as they fell short of funding from the government and the interest towards AI gradually declined.
1980 – AI was back with a bang! Digital Equipment Corporations developed R1 which was the first successful commercial expert system and officially
ended the AI winter period.
In the same year, the first ever national conference of American Association of Artificial Intelligence was organized at Stanford University.
1987 to 1993 – With emerging computer technology and cheaper alternatives, many investors and the government stopped funding for AI research
leading to the second AI Winter period.
1997 – A computer beats human! IBM’s computer IBM Deep Blue defeated the then world chess champion, Gary Kasparov, and became the first
computer/machine to beat a world chess champion.
2005 – The American military started investing in autonomous robots such as Boston Dynamics’ “Big Dog” and iRobot’s “PackBot.”
2006 – Companies like Facebook, Google, Twitter, Netflix started using AI.
Monday,
January 23,
2023
The evolution of AI
2008 – Google made a breakthroughs in speech recognition and introduced the speech recognition feature in the iPhone app.
2011 – Watson – an IBM computer, won Jeopardy in 2011, a game show in which it had to solve complicated questions and riddles. Watson had
demonstrated that it could comprehend plain language and solve complex problems fast.
2012 – Andrew Ng, the Google Brain Deep Learning project’s founder, fed 10 million YouTube videos into a neural network using deep learning
algorithms. The neural network learnt to recognise a cat without being informed what a cat is, which marked the beginning of a new era in deep
learning and neural networks.
2014 – Google made the first self-driving car which passed the driving test.
2016 – Hanson Robotics created the first “robot citizen,” Sophia, a humanoid robot capable of facial recognition, verbal conversation, and facial
emotion.
2020 – During the early phases of the SARS-CoV-2 pandemic, Baidu made its LinearFold AI algorithm available to scientific and medical teams
seeking to create a vaccine. The system could anticipate the virus’s RNA sequence in just 27 seconds, which was 120 times faster than prior methods.
Monday,
January 23,
2023
AI and their
applications
BUT!
The development of AI is a
complex and evolving field and
there are different views on how to
categorize the different types of AI,
these are just some of them!
Clinic experimentation
• AI-powered drug discovery and
development
• AI-powered clinical trial matching and
patient recruitment
• AI-powered data analysis and insights
generation
HR, Organization,
Leadership:
• AI-powered fraud detection and
prevention systems
• AI-powered portfolio management and
risk assessment
• AI-powered financial forecasting and
prediction
• AI-powered traffic
management and
optimization
• AI-powered logistics and
supply chain management
• AI-powered fleet
management
• AI-powered property
valuations and pricing
• AI-powered property
management
• AI-powered investment
analysis
In the context of AI, transformers are a type of neural network architecture that have been used to achieve
state-of-the-art performance on a wide range of natural language processing (NLP) tasks. The transformer
architecture was introduced in a 2017 paper by Google researchers, "Attention is All You Need". The
transformer architecture is based on the idea of self-attention, which allows the model to weigh the importance
of different words in a sentence when making predictions. This contrasts with traditional RNN (recurrent neural
network) and CNN (convolutional neural network) architectures that process input sequences in a fixed order,
such as left-to-right or last-to-first. Transformers have been used to power many recent NLP models, such as
BERT, GPT-2, and T5, which have achieved state-of-the-art results on a wide range of natural language
understanding tasks, including question answering, language translation, and text summarization.
Monday,
January 23,
2023 Titolo della Presentazione/Sezione 29
• AI-powered image generation model developed by OpenAI.
• Based on the transformer architecture, which allows it to generate images from text descriptions by
attending to specific words in the description.
DALL·E 2 - • Pre-trained on a large dataset of images and their associated text descriptions, and can then generate new
images by conditioning on a new text description.
OpenAI • DALL-E generates images by sampling from a probability distribution over images, which is estimated
based on the input text and the model's pre-trained parameters. The model can generate new images that
are not present in the training set and also can generate images for texts that are not present in the
training set.
BERT (Bidirectional Encoder
Representations from Transformers)
•Coding skills are in high demand, and can lead to career opportunities in fields such as software
development, data science, and artificial intelligence.
•Coding allows you to automate repetitive tasks, making you more productive and efficient.
•Coding can also be used to create tools that can help solve real-world problems.
•Understanding how to code gives you a better understanding of how technology works, and how it
can be used to improve your life and the lives of others.
Monday,
January 23,
2023
Coding Basics
Flowchart: an ancient yet important tool
•Flowchart is a diagram that represents a process, a system or an algorithm
•Flowchart can help to visualize the steps of the process, the decisions to be made and the
possible outcomes.
•Flowchart can be a powerful tool to help you plan and organize your code, making it more
readable and maintainable.
•Flowchart is used in many fields such as software development, business, and engineering.
•Flowchart is a great tool for communicating with others, specially when working in a team.
Monday,
January 23,
2023
Coding Basics
Different types of programming languages
•There are many different types of programming languages, each with its own strengths and use cases.
•Different types of programming languages are suited for different tasks, and it's important to choose the right language for
a specific project.
•Some languages are more popular and in-demand than others, and it's important to be aware of these trends when
choosing a language to learn.
Monday,
January 23,
2023
Machine Learning
What is Machine Learning?
• Machine learning is a subset of artificial intelligence that involves training computer models to
learn from data and make predictions or decisions without explicit instructions.
• The goal of machine learning is to build models that can learn from data and generalize to new
unseen data.
• Machine learning can be used to solve a wide range of problems, such as image recognition,
natural language processing, and predictive modeling.
Monday,
January 23,
2023
Machine Learning
The main mathematical tools to define and deal with ML
• Linear algebra: It's used to deal with matrices and vectors, which are the main data structures
used in ML.
• Calculus: It's used to optimize the parameters of ML models and also to understand the
behavior of the models.
• Probability and statistics: It's used to reason about the uncertainty of the data and the
models.
• Information theory: It's used to understand the amount of information that a variable contains.
Monday,
January 23,
2023
Machine Learning
Some basics applications and projects to get started
• Image classification: Train a model to recognize different objects in images.
Monday,
January 23,
2023
Machine Learning
How Python can help with our projects
• Python libraries such as scikit-learn, TensorFlow, and Keras make it easy to implement and
experiment with machine learning algorithms.
• Python's readability and simplicity make it easy to learn and understand the basics of machine
learning.
• Python libraries also provide pre-trained models and utilities to handle common machine
learning tasks such as data preprocessing and model evaluation.
• Python can be used for data visualization, data analysis, and data preprocessing making it a
great choice for end-to-end machine learning projects.
Monday,
January 23,
2023
Introduction
to Python
Python
Some words on Python
•Python is a high-level, general-purpose programming language that is widely used for web
development, data science and artificial intelligence.
•Python is known for its simplicity and readability, which makes it a great language for beginners.
•Python has a large and active community, which has created a wide range of libraries and
frameworks that can be used to solve a wide range of problems.
•Python is versatile and can be used for a wide range of tasks such as web scraping, automation,
data analysis, machine learning, and more.
•Python is one of the most popular programming languages and is in high demand in many
industries, making it a valuable skill to learn.
Monday,
January 23,
2023
Python
The main Python libraries for Machine Learning
• NumPy, for numerical computing
• TensorFlow, Keras, PyTorch, and other deep learning libraries for implementing and training
neural networks.
Monday,
January 23,
2023
Introduction to
Google
Colaboratory
Click me!
Monday,
January 23,
2023