Let’s use AI! — but what does it mean?

By – Raghav Chandra (co-founder UrbanClap)

UC Blogger
Urban Company – Engineering
6 min readAug 26, 2019

--

Interesting Fact: PACMAN – a very popular arcade game. This game is used in computer science courses to teach Machine Learning concepts where students build a Bot to play. Infact, students compete against each other’s bots. In the above picture, you can see a representation of two agents and the reward heat-map.

Hypothetically, let’s build a startup – rent a bed for a night – for travellers – we have created an app to help consumers book their beds – business model is simple – pay per night for a bed. We have homes across the city with beds.

Let’s use AI! Thats what we keep hearing, but what does it mean?

In this short blog, I’ll introduce the basics on Artificial Intelligence (AI) and Machine Learning (ML). We will try to understand buzz words like – #AI , #ML , #DeepLearning – and sneak peak into what they actually do.

You will not become a data expert by reading this. But hopefully, it will help de-mystify the world of data, make it more real, and give you a more realistic grasp on how these could help.

Day 0. We launch our startup with a fixed pricing model. Payment is online-pre-paid or cash-after-stay.

What is ARTIFICIAL INTELLIGENCE?

Simply put, machines exhibiting human intelligence.

If a machine / software is making decisions that a human would have made, that’s AI. Now, you can further divide this into two parts based on who is doing the “learning” / “insight finding”.

Learning by Human, Decision by Machine

This is when you give the machine explicit rules to do some work.
Humans rely on their intuition and knowledge to model simplistic functions for decision making. These could be in the form of if / then / else. These could also be complex mathematical functions like Y = AX₁ + BX₂.

#RuleBased

Day 1. Demand on weekends is more. We want to increase the weekend prices.
We run a few A/B tests on pricing (if/else) and choose the one with the best results.

Learning by Machine, Decision by Machine

This is MACHINE LEARNING. Its a field within AI wherein the machine is able to process data and self-improve its ability to make decisions – its able to learn.
Since machine has no prior context, it requires a lot of data as knowledge (historic, or real time) and feedback (rewards, or targets) to train and learn on.

#MachineLearning

While this allows for machines to self-learn, it comes with some obvious tradeoffs.

  • Machine learning requires “enough” data to make a smart decision. Too many variables, too little data, or biased data (lack of diversity) might lead to untrained and biased models.
  • Some ML techniques are complex structures that are black-boxes for humans (eg – Deep Learning techniques). It’s very hard to interpret the system.
Venn Diagram showing how the three relate to each other.

What can Machine Learning do?

Broadly, three genres of problem ML can help solve.

UNSUPERVISED LEARNING — trying to classify (unlabelled data)

You have unlabelled data and you are looking for patterns in this data.

  • Use cases — Clustering, Dimensionality Reduction (find the best representation of the data with fewer dimensions), Anomaly Detection (observations which do not follow the data set patterns)
  • Most of the time unsupervised learning is used to pre-process the data during an exploratory analysis or to pre-train supervised learning algorithms.
Different kinds of clustering algorithms

Day 2. Just like weekends, we feel some localities have higher demand than others. Instead of doing it manually, this time, we feed our geo-tagged request data to a clustering algorithm that splits localities into 3 buckets (low, med, high) based on revenue and publicly available real-estate cost. #UnsupervisedLearning

We go back to A/B testing the right price here, running multiple experiments to optimise the revenue.

SUPERVISED LEARNING – trying to predict (labelled data)

You have labelled data against a target/value/class to predict. Your model learns on this data and tries to predict the result on new data. Hence the model is supervised, it knows what to learn.

  • Use cases – Image Recognition, Speech Recognition, Forecasting
  • Types – Linear and Logistic Regression, Support Vector Machine, Naive Bayes, Neural Network, Gradient Boosting, Classification Trees and Random Forest
(left) Unsupervised — where we try to classify a given data set. (right) Supervised — where we try to predict based on existing data.

Day 3. We realise that there are a lot of last minute cancellations. This hurts our business. We have to do something to curtail this. What if we allowed online-payment only? It probably forces users to think more before paying.
We get user behaviour attributes and if they cancelled – past transaction history, browsing behaviour, etc. We feed this as training data to a Supervised Learning technique to predict if a user is likely to cancel. #SupervisedLearning

We use this to flag if a user should be forced to pay online.

REINFORCEMENT LEARNING – trying to optimise path (on-the-go rewards)

You want to attain an objective by a set of actions. For example, you want to find the best strategy to win a game with specified rules. Once these rules are specified, reinforcement learning techniques will play this game many times to find the best strategy.

  • An agent learns to develop an optimal policy of sequential actions to take by interacting with an environment.
  • While supervised learning helps in making a single decision based on a data set, reinforcement learning helps in choosing actions based on a dynamically changing environment and reward optimisation.
AI Bots in games use Reinforcement Learning to dynamically act and learn

Day 4. We want to improve on our differential pricing that we had for weekends. We realise high demand slots are not just weekends but across the week. We want to build dynamic pricing which implements surge based on the available capacity and traffic. We could experiment with a few intuitive answers, but we decide to use ML.
We model the problem – Successful conversion is a reward. Capacity and traffic are environments. Surging up is the action. We let the model learn and optimise on when to show surge and when not to. #ReinforcementLearning

What is DEEP LEARNING?

( pic credit: https://greydanus.github.io )

A technique for implementing Machine Learning. Deep learning can help in all the Machine Learning use cases (supervised, unsupervised, reinforcement). This involves modelling the problem as a multi-layer neural network (how a human brain is suppose to work). These are complex because they are non linear – making them a black-box for humans and are best suited for really complex and large data sets. (there are obvious tradeoffs here of interpretability)

DISCLAIMER: The article is a simplification of concepts in artificial intelligence for the purpose of fostering enthusiasm and basic context to get started. If interested, do reach out , or read more.

About the author:
Raghav Chandra is a co-founder at UrbanClap. He prefers functional programming and often imagines the world as platforms / systems. He wrote this blog as an extension to an internal presentation he did with non-tech leaders on what AI means.

Sounds like fun?
If you enjoyed this blog post, please clap 👏(as many times as you like) and follow us (UrbanClap Blogger) . Help us build a community by sharing on your favourite social networks (Twitter, LinkedIn, Facebook, etc).

You can read up more about us on our publications —
https://medium.com/urbanclap-design
https://medium.com/urbanclap-engineering

If you are interested in finding out about opportunities, visit us at http://careers.urbanclap.com

--

--

UC Blogger
Urban Company – Engineering

The author of stories from inside Urban Company (owner of Engineering, Design & Culture blogs)