Google Trends for 'iPhone slow' clearly shows a periodic spike in interest.
These spikes occur in September 2013, September 2014, September 2015, ....
The release schedule for iPhones is September 2013, September 2014, September 2015, ....
Is it coincidence that people search for 'iPhone slow' around the time of a new iPhone release? It seems not. Apple have now admitted (or partially admitted) that they do slow down older models, according to a BBC report they claim it was "to prolong the life of the devices". Other people suspect Apple deliberately slowed older models just before the release of each new iPhone to encourage iPhone users to upgrade.
In the Google Trends graph above interest searches for 'iPhone slow' rapidly spiked they gradually fell away, but in 2017 the pattern changed, the searches didn't fall away they continued and grew stronger. More people were perhaps becoming aware of what Apple has been up to.
Google trends shows some increased interest in wildfires this year:
Some recent headlines include:
"Southern California wildfires trigger mass destruction, hurting families, economy", Fox News
"California wildfires by the numbers: $177M spent, more than 1,000 structures destroyed", CNN
"Christmas wildfires: How climate change puts California at risk all year round", the Independent
Source of Dataset used in this analysis: Kaggle.
citation for data: Short, Karen C. 2017. Spatial wildfire occurrence data for the United States, 1992-2015 [FPA_FOD_20170508]. 4th Edition. Fort Collins, CO: Forest Service Research Data Archive. https://doi.org/10.2737/RDS-2013-0009.4
2017 seems to have been a bad year for California, is this part of a trend? The dataset covers the time period 1992 - 2015. If we plot the number of wildfires for each year in California in that time period we get:
The data does not suggest a strong trend either up or down, of course we are missing data for 2016 and 2017, perhaps a trend is developing in the last 3 years or so.
Of course it is not just the number of fires that is important, the size of the fires is also important. How has this changed over the two decades covered by the data?
As with the number of fires the average fire size does not show a definite trend. The third headline above makes a claim that climate change has made wildfires more common all year round, to test this we can extract data for two years, say 1993 and 2013 (20 years apart) and see if there is any difference in the number of fires per month:
Looking at just these two years we can say that the distribution of wildfires during the year is different. In 2013 wildfires are slightly more evenly distributed through the year while in 1993 they are slightly more concentrated in the summer months.
The majority of wildfires in CA are the result of human activity including arson. Natural fires due to lightning account for less than 15% of all wildfires in CA.
Is it possible to predict if a fire was started maliciously using Machine Learning?
The simple answer is yes. Using a Random Forest algorithm it is possible to get an accuracy of over 92% (for the data in the dataset). The algorithm uses the year, month and day of the week plus the latitude and longitude of the location where the fire started to predict if the fire was the result of arson.
Does AI pose a threat to society?
What is AI?
AI is an approach to problem solving which differs significantly from traditional computing.
Say we have a robot in an empty room and we want it to find the door and leave the room. The traditional computing approach to this problem would require programming the robot with specific instructions such as move forward 5 units, turn right by ninety degrees and so on. This approach will work but only for one starting position. It also requires precise knowledge about the location of the door and the starting point of the robot. The AI approach is to give the robot the ability to solve the problem by itself, this solution will work for all starting positions. In this case machine vision might be one possible solution. The robot has the ability to visually scan the room, the AI attempts to distinguish a door from walls and windows. Once it recognises a door it moves in that direction.
This kind of AI is not self-aware nor does it understand the concept of a door or the concept of leaving a room. It was trained to recognise doors and once the door is identified it will attempt to move in that direction.
Warnings about AI
Bill Gates and Stephen Hawking have both issued warnings about AI becoming too powerful. Also, earlier this year there was a twitter spat between Elon Musk and Mark Zuckerberg over the risks of AI and then a letter to the UN signed by a number of leading researchers and leaders in the tech industry warning of the dangers of weaponised AI.
Narrow v General
While the concerns being raised about AI becoming too powerful are sensible I think we are still a long way from the self-aware AI of science fiction movies which rises up and builds an army of human hating killing machines. The AI we have now is narrow intelligence – at best it can perform a task to a level which is as good as or better than a human expert. Much of the best AI we have is built around neural networks and the back-propagation algorithm. We will never get to general AI (self-aware machines) from back propagation. Geoffrey Hinton, the inventor of the back-propagation algorithm recently said: 'my view is throw it all away and start again'. It can never lead to true AI. This however does not mean that things like Machine Learning and Neural Nets will have no negative impacts on us. In the next fifteen to thirty years AI could directly affect millions of workers by the loss of jobs to machines. A recent report from PWC predicts that up to 30% of existing jobs in the UK could be automated out of existence, other industrialised countries can expect similar effects or worse. One report from the previous US administration put the figure closer to 50% in the US. If around one third to half of the working age population suddenly finds itself unemployed and possibly unemployable how will they react? AI is also being used in areas such as law enforcement and banking. In the future it may be an algorithm not a person who decides if you are eligible for a loan or if you are likely to commit a crime.
Artificial stupidity is perhaps more dangerous than artificial intelligence at least in the near term. Badly designed and poorly tested algorithms making decisions that impact people in the real world. And good old fashioned human ignorance also poses risks - politicians, business people and the military making decisions about the use of AI even though they don't understand the tech. There is also the danger of AI being hacked, and of hackers developing their own AI.
The way forward
My answer to the title question: 'does AI pose a threat to society?' Is yes it does. But it also offers many potential positives such as advances in medicine, engineering and business.
In the early 19th century a group of English workers, the Luddites, attempted to stop progress by smashing the machinery that was taking away their livelihood. They failed and the technology destroyed their ability to earn money. AI will not be stopped, it will change the world whether people and governments are ready or not.
The OECD measures life satisfaction across a number of countries. One of their findings is a link between education and satisfaction, people with more education are more satisfied. You can download the OECD data and test this for yourself. The graph below shows life satisfaction plotted against years spent in education, there is some indication of a positive correlation but this correlation is only 0.38 (measured using Spearman test).
There is a lot of scatter. If instead we look at earnings and satisfaction, the correlation coefficient is 0.74.
The correlation between earnings and education is also stronger at 0.41 than between satisfaction and education.
So perhaps the apparent correlation between Life Satisfaction and Education is actually due to a stronger correlation between wealth and satisfaction, the link being the more education you have the more likely you are to earn more. Maybe we are more materialistic than we like to admit.
This word cloud was generated by scraping Trump's twitter account for July and August:
Compare to a word cloud from May:
'Great' is a keyword for Trump. Other recurring themes and key words include America(n), job, media, fake, news, Russia(n), election, healthcare/Obamacare and thank. Trump's twitter account tends to be more positive than negative - apart from Fox he doesn't trust the media so Twitter is his main way of communicating his message and that message is more positive than negative.
The data set is available on Kaggle.
The code used to analyse the data is available here.
Plotting the number of casualties by state gives:
This is a little misleading, because CA, TX and so on are large populous states so it is not surprising that the greatest number of casualties came from these states. I added in state populations from 1967 and normalised the casualty rates per state, then plotted the data again:
This map suggests Missouri had a disproportionately large casualty rate normalised by state population compared to other states while California had a relatively low casualty rate.
Since 2011 Stackoverflow have conducted a developer survey. The raw data can be downloaded from here. The following is a brief analysis of part of the 2017 survey data. Specifically analysis of some factors affecting salary. David Robinson, data scientist at Stack Overflow found an unusual relationship between the use of tabs and spaces and salary. His R code is available here. I decided to see if I could recreate the results using Python and Pandas. My Python code is available here. The following graph clearly shows the relationship for the 2017 data.
The 2015 survey also includes spaces v tabs data but the salary and experience data is in a different format
making a direct comparison with the 2017 data difficult but it is possible to plot the data and see if there a similar correlation. The next graph shows that there may be a similar relationship.
It is difficult to explain this relationship however correlation does not mean causation. I also looked at the 2017 data for Masters v Degrees. When you take the overall average for developers with a Masters degree you find they have a slightly higher salary than developers with just a degree. However when you divide the data by experience this is no longer true. Now it seems having a Masters degree will negatively impact on your salary as you become more experience, see the graph below:
Again this is not what I expected.
The dataset is available here.
The following Python script shows the percentages of survivors for different groups:
import pandas as pd
df = pd.read_csv('titanic3.csv')
df_male = df[df['sex']=='male']
df_female = df[df['sex']=='female']
df_class_group = df.groupby('pclass').mean()
df_class_group_male = df_male.groupby('pclass').mean()
df_class_group_female = df_female.groupby('pclass').mean()
Only 38% of the passengers survived the sinking but this is only part of the story, we can dig down further
to see how belonging to different groups would determine a passenger's chances of survival. If we divide the passengers into male and female we can see that only 19% of male passengers survived whereas 73% of female passengers survived. We can also divide by class - there were 3 classes of ticket on the Titanic: first, second and third. The percentage survival rate (male and female) by class were:
If we divide by both gender and class:
It is clear that first class female passengers had the best chance of survival. It is also interesting that the class divisions break down for male second and third class passengers, in the case of male passengers being a second class passenger did not increase your chances of survival compared to male third class passengers.
The difference in ticket price:
The following website lists UK parliamentary petitions.
You can download the data in json or csv format.
The top ten petitions over the last few years are:
1 EU Referendum Rules triggering a 2nd EU Referendum
2 Prevent Donald Trump from making a State Visit to the United Kingdom.
3 Give the Meningitis B vaccine to ALL children, not just newborn babies.
4 Block Donald J Trump from UK entry
5 Stop all immigration and close the UK borders until ISIS is defeated.
6 Accept more asylum seekers and increase support for refugee migrants in the UK.
7 Consider a vote of No Confidence in Jeremy Hunt, Health Secretary
8 Donald Trump should make a State Visit to the United Kingdom.
9 Make the production, sale and use of cannabis legal.
10 Stop spending a fixed 0.7 per cent slice of our national wealth on Foreign Aid
Over the last year or so Brexit, the EU and a possible official visit by Trump to the UK are big issues, immigration and health are also prominent. There are some right wing petitions: 5, 8 and 10. Number 5 is calling for something like Trump's travel ban in the US. And some left wing petitions: 2, 4, 6 and 7.
If we take all the petition titles and remove the stop words we can generate the following word cloud:
The following post from my code blog explains how to generate word clouds.
The technical process:
[('northern', 147), ('ireland', 102), ('n', 99), ('dup', 88), ('new', 40),
('westminster', 29), ('uk', 26), ('support', 25), ('public', 25), ('national', 21),
('people', 18), ('united', 18), ('deal', 17), ('needs', 17), ('manifesto', 16),
('trade', 16), ('must', 14), ('also', 14), ('best', 14), ('wminster', 13), ('eu', 13),
('across', 13), ('irelands', 13), ('economic', 13), ('identity', 13), ('military', 12),
('would', 12), ('better', 12), ('positive', 12), ('believes', 12)]
[('northern', 51), ('ireland', 33), ('ulster', 23), ('unionist', 22), ('best', 18),
('united', 16), ('party', 16), ('brexit', 13), ('westminster', 13), ('mps', 12),
('local', 12), ('union', 12), ('work', 11), ('manifesto', 11), ('one', 11), ('remain', 9),
('great', 8), ('need', 8), ('many', 8), ('yet', 8), ('would', 8), ('public', 7),
('south', 7), ('tom', 7), ('executive', 7), ('kingdom', 7), ('people', 7), ('election', 7),
('danny', 6), ('better', 6)]
[('northern', 170), ('alliance', 110), ('ireland', 103), ('uk', 75),
('support', 65), ('ensure', 51), ('would', 43), ('change', 40), ('public', 37),
('economic', 35), ('also', 32), ('westminster', 32), ('work', 30), ('government', 30),
('european', 29), ('direction', 27), ('need', 27), ('deal', 26), ('across', 26),
('executive', 26), ('international', 25), ('political', 25), ('brexit', 24),
('must', 24), ('eu', 24), ('significant', 23),
('continue', 23), ('tax', 23), ('human', 22), ('welfare', 22)]
[('brexit', 44), ('eu', 35), ('sinn', 32), ('rights', 30), ('tory', 25), ('health', 23),
('north', 23), ('irish', 19), ('access', 18), ('european', 17), ('vote', 16),
('within', 16), ('party', 15), ('special', 14), ('services', 13), ('ireland', 13),
('status', 13), ('election', 13), ('cuts', 12), ('funding', 12), ('designated', 12),
('dup', 12), ('new', 11), ('unity', 10), ('trade', 9), ('priorities', 9), ('people', 9),
('british', 8), ('good', 8), ('friday', 8)]
[('tuv', 97), ('northern', 95), ('ireland', 81), ('politics', 42), ('would', 41),
('principled', 41), ('talking', 41), ('straight', 41), ('stormont', 35), ('sinn', 34),
('fein', 30), ('people', 27), ('need', 27), ('dup', 22), ('government', 22), ('public', 20),
('believes', 19), ('first', 19), ('uk', 19), ('must', 18), ('irish', 17), ('health', 16),
('brexit', 15), ('eu', 15), ('one', 15), ('money', 15), ('assembly', 15), ('could', 14),
('language', 14), ('mental', 14)]
[('sdlp', 262), ('northern', 154), ('ireland', 104), ('new', 97), ('ensure', 85),
('must', 58), ('support', 58), ('people', 55), ('believes', 51), ('also', 45),
('investment', 39), ('public', 39), ('housing', 39), ('education', 39), ('better', 37),
('government', 37), ('local', 35), ('development', 35), ('services', 32), ('strategy', 32),
('economy', 31), ('across', 31), ('health', 30), ('areas', 30), ('community', 30),
('sector', 29), ('economic', 28), ('work', 27), ('social', 27), ('future', 26)]
Note the SDLP manifesto for the Westminster election can not be scanned using the pdf to text script so I scanned their Stormont manifesto from March 2017.
All of the parties, except Sinn Fein, mention Northern Ireland a lot. Sinn Fein refuse to use the name Northern Ireland - to admit the existence of Northern Ireland would be to recognise that the Unionists have some validity in their views, they refuse to do that. Northern Irish politics can be juvenile. Sinn Fein have put Brexit and the EU in the centre of their message. The two main Unionist parties also talk about Brexit and the EU but not as prominently. The TUV prefer to talk about Sinn Fein, the DUP and Stormont.
The opinions of the five main parties to Brexit are:
DUP: make sure Northern Ireland gets the best Brexit deal
UUP: that all the constituent regions of our country (the UK) remain strong and united
Alliance: Opposition to a hard Brexit
SDLP: The Good Friday Agreement clearly makes Northern Ireland distinct from the rest of the UK
Sinn Fein: Brexit and Tory cuts demonstrate the undemocratic nature of partition
The UUP position reflects some concern within elements of the Unionist community that Brexit could be the end of the UK. The nationalists prefer to focus on the remain vote in Northern Ireland and want special status for Northern Ireland. The DUP will reject this idea but there is some evidence that Brexit has weakened the UK and increased talk of a United Ireland.