Sunday 13 December 2015

Think!




This sign on the left is found at a coffee shop in Singapore. A customer has a choice –after queuing for food – you queue again for drinks, or wait for an uncle/auntie who takes drinks orders and you pay upon delivery. The sign shows a productivity drive by the coffee shop owner.

Productivity can be defined as output per worker; so by encouraging customers to by-pass the uncles and aunties and going straight to queue themselves, there are less workers for roughly the same volume of drinks sold; abracadabra! Productivity goes up. The coffee shop owners might even gain even more: http://www.mom.gov.sg/newsroom/press-releases/2015/0819-leds

People who have lived in Singapore for a while will certainly understand that using the terms ‘productivity’ and ‘efficiency’ are words that push people to action. And there now is a long queue of customers at the drinks stall, and fewer uncles/aunties employed to collect orders.

As customers, what have we gained?

1.      Are the drinks cheaper? No.
2.       Is the waiting time for drinks shorter? No, on the contrary, instead of preparing 5 hot coffees,5 teas, and 3 milos the people manning the counter have to prepare them individually, increasing the time taken for each drink.


So we are paying the same amount for the drinks, only we are spending time queuing rather than spending the time with our friends and families and sharing a full meal together.

This is a simple example of an organization shifting costs to the end customer. The customer ‘pays’ more and the organization reaps savings. What savings? Some of the uncles/aunties are no longer seen at the coffee shop. I found one uncle, at a coffee shop in the next town, presumably further from his home.

So my question is, why do we as customers help these organisations fire people who obviously need the jobs?

I was having dinner with this friend last week and she was arguing that no one can stop progress automation…. Please, think!

This is not automation, no some soulless blind machine taking over the jobs of these uncles and aunties. We, as customers are actively taking hammers to the rice bowls of the uncles and aunties by reacting like Pavlovian dogs to the words ‘productivity’ and ‘efficiency’. We are choosing to take the extra effort upon ourselves to drive these people out of their livelihoods. And they might end up on the right side of the picture above, a cardboard auntie’s life is much harder than a drinks auntie’s life.

Think people, think!

I would have no problem paying an extra 5 or 10 cents per cup of coffee that would have meant the uncle/aunties could retain their jobs; I can’t be the only one right?

Thursday 26 November 2015



Italian Wines and k-means

I had a couple of hours to kill, and given that I have some high class friends who requested a piece on wine rather than single malts (ok, some people will complain it’s Italian, but still…). I am trying to show how easily a simple old fashioned algorithm like k-means (it is about 50 years old) can do a decent job of classifying data. I am also trying to show that it is important to know what you are trying to do and choose the right algorithm and the right way to apply it.



The starting point is the wine dataset, a chemical analysis of wines grown in the same region in Italy but derived from three different cultivars (you’ll have to taste and decide which is which, if you do please let me know), and there are 13 different dimensions: alcohol, malic acid, ash, alkalinity of ash, magnesium, total phenols, flavonoids, non-flavonoid phenols, proanthocyanins, colour intensity, hue, od280/od315 of diluted wines and proline. The dataset contains 178 data points classed into the 3 cultivars which I split into a training and validation dataset.

Basically I am trying to get k-means to learn what makes each cultivar (k-means works on centroids, hence the centroid can be thought as the ‘typical’ chemical composition of that cultivar) from the training dataset, then apply it to the validation dataset. The metric I will use for accuracy is simply the percentage of correctly classified cultivars.

First, I blindly applied k-means. We already know that the actual number of clusters in the distribution is 3, so I set K to 3 and use all the variables. 

This is what a simple visualisation of actual distribution of the validation dataset looks like; each node represents a wine type; they are colour coded as per the cultivar they belong to: red for cultivar 1, green for cultivar 2 and blue for cultivar 3. 



Keeping the original colour scheme, we can see that k-means doesn’t do a very good job at predicting the right cluster for each cultivar.




Predicted
A
B
C
Actual
1
12
0
12
2
0
17
4
3
0
12
5

The accuracy of the kmeans is only 47%.

But if we decide to work off normalised values, the picture becomes much clearer:



Even visually this looks like a picture with clearer segments. Applying k-means on this normalised data:





K-means does a much better job at distinguishing the cultivars based on the normalised data:


Predicted
A
B
C
Actual
1
24


2
4
1
16
3

17


The accuracy of k-means jumps to 92%.

In conclusion, it pays to have a clear idea of what the objective is and use the right approach. In this example, it should have been obvious right from the outset that standardisation is necessary; without it the results would be skewed by the fact that the scales for the various measures are very different and this difference distracts from the aim of the analysis. Also, we can see that there sometimes is no need for very sophisticated techniques, and a quick piece of analysis can deliver reasonable results with some fore-thought.
 
The original source of the data is:  https://archive.ics.uci.edu/ml/datasets/Wine

Tuesday 18 August 2015



Flowers from the pope

I was intrigued and excited by the fact that the pope came up with an encyclical on the environment, however, was a bit lazy to digest all 246 paragraphs/75 pages and wanted to get a quick understanding of what it was all about before deciding whether to read it all.
After all if the leader of one of the more popular religions in the world decided to speak about the environment and his followers listened and practiced, it would make a great impact on everyone’s lives, and would also help everyone push in the same direction.



I chose this visualisation of the encyclical on the environment because it looks like a bunch of flowers. At the centre of it all is “human life”
The main themes around human life are:
                Human roots and modern anthropocentrism in the ecological crisis,
                Human beings,
                The gospel of creation
                Our common home,
                Ecological education and spirituality
                Common good.

Zooming on the “gospel of creation” theme:


We can see that the pope refers to the gospel of creation in relationship to human life and the place of human beings in the universe among biblical creatures. The encyclical elaborates, obviously on the role of Jesus, God and the Lord, but also on all creatures on earth. This concern for all creatures is a recurrent theme in the encyclical.



The pope speaks of “our common home” and clearly sketches some of the main issues that affect our lives: loss of species biodiversity, debt, water issue, breakdown and decline of human life, and climate change pollution and waste in many countries, the breakdown of human life.
He links this all to human beings, we are responsible for this and we are called to do something about it.
The pope links ecological education and spirituality, He clearly links the ecological crisis to human beings and affecting our common good.
Looking at the details:


He speaks of the equation of love and civic gestures, how to show love, changes in lifestyle and the need for humility, community and the need for education and the eucharist. He obviously sees a role for religion in achieving the changes in lifestyle necessary.

The pope makes it very clear that we have to aim for the common good; that the roots of the ecological crisis is modern anthropocentrism, that our common home and human life are affected by climate change, that economy and politics, as well as social principles and various groups within society have a huge role to play for our common good. In other words, it all depends on us.

The strongest message, to me, is the idea that the ecological crisis has human roots and is caused by modern anthropocentrism.  This concept is obviously linked to human beings, human life, our common good and ecological education and spirituality.
Focusing on the  details:


The pope goes further by talking about genetic mutations caused by us humans, and the role of technology:


We have to re-evaluate the technocratic paradigm and its role in the ecological crisis.

The pope doesn’t simply talk of big themes, he has very critical messages embedded in his encyclical:

The pope voiced his concern about plant and animal disappearance
Not only plants and animals, but also the oceans are within the scope of this encyclical.
He called for solidarity across generations, basically stating the culture of the now is to blame for some of the environmental issues
In order to make changes, according to the pope, there needs to be pressure on policies at all levels, local and national.
And he followed his calls by exhorting his flock to follow the example of Saint Francis.

Overall, this quick summary has convinced me to take a look at what the pope has to say in more detail. If you are interested in the full document, it can be found at: