Machine learning for beginners

Nour Ouhichi
7 min readJul 5, 2020

Introducing a revolutionary field in easy words

One of the main differences between humans and computers is that humans have the ability to learn from past experience whereas computers need to be told what to do and need to be programmed to follow instructions in order to perform tasks. Now the question is, can we get computers to learn from past experience too? And the answer is yes, and that is precisely what machine learning is. When talking about computers , past experiences are called observations or data, such as examples, direct experience, or instruction, in order to look for patterns in data and make better decisions in the future based on the examples that we provide..In the next few minutes I am going to introduce you some examples in which we can teach a computer how to learn from previous data and most importantly I am going to show you that these algorithms are very easy and the machine learning is really nothing to fear, but first let us have a quick look at the history of ML, how did it start and when?

Some History

“The term machine learning was coined in 1959 by Arthur Samuel, an American IBMer and pioneer in the field of computer gaming and artificial intelligence. A representative book of the machine learning research during the 1960s was the Nilsson’s book on Learning Machines, dealing mostly with machine learning for pattern classification.Interest related to pattern recognition continued into the 1970s, as described by Duda and Hart in 1973. In 1981 a report was given on using teaching strategies so that a neural network learns to recognize 40 characters (26 letters, 10 digits, and 4 special symbols) from a computer terminal.

Tom M. Mitchell provided a widely quoted, more formal definition of the algorithms studied in the machine learning field: “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E.”This definition of the tasks in which machine learning is concerned offers a fundamentally operational definition rather than defining the field in cognitive terms. This follows Alan Turing’s proposal in his paper “Computing Machinery and Intelligence”, in which the question “Can machines think?” is replaced with the question “Can machines do what we (as thinking entities) can do?”

Wikipedia

Definition

There is no harm in getting a little bit technical. The best definition of machine learning would be saying that it is an application of artificial intelligence previously mentioned as the concept of providing systems with the ability to automatically learn and improve from experience without being explicitly programmed.

Applications

There are many applications for machine learning, including:

  • Virtual Personal Assistants. Siri, Alexa, Google Now are some of the popular examples of virtual personal assistants. …
  • Predictions while Commuting. …
  • Videos Surveillance. …
  • Social Media Services. …
  • Email Spam and Malware Filtering. …
  • Online Customer Support. …
  • Search Engine Result Refining. …
  • Product Recommendations.

Main approaches

Machine learning approaches are traditionally divided into three broad categories, depending on the nature of the “signal” or “feedback” available to the learning system:

  • Supervised learning: The computer is presented with example inputs and their desired outputs, given by a “teacher”, and the goal is to learn a general rule that maps inputs to outputs.
  • Unsupervised learning: No labels are given to the learning algorithm, leaving it on its own to find structure in its input. Unsupervised learning can be a goal in itself (discovering hidden patterns in data) or a means towards an end (feature learning).
  • Reinforcement learning: A computer program interacts with a dynamic environment in which it must perform a certain goal (such as driving a vehicle or playing a game against an opponent). As it navigates its problem space, the program is provided feedback that’s analogous to rewards, which it tries to maximise.

Other approaches have been developed which don’t fit neatly into this three-fold categorisation, and sometimes more than one is used by the same machine learning system. For example topic modeling, dimensionality reduction or meta learning.

As of 2020, deep learning has become the dominant approach for much ongoing work in the field of machine learning .

Supervised Learning made easy

observations or data, such as examples, direct experience, or instruction, in order to look for patterns in data and make better decisions in the future based on the examples that we provide.

Why is it Important?

Learning gives the algorithm experience which can be used to output the predictions for new unseen data
Experience also helps in optimizing the performance of the algorithm
Real-world computations can also be taken care of by the Supervised Learning algorithms

Unsupervised learning made easy

A friend invites you to his party where you meet totally strangers. Now you will classify them using unsupervised learning (no prior knowledge) and this classification can be on the basis of gender, age group, dressing, educational qualification or whatever way you would like. Why this learning is different from Supervised Learning? Since you didn’t use any past/prior knowledge about people and classified them “on-the-go”.

Why is it important ?

Unsupervised learning is very useful in exploratory analysis because it can automatically identify structure in data.

Reinforcement learning made easy

Here are some important terms used in Reinforcement AI:

  • Agent: It is an assumed entity which performs actions in an environment to gain some reward.
  • Environment (e): A scenario that an agent has to face.
  • Reward (R): An immediate return given to an agent when he or she performs specific action or task.
  • State (s): State refers to the current situation returned by the environment.
  • Policy (π): It is a strategy which applies by the agent to decide the next action based on the current state.
  • Value (V): It is expected long-term return with discount, as compared to the short-term reward.
  • Value Function: It specifies the value of a state that is the total amount of reward. It is an agent which should be expected beginning from that state.
  • Model of the environment: This mimics the behavior of the environment. It helps you to make inferences to be made and also determine how the environment will behave.
  • Model based methods: It is a method for solving reinforcement learning problems which use model-based methods.
  • Q value or action value (Q): Q value is quite similar to value. The only difference between the two is that it takes an additional parameter as a current action.

In this case,

  • Your cat is an agent that is exposed to the environment. In this case, it is your house. An example of a state could be your cat sitting, and you use a specific word in for cat to walk.
  • Our agent reacts by performing an action transition from one “state” to another “state.”
  • For example, your cat goes from sitting to walking.
  • The reaction of an agent is an action, and the policy is a method of selecting an action given a state in expectation of better outcomes.
  • After the transition, they may get a reward or penalty in return.

Why is it important?

Here are important characteristics of reinforcement learning:

  • There is no supervisor, only a real number or reward signal
  • Sequential decision making
  • Time plays a crucial role in Reinforcement problems
  • Feedback is always delayed, not instantaneous
  • Agent’s actions determine the subsequent data it receives

Limitations

Although machine learning has been transformative in some fields, machine-learning programs often fail to deliver expected results.Reasons for this are numerous: lack of (suitable) data, lack of access to the data, data bias, privacy problems, badly chosen tasks and algorithms, wrong tools and people, lack of resources, and evaluation problems.

In 2018, a self-driving car from Uber failed to detect a pedestrian, who was killed after a collision. Attempts to use machine learning in healthcare with the IBM Watson system failed to deliver even after years of time and billions of investment.

Bias

Machine learning approaches in particular can suffer from different data biases. A machine learning system trained on current customers only may not be able to predict the needs of new customer groups that are not represented in the training data. When trained on man-made data, machine learning is likely to pick up the same constitutional and unconscious biases already present in society.Language models learned from data have been shown to contain human-like biases.Machine learning systems used for criminal risk assessment have been found to be biased against black people. In 2015, Google photos would often tag black people as gorillas,and in 2018 this still was not well resolved, but Google reportedly was still using the workaround to remove all gorillas from the training data, and thus was not able to recognize real gorillas at all.Similar issues with recognizing non-white people have been found in many other systems. In 2016, Microsoft tested a chatbot that learned from Twitter, and it quickly picked up racist and sexist language.Because of such challenges, the effective use of machine learning may take longer to be adopted in other domains.Concern for fairness in machine learning, that is, reducing bias in machine learning and propelling its use for human good is increasingly expressed by artificial intelligence scientists, including Fei-Fei Li, who reminds engineers that “There’s nothing artificial about AI…It’s inspired by people, it’s created by people, and most importantly it impacts people. It is a powerful tool we are only just beginning to understand, and that is a profound responsibility.

--

--

Nour Ouhichi

Software engineering student at Holberton school with the passion of sharing my knowledge. Simplified language articles about different programming languages.