Some applications from NLA

SVD

  • Any matrix can be presented in the form
$$A = U\Sigma V^*,$$

where $U$ and $V$ are unitary

$$ U^*U = I $$

and $\Sigma$ is diagonal.

  • Given corpus of docs
  • Topics extraction is required
  • Bag-of-words model
  • You need some embedding of the documents in $\mathbb{R}^n$

Bag-of-words model

  • Document is a set of words. We do not take into account words order
  • Every topic is a set of the most representative words (terms)

Term-document $A$

  • Size of the matrix is $N_{docs} \times N_{terms}$
  • How can we fill it?

Possible options

  • Element $(i, j)$ is the number of the term in the $i$-th document
  • Element $(i, j)$ is tf-idf for the $j$-th term and the $i$-th document

Tf-Idf is a product of

  • tf – term frequency in the document

and

  • idf = $\log \frac{|D|}{|\{ d \in D \mid t \in D \}|}$, so we have logarithm of ratio between total number of documents and number of documents with target term.

Q: what property has matrix $A$?

How SVD can help in construction of embedding?

  • Given matrix $A$
  • To get embedding in $\mathbb{R}^d$ we compute SVD for some rank $d$: $A \approx U\Sigma V^*$
  • Matrix $U$ of size $N_{docs} \times d$, i.e. every document is reprepresented with some vector from $\mathbb{R}^d$
  • Matrix $V$ of size $N_{terms} \times d$, i.e. every term is represented with some vector from $\mathbb{R}^d$

Another interpretation

  • If $d$ is a number of topics, then we get some distribution of terms and documents over topics
  • We can extract the most relevant terms and documents to every topic and compare them
  • Constructed embeddings can be used as input data for more advanced methods for classification/clustering

Lets check how it works!

In [13]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
plt.rc("text", usetex=True)
import scipy.sparse.linalg as spsplin
import scipy.sparse as spsp

Load data

In [2]:
documents = []
with open("../files/test_articles.txt","r") as fin:
    for line in fin.readlines():
        text = line.strip()
        documents.append(text)
print("Total number of Documents:",len(documents))
Total number of Documents: 4551

Example of document

In [3]:
documents[0]
Out[3]:
"Barclays' defiance of US fines has merit Barclays disgraced itself in many ways during the pre-financial crisis boom years. So it is tempting to think the bank, when asked by US Department of Justice to pay a large bill for polluting the financial system with mortgage junk between 2005 and 2007, should cough up, apologise and learn some humility. That is not the view of the chief executive, Jes Staley. Barclays thinks the DoJ’s claims are “disconnected from the facts” and that it has “an obligation to our shareholders, customers, clients and employees to defend ourselves against unreasonable allegations and demands.” The stance is possibly foolhardy, since going into open legal battle with the most powerful US prosecutor is risky, especially if you end up losing. But actually, some grudging respect for Staley and Barclays is in order. The US system for dishing out fines to errant banks for their mortgage sins has come to resemble a casino. The approach prefers settlements behind closed doors and the difference in size of penalties is never explained. Occasional leaks of the negotiating demands make the methodology appear even more arbitrary. Deutsche Bank was initially asked for $14bn (£11.5bn), but reached a settlement of $7.2bn on Thursday. Where is the rhyme or reason? There is also a strong suspicion that the roulette wheel is weighted against the Europeans. US banks, in the forms of JP Morgan, Goldman Sachs, Morgan Stanley, Bank of America and Citi, were at the front of the queue for settlement for no obvious reason. If Barclays created and distributed far fewer toxic mortgage securities than its US rivals, which is what the bank argues, why shouldn’t its fine be proportionately smaller? Neither Barclays nor the DoJ is talking hard numbers. But Barclays, it is said, was asked for $4bn, versus its own analysis that a fair sum would be $1bn and $2bn could have been swallowed for the sake of certainty. When the gap is so wide, Barclays is entitled to take its chances in court – and yes, it probably has an obligation to do so. A board can’t let $2bn slip out of the door just for the sake of a quiet life. The case will be messy, inevitably. Barclays’ practices were “plainly irresponsible and dishonest,” according to Loretta Lynch, the US attorney general. There is also a cache of ugly emails and documents. The DoJ lawsuit says Barclays employees called one parcel of securitised loans “craptacular”. Another was said to “look like shit”. However, that is almost par for the course in these cases. The central question is the right size of penalty. If Barclays thinks it has been singled out for unduly harsh treatment, the bank should try to prove its case. Staley will look like a fool if he fails, but the willingness to reject the easy option of settling is entirely legitimate."

Pre-processing of documents

In [4]:
news_df = pd.DataFrame({'document': documents})

# removing everything except alphabets`
news_df['clean_doc'] = news_df['document'].str.replace("[^a-zA-Z#]", " ")

# removing short words
news_df['clean_doc'] = news_df['clean_doc'].apply(lambda x: ' '.join([w for w in x.split() if len(w)>3]))

# make all text lowercase
news_df['clean_doc'] = news_df['clean_doc'].apply(lambda x: x.lower())
In [5]:
from nltk.corpus import stopwords
stop_words = stopwords.words('english')

# tokenization
tokenized_doc = news_df['clean_doc'].apply(lambda x: x.split())

# remove stop-words
tokenized_doc = tokenized_doc.apply(lambda x: [item for item in x if item not in stop_words])

# de-tokenization
detokenized_doc = []
for i in range(len(news_df)):
    t = ' '.join(tokenized_doc[i])
    detokenized_doc.append(t)

news_df['clean_doc'] = detokenized_doc

Before vs. after

In [6]:
news_df.head()
Out[6]:
document clean_doc
0 Barclays' defiance of US fines has merit Barcl... barclays defiance fines merit barclays disgrac...
1 How big is Hillary Clinton's lead in the presi... hillary clinton lead presidential race depends...
2 Zika’s greatest ally is human intransigence Th... zika greatest ally human intransigence revenge...
3 Fight for the right: Cruz and Rubio spar in Ne... fight right cruz rubio spar nevada trump chall...
4 Voting day: America finally goes the polls Can... voting america finally goes polls candidates s...

Construct matrix $A$

In [7]:
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer

vectorizer = TfidfVectorizer(stop_words='english', 
max_features= 1000, # keep top 1000 terms 
)

# vectorizer = CountVectorizer(stop_words="english", max_features=100)

X = vectorizer.fit_transform(news_df['clean_doc'])

X.shape
Out[7]:
(4551, 1000)
In [8]:
X, X.nnz
Out[8]:
(<4551x1000 sparse matrix of type '<class 'numpy.float64'>'
 	with 497895 stored elements in Compressed Sparse Row format>, 497895)

Sparse SVD

  • Computing SVD for dense and sparse matrices are different topics
  • They are all will be covered in the course later...
  • Here we need only first $k \ll n$ singular values and vectors
  • Use special function from the SciPy library scipy.sparse.linalg
In [9]:
u, sigma, v = spsplin.svds(X.asfptype(), k=7)

Check decreasing of the singular values

In [16]:
plt.plot(sigma[::-1]/sigma[-1])
plt.xlabel("Index of singular values", fontsize=18)
plt.yticks(fontsize=18)
plt.xticks(fontsize=18)
plt.grid(True)
In [17]:
terms = vectorizer.get_feature_names()
print(len(terms))
print(terms[:10])
1000
['ability', 'able', 'abortion', 'absolutely', 'abuse', 'accept', 'access', 'according', 'account', 'accounts']

Topics anf the most relevant terms for them

In [18]:
for i, comp in enumerate(v):
    terms_comp = zip(terms, comp)
    sorted_terms = sorted(terms_comp, key= lambda x:x[1], reverse=True)[:10]
    print("Topic "+str(i)+": ")
    for t in sorted_terms:
        print("Word: {}, score: {}".format(t[0], t[1]))
Topic 0: 
Word: health, score: 0.40862330747376874
Word: mental, score: 0.22240931303128725
Word: care, score: 0.22169596123074495
Word: patients, score: 0.20331924410163693
Word: people, score: 0.15992102366539657
Word: doctors, score: 0.14215598718119746
Word: hospital, score: 0.1325782197669305
Word: social, score: 0.11089865675449893
Word: says, score: 0.10809725354632962
Word: children, score: 0.10648923164782348
Topic 1: 
Word: film, score: 0.48038693031676405
Word: films, score: 0.12755665655401316
Word: movie, score: 0.1249785732242679
Word: director, score: 0.0846370876408235
Word: hollywood, score: 0.07996289850111983
Word: women, score: 0.07789731411556998
Word: health, score: 0.07000273851282515
Word: actor, score: 0.06921527165008458
Word: said, score: 0.055688664842670044
Word: drama, score: 0.055478115562781365
Topic 2: 
Word: bank, score: 0.4979364782266319
Word: banks, score: 0.23519917763522913
Word: film, score: 0.2138460671932756
Word: banking, score: 0.16272477930600338
Word: financial, score: 0.13518655479685984
Word: customers, score: 0.13361375467294384
Word: barclays, score: 0.09739787829341057
Word: trump, score: 0.09571568843894401
Word: shares, score: 0.09246044420413732
Word: deutsche, score: 0.08988615273620267
Topic 3: 
Word: film, score: 0.3008777486682321
Word: album, score: 0.09505875638927358
Word: music, score: 0.09151156328767963
Word: films, score: 0.07990254954089648
Word: movie, score: 0.07952808913181729
Word: people, score: 0.07305422422365992
Word: women, score: 0.06551778556146694
Word: life, score: 0.061534968719656045
Word: star, score: 0.05829059024275601
Word: songs, score: 0.05582461999391681
Topic 4: 
Word: film, score: 0.29264951113026705
Word: album, score: 0.162120874899243
Word: music, score: 0.14167833830359033
Word: like, score: 0.11859514429782779
Word: trump, score: 0.11731305923786489
Word: songs, score: 0.09516070776394919
Word: song, score: 0.09148975042692185
Word: league, score: 0.09106050928090748
Word: band, score: 0.09034804353161223
Word: movie, score: 0.08928878980341992
Topic 5: 
Word: film, score: 0.14869069242217242
Word: album, score: 0.07725984306594365
Word: music, score: 0.0768396965181208
Word: bank, score: 0.0753729219738026
Word: league, score: 0.06307938090623946
Word: like, score: 0.05864981027876307
Word: year, score: 0.05543113559292986
Word: health, score: 0.05443673623446011
Word: says, score: 0.053874560372268385
Word: time, score: 0.052281915523008746
Topic 6: 
Word: trump, score: 0.3080680578109646
Word: said, score: 0.22963528489691598
Word: people, score: 0.1571069263154853
Word: film, score: 0.12902648512763934
Word: like, score: 0.12756925625793422
Word: says, score: 0.1073069105755821
Word: year, score: 0.10410588628273061
Word: time, score: 0.10067794459240509
Word: clinton, score: 0.09202192385833696
Word: bank, score: 0.0868957286570585

Topics and the most relevant documents for them

In [19]:
top_docs = np.argmax(u, axis=0)
print(top_docs)
for i, j in enumerate(top_docs):
    print("Topic {}".format(i))
    print(documents[j])
    print(" ")
[3116 2806 2414 2806 1057  464  658]
Topic 0
Public Service Awards 2016 health and wellbeing winner: Derventio Housing Trust “Quite often people are in hospital and they’ve got nothing: no food, no clothes, no toiletries,” says Kate Gillespie, Derventio Housing Trust’s strategic lead for its Healthy Futures initiative. “We get all that sorted out, so people at least have a bit of dignity when they are discharged.” That’s just the start of the scheme’s work with homeless people due to leave hospital. Many have multiple, complex needs, such as mental health problems and addictions, and are trapped in a vicious cycle of ongoing health issues and repeat admissions. Over a 12-week period, staff work intensively to find housing for patients, settle them into their new homes and help them live independently – while making better use of primary care, rather than relying disproportionately on acute services. “Sometimes it’s because they don’t manage their health, so they actually get ill enough to need to go in [to hospital] all of those times,” Gillespie says. “We’ve also got people who are going in because it’s their social contact. They’re so isolated that the only kind of love and nurture they get is a trip to A&E, where they get a sandwich and a cup of tea and a ‘there, there’ from the nurses. When someone has nothing else they’re going to keep coming back for it. “It’s like they’ve got a dependency on acute care. We transfer that dependency to us, and then take the time to wean them off it. If we get someone who’s in A&E three times a week, the next step down from that is a walk-in centre. Then their GP, then the pharmacy.” Healthy Futures, which also offers brief interventions to help with the timely discharge of inpatients with less complex housing and support needs, has worked with more than 330 patients since it began in October 2013. Some 170 patients have received ongoing community-based support. In the six months before becoming Healthy Futures clients, those patients had been admitted to acute beds on 487 occasions, had gone to A&E 616 times, and had called 999 and been taken there by an ambulance 364 times. The project has led to an 88% fall in avoidable admissions of clients, a 90% drop in clients’ visits to A&E, and 84% fewer 999 ambulance transfers. Hospital stays have also been cut by an average of 16 days. Two thirds of patients felt their physical health had improved, and the same proportion reported better mental health. Healthy Futures’ achievements come despite working in a climate of cuts to adult social care, at a time when finding housing is harder than ever. Key to getting funding has been its use of robust data proving its impact and efficiency. Patients give consent for their health records to be accessed, so their use of acute care before working with the project can be tracked – and commissioners can clearly see the positive effect. Great staff are also vital, Gillespie says. “They’re just amazingly capable and patient and resourceful. I’m immensely proud of them.”
 
Topic 1
Australia's best kept cultural secret: Asia Pacific films land in Brisbane When Islamic State besieged thousands of Yazidi people near Mount Sinjar in northern Iraq in August 2014, the US president, Barack Obama, called in air strikes and Australia, Britain and the US dropped humanitarian aid. As Kurdish fighters picked up their guns, Kurdish film-makers Hussein Hassan and Mehmet Aktaş picked up their cameras, setting aside the film they had been working on to shoot another. They wanted to fight the fear. The Yazidi are Kurdish people with their own particular religion, which they keep alive by not marrying out. Now half a million of them are refugees, many in camps in Turkey. To Isis fighters, the Yazidi religion is an affront. They forced conversion on and massacred thousands of Yazidi men. Yazidi women were taken hostage, raped and auctioned as sexual slaves – maybe 5,000 in all. So far, only about 1,200 have been freed. The Dark Wind, which won the Unesco award at the Asia Pacific Screen awards (Apsas) on Thursday night in Brisbane, is about fear, and about what happens when a young woman is brought back to her family. It’s a love story but also one about masculine honour, about shame, pride and the aftermath of rape. When the film premiered at the Kurdish Film festival in Duhok in September, there was an uproar – Hassan believes some in the Yazidi community misunderstood the film (the heroine’s fate is uncertain until the closing frames). He says the proclamation by Yazidi religious leaders – declaring the women taken hostage by Isis to be without fault or blame – will be the key to their acceptance back into their community. “But there are some, like the father in this film, whose attitudes will not change,” he said. Now celebrating their 10th year in Brisbane, the Apsas – an annual celebration of film from the 70 countries and areas around the region – are one of Australia’s best kept cultural secrets. The Brisbane Asia and Pacific Film festival (BAPFF) now runs concurrently to give audiences access to the films. It is Australia’s least parochial film event. For three glorious days of networking events, film-makers from a vast swathe of the world – from the Russian Federation though the various Stans, the Middle East, India, North and South East Asia, across the Pacific access to China – converge on Brisbane. They may be invisible to Australians fixated on American and European cinema but the event stands alongside the achievement of Brisbane’s Gallery of Modern Art in building Australia’s artistic links with Asia. The academy that runs it now has 1,000 members and the awards draw more entries than the foreign language Oscars. “We’re here for the long haul,” the president of the academy, Jack Thompson, said this week. “Australia is a part of Asia and we are building relationships for the future.” The Dark Wind isn’t the standout film this year: an exquisite, slow burning film from Turkey, Cold of Kalandar, won best film, best cinematography and the first Apsa young cinema award last night. This could well be the start of an Oscar run, as it was with Asghar Farhadi,’s A Separation, which won best feature film at the awards in 2011. Cold of Kalandar is the story of a frustrated dreamer, a middle aged man who toils with his family in unbelievably harsh conditions in the mountains of Northern Turkey. He prospects underground for silver, hoping to find a vein to pay his family’s debts; he refuses to sell his prize bull, entering it instead in contest for fighting bulls. His wife is bitter: she wants him to take a labouring job, pay their debts, find a doctor for their disabled son. Director Mustafa Kara took his lead – unschooled actor Haydar Sisman – to live for three months in a rural village to understand the life of his character, Mehmet. He had him crawling on his belly underground, clinging to a rockface prospecting in bitter sleet, tending cattle, working tools in a homemade forge – all in the bitterest weather. Mehmet and his wife Hanife (Nuray Yesilaraz) voice their frustrations in a wrenching argument midway through the film – it becomes a film with soul. Kara and his young producer Nermin Aktekin politely masked their amusement when I said I had looked in vain to find Kalandar on a map of Turkey. “Kalandar is a month,” Kara explained. “The coldest month of the year, when everything is at its lowest ebb.” It’s interesting that this wrenching depiction of rural poverty should be Turkey’s foreign language Oscar nomination this year, from a country now convulsed by an attempted coup, a counter coup and mass arrests of teachers and the judiciary. When I inquire about the wellbeing of Turkish film-makers I have met here at previous awards, he is sanguine. His film has government support. “No film-makers have been arrested,” he says. And, “yes, they are working.” For the past three years, film-goers have been able to see many of the Apsa-nominated films in a reconstituted Brisbane Asia Pacific Film festival, which opened this week with a rocking glimpse of feminism, Bollywood style. Parched, which was nominated for best screenplay, is the story of four women escaping oppressive marriages in a village in Rajistan. It has the hallmarks of modern Bollywood: towering close-ups, heaving bosoms, melodramatic acting, four beautiful, feisty heroines. The sex scenes (one between women) are ribald, their husbands brutal. Think Thelma and Louise meets Bollywood, with more than a touch of Priscilla Queen of the Desert in production design. The Indian community turned out in force and boogied to Bhangra with the young Brisbane glitterati on opening night. Asia Pacific Screen awards 2016: full list of winners Best feature film: Cold of Kalandar (Kalandar Soğuğu), Turkey, dir. Mustafa Kara Best youth feature film: The World of Us (Woorideul), Republic of Korea, dir. Yoon Ga-eun Best animated feature film: Seoul Station (Seoul-yeok), Republic of Korea, dir. Yeon Sang-ho Best documentary feature film: Starless Dreams (Royahaye Dame Sobh), Islamic Republic of Iran, dir. Mehrdad Oskouei Achievement in directing: Feng Xiaogang for I Am Not Madame Bovary (Wo Bu Shi Pan Jinlian), People’s Republic of China Best screenplay: Ryusuke Hamaguchi, Tadashi Nohara, Tomoyuki Takahashi for Happy Hour, Japan Achievement in cinematography: Cevahir Şahin and Kürşat Üresin for Cold of Kalandar (Kalandar Soğuğu), Turkey, Hungary Best performance by an actress: Hasmine Killip in Ordinary People (Pamilya Ordinaryo), Philippines Best performance by an actor: Manoj Bajpayee in Aligarh, India Special mention: Nawazuddin Siddiqui in Psycho Raman (Raman Raghav 2.0), India Unesco award for cultural diversity: Hussein Hassan for The Dark Wind (Reşeba), Iraq, Qatar, Germany Apsa FIAPF award for outstanding achievement in film in the Asia Pacific region: Iranian producer Manoochehr Mohammadi Jury grand prize: Youn Yuh-jung in The Bacchus Lady (Jug-yeo-ju-neun yeo-ja), Republic of Korea Mark Lee Ping-bing for Crosscurrent (Chang Jiang Tu), People’s Republic of China Special mention: Sunny Pawar in Lion, Australia Netpac and Griffith film school’s young cinema award: Mustafa Kara for Cold of Kalandar (Kalandar Soğuğu), Turkey, Hungary Special mention: Bi Gan for Kaili Blues (Lu Bian Ye Can), People’s Republic of China • The Brisbane Asia Pacific Film festival runs until 4 December • Julie Rigg was hosted by the Apsas
 
Topic 2
Battered banks poised to reveal whether a new crisis has begun Fears that the banking sector is facing a new onslaught of pressures dominated markets last week. Global bank shares were sold off – the index of major banking shares in the UK at one point hit its lowest levels since the depths of the recession – and questions were being asked about the impact of low interest rates amid concerns about the possibility of a global economic slowdown. While much of the focus was on big banks in the eurozone – Deutsche and Société Générale – analysts pointed out that the share prices of UK banks were already pricing in another global financial crisis when it hadn’t even happened. So when the UK’s major players reveal in the coming weeks how they have fared in 2015, they will be doing so in the most febrile atmosphere since the Lehman Brothers collapse seven-and-a-half years ago. Analysts will be looking for confirmation that another 2008-style crisis is not about to the grip the sector. The gloom may well be overdone. The stock market value of some of Britain’s biggest banks is lower than the value of their assets, notably HSBC, Standard Chartered and Barclays. HSBC – one of the biggest constituents of the FTSE 100 – has been trading at levels not seen since 2009. Standard Chartered is selling for prices last witnessed a quarter of a century ago. In the depths of last weeks’s market chaos, shares in Barclays and Royal Bank of Scotland hit their lowest levels since 2012 while George Osborne has already had to postpone his plan to sell off shares in Lloyds Banking Group to the public. However, the bombed-out banks came off their lows by the end of last week, and analysts point out that all hold more capital – the key measure of their financial health – than they did before the start of 2008. The results of stress tests on the major players announced in December by the Bank of England showed that they were all strong enough to withstand a downturn, and Threadneedle Street said it was not concerned about the strength of the system. Analysts have calculated that Europe’s banks are holding €700m worth of capital more than they were at the time of the last crisis and have disposed of their riskiest assets. So financial strength shouldn’t be a problem, and no one is expecting to hear the likes of Barclays, HSBC or Lloyds report losses. However, there are headwinds. The ability of banks to generate revenue will be a focus; the low interest rate environment is punishing them as it restricts the profits on their lending. Any sign that provisions for bad debts are starting to go up dramatically will be regarded with concern, while banks are expected to set aside more money to cover scandals, such as the mis-selling of payment protection insurance (PPI). Investors will be watching for any impact on the payouts they receive through dividends – particularly how that compares with the total spent on staff bonuses. Many banks are expected to publish annual reports alongside their results, showing remuneration for board members. HSBC The board of Britain’s biggest bank met on Sunday to decide whether to shift its headquarters out of London to another location, most likely Hong Kong. Once that decision is out of the way – with expectations that HSBC will decide to stay put – the focus returns to the 2015 results. Chief executive Stuart Gulliver last week gave clues to his view of the market outlook. As he went back on a staff pay freeze, he warned workers of the “very challenging operating environment”. Gulliver is already six months into a plan to cut staff numbers by 25,000 and save $5bn (£3.5bn). The City will now be wanting progress on these cost reduction measures and an update on the impact of slowing growth in China, where Gulliver is targeting expansion. So what is the problem with the underperforming share price? Ian Gordon, analyst at Investec bank, says it indicates that the City is braced for a rise in bad debts in emerging markets. In the third quarter, Gulliver stressed that while revenues were down, credit quality was not being affected. He has received at least £7m a year in pay since taking the helm in 2011. His pay, and that of his 250,000 staff, will also be in focus. Standard Chartered Fears over the strength of emerging markets have been a key factor in this year’s stock-market gyrations, so analysts are wondering if a bank focused on those economies can have made a profit in 2015. Standard Chartered has its own problems, which new chief executive Bill Winters has tried to address by tapping shareholders for £3.3bn and putting 15,000 jobs on the line. Even so, the market is valuing the bank at 0.4 times the value of its assets, as the stock trades at a 25-year low. Winters has embarked on a major restructuring, reducing exposure to China and commodities. The bank is also being more selective about the customers to which it lends and is ending $20bn of loans to a handful of customers. Any signs that this restructuring is slowing down or that bad debts are rising could further unnerve investors, while the bank has already warned it remains in the regulatory spotlight after a 2012 fine from US authorities over breaches of sanctions. “Standard Chartered’s earnings have been under sustained pressure for the past two years, and we expect little respite from the full-year 2015 results,” said analysts at Barclays. “Underlying earnings are likely to suffer from difficult trading conditions, a slowing economic environment and further declines in commodity prices. The recently announced restructuring is likely to add to these headwinds, disrupting underlying business performance and leading to significant restructuring charges.” Lloyds Banking Group The market rout has driven shares in Lloyds to 57p, their lowest price since April 2013, quashing any short-term chance of the government further selling its stake in the bank, which was bailed out in 2008 with £20bn of taxpayer money. That stake has fallen from 43% to below 10%, and the bank will hope it can convince investors that its ability to generate dividends will put fuel back into the shares. But hanging over the bank is the prospect of another provision for PPI – its bill is already over £13bn. Analysts at Jefferies said the extra PPI provision, which they believe could amount to £2bn in the fourth quarter, would make it difficult for Lloyds to promise any special dividends. The bank acts as a barometer of the UK economy and is also the UK’s biggest mortgage lender, so any signs that lending is slowing down or house prices tanking will worry FTSE investors. Royal Bank of Scotland The biggest casualty of the 2008 banking crisis is yet to report a full-year profit since taxpayers pumped in £45bn to keep it afloat. Last month, Ross McEwan, the chief executive, admitted that 2015 would be its eighth consecutive loss-making year as the bank issued an unscheduled announcement warning ofa string of charges relating to PPI and a long list of litigation in the US relating to residential mortgage-backed securities (RMBS). The losses it has reported since 2008 already exceed the £45bn used to prevent it from collapsing. Uncertainty surrounding the cost of these fines is a concern for investors, alongside penalties related to the mortgage securities cases, for which it has set aside £3.8bn. This is holding back the bank’s ability to make payouts to investors, which might help bolster the shares. They have plunged to 2012 lows and have been trading at 230p – 100p below the price at which Osborne sold off the first tranche in August. Barclays Shares are back where they were when former chief executive Bob Diamond was forced out during the 2012 Libor-rigging scandal. Antony Jenkins, promoted to replace Diamond, has also been ousted and replaced with the US banker Jes Staley, who will be making his first presentation when the bank announces its 2015 results. He is facing calls to embark on a major overhaul. Analysts at stockbroker Bernstein have already urged him to get Barclays out of Africa, sell the US credit card business and float the investment bank in the US. The investment bank, once its powerhouse, is likely to be the focus. Investec’s Gordon says Barclays has already signalled that investment banking revenues fell 10% in the fourth quarter of last year. Some 1,200 job cuts in the division have already been earmarked and more focus on cost-cutting its expected. In addition, Staley faces a major challenge in complying with UK rules requiring banks to ringfence their high-street banks from their investment banking operations. Analysts at Jefferies expect Barclays to incur another £1bn of costs to implement the ringfence and another £1bn PPI charge for the last three months of 2015.
 
Topic 3
Australia's best kept cultural secret: Asia Pacific films land in Brisbane When Islamic State besieged thousands of Yazidi people near Mount Sinjar in northern Iraq in August 2014, the US president, Barack Obama, called in air strikes and Australia, Britain and the US dropped humanitarian aid. As Kurdish fighters picked up their guns, Kurdish film-makers Hussein Hassan and Mehmet Aktaş picked up their cameras, setting aside the film they had been working on to shoot another. They wanted to fight the fear. The Yazidi are Kurdish people with their own particular religion, which they keep alive by not marrying out. Now half a million of them are refugees, many in camps in Turkey. To Isis fighters, the Yazidi religion is an affront. They forced conversion on and massacred thousands of Yazidi men. Yazidi women were taken hostage, raped and auctioned as sexual slaves – maybe 5,000 in all. So far, only about 1,200 have been freed. The Dark Wind, which won the Unesco award at the Asia Pacific Screen awards (Apsas) on Thursday night in Brisbane, is about fear, and about what happens when a young woman is brought back to her family. It’s a love story but also one about masculine honour, about shame, pride and the aftermath of rape. When the film premiered at the Kurdish Film festival in Duhok in September, there was an uproar – Hassan believes some in the Yazidi community misunderstood the film (the heroine’s fate is uncertain until the closing frames). He says the proclamation by Yazidi religious leaders – declaring the women taken hostage by Isis to be without fault or blame – will be the key to their acceptance back into their community. “But there are some, like the father in this film, whose attitudes will not change,” he said. Now celebrating their 10th year in Brisbane, the Apsas – an annual celebration of film from the 70 countries and areas around the region – are one of Australia’s best kept cultural secrets. The Brisbane Asia and Pacific Film festival (BAPFF) now runs concurrently to give audiences access to the films. It is Australia’s least parochial film event. For three glorious days of networking events, film-makers from a vast swathe of the world – from the Russian Federation though the various Stans, the Middle East, India, North and South East Asia, across the Pacific access to China – converge on Brisbane. They may be invisible to Australians fixated on American and European cinema but the event stands alongside the achievement of Brisbane’s Gallery of Modern Art in building Australia’s artistic links with Asia. The academy that runs it now has 1,000 members and the awards draw more entries than the foreign language Oscars. “We’re here for the long haul,” the president of the academy, Jack Thompson, said this week. “Australia is a part of Asia and we are building relationships for the future.” The Dark Wind isn’t the standout film this year: an exquisite, slow burning film from Turkey, Cold of Kalandar, won best film, best cinematography and the first Apsa young cinema award last night. This could well be the start of an Oscar run, as it was with Asghar Farhadi,’s A Separation, which won best feature film at the awards in 2011. Cold of Kalandar is the story of a frustrated dreamer, a middle aged man who toils with his family in unbelievably harsh conditions in the mountains of Northern Turkey. He prospects underground for silver, hoping to find a vein to pay his family’s debts; he refuses to sell his prize bull, entering it instead in contest for fighting bulls. His wife is bitter: she wants him to take a labouring job, pay their debts, find a doctor for their disabled son. Director Mustafa Kara took his lead – unschooled actor Haydar Sisman – to live for three months in a rural village to understand the life of his character, Mehmet. He had him crawling on his belly underground, clinging to a rockface prospecting in bitter sleet, tending cattle, working tools in a homemade forge – all in the bitterest weather. Mehmet and his wife Hanife (Nuray Yesilaraz) voice their frustrations in a wrenching argument midway through the film – it becomes a film with soul. Kara and his young producer Nermin Aktekin politely masked their amusement when I said I had looked in vain to find Kalandar on a map of Turkey. “Kalandar is a month,” Kara explained. “The coldest month of the year, when everything is at its lowest ebb.” It’s interesting that this wrenching depiction of rural poverty should be Turkey’s foreign language Oscar nomination this year, from a country now convulsed by an attempted coup, a counter coup and mass arrests of teachers and the judiciary. When I inquire about the wellbeing of Turkish film-makers I have met here at previous awards, he is sanguine. His film has government support. “No film-makers have been arrested,” he says. And, “yes, they are working.” For the past three years, film-goers have been able to see many of the Apsa-nominated films in a reconstituted Brisbane Asia Pacific Film festival, which opened this week with a rocking glimpse of feminism, Bollywood style. Parched, which was nominated for best screenplay, is the story of four women escaping oppressive marriages in a village in Rajistan. It has the hallmarks of modern Bollywood: towering close-ups, heaving bosoms, melodramatic acting, four beautiful, feisty heroines. The sex scenes (one between women) are ribald, their husbands brutal. Think Thelma and Louise meets Bollywood, with more than a touch of Priscilla Queen of the Desert in production design. The Indian community turned out in force and boogied to Bhangra with the young Brisbane glitterati on opening night. Asia Pacific Screen awards 2016: full list of winners Best feature film: Cold of Kalandar (Kalandar Soğuğu), Turkey, dir. Mustafa Kara Best youth feature film: The World of Us (Woorideul), Republic of Korea, dir. Yoon Ga-eun Best animated feature film: Seoul Station (Seoul-yeok), Republic of Korea, dir. Yeon Sang-ho Best documentary feature film: Starless Dreams (Royahaye Dame Sobh), Islamic Republic of Iran, dir. Mehrdad Oskouei Achievement in directing: Feng Xiaogang for I Am Not Madame Bovary (Wo Bu Shi Pan Jinlian), People’s Republic of China Best screenplay: Ryusuke Hamaguchi, Tadashi Nohara, Tomoyuki Takahashi for Happy Hour, Japan Achievement in cinematography: Cevahir Şahin and Kürşat Üresin for Cold of Kalandar (Kalandar Soğuğu), Turkey, Hungary Best performance by an actress: Hasmine Killip in Ordinary People (Pamilya Ordinaryo), Philippines Best performance by an actor: Manoj Bajpayee in Aligarh, India Special mention: Nawazuddin Siddiqui in Psycho Raman (Raman Raghav 2.0), India Unesco award for cultural diversity: Hussein Hassan for The Dark Wind (Reşeba), Iraq, Qatar, Germany Apsa FIAPF award for outstanding achievement in film in the Asia Pacific region: Iranian producer Manoochehr Mohammadi Jury grand prize: Youn Yuh-jung in The Bacchus Lady (Jug-yeo-ju-neun yeo-ja), Republic of Korea Mark Lee Ping-bing for Crosscurrent (Chang Jiang Tu), People’s Republic of China Special mention: Sunny Pawar in Lion, Australia Netpac and Griffith film school’s young cinema award: Mustafa Kara for Cold of Kalandar (Kalandar Soğuğu), Turkey, Hungary Special mention: Bi Gan for Kaili Blues (Lu Bian Ye Can), People’s Republic of China • The Brisbane Asia Pacific Film festival runs until 4 December • Julie Rigg was hosted by the Apsas
 
Topic 4
The lost albums loved by the stars – from ecstatic gospel to Italian prog Jarvis Cocker on … Bob Lind: The Elusive Bob Lind (Verve Folkways, 1966) I hesitate to recommend this record because I know that Bob Lind himself hates it and that it did a lot of harm to his career – but I love it, so here goes … This is the story as I understand it: Lind had a massive global hit with Elusive Butterfly in 1965. Someone crawled out of the woodwork and sold some acoustic demo recordings he had made a few years earlier as a teenager to Verve Records. Verve decided to add bass, drums and strings to the songs, which consisted of voice and acoustic guitar only, in order to make them sound more like the single he had in the charts. The whole affair reeks of the worst side of the exploitative music business of those days – and yet … somehow they made something beautiful. It’s like a weird, inverted form of sampling: instead of cutting and pasting the vocals and guitar over a steady rhythm track – as would happen today – Lind’s performances speed up, slow down, have irregular bar counts, and the bass and drums just have to follow him as best they can. So the songs end up with very modern-sounding, unusual structures. The dislocation between the various elements emphasises the loneliness in the songs. It has an absolutely unique atmosphere – the voice is swathed in a 50s-style reverb, the instrumentation and string arrangements are very mid-60s, but when they lock into a groove and trance out (like on What Colour Are You?) it could have been made last week. It’s not only my favourite Bob Lind album; it’s one of my favourite albums, full stop. Go figure. Izzy Bizu on … Ala.Ni: You & I (No Format, 2016) Ala.Ni is from London but lives in Paris and she has sung with Damon Albarn and Mary J Blige but I love her own music. It reminds me of old songs such as Dream a Little Dream of Me. I saw her playing in this bar, like some cool 1940s nightclub, and she started singing at really low volume, and it was so beautiful I fell in love with her. A few years later I was on the Eurostar and I saw her walking past and I was like: “Oh my God, it’s the girl from the bar!” So I said hi and told her I loved her music. Then I saw her again at a festival and she was incredible. The sounds she uses, the mic she uses, it’s really “old” and the way she sings is really conversational. She even uses her hands in a really elegant way. Listening to her is like having a big hug; you feel like you have had a massage. Saul Milton of Chase & Status on … Angus & Julia Stone: Down The Way (Capitol, 2010) You would expect us to be constantly listening to drum’n’bass, the Prodigy, Biggie Smalls and bashment but we have a wide spectrum of music that we love. We were touring America in 2011 for our No More Idols tour and our frontman MC Rage put this on our tourbus and this incredible tune called Big Jet Plane came on. The beautiful music and combination of male and female voices really touched me. It became the soundtrack to the tour and since then I’ve followed their career and got all their records. Fans of folky funk with classic songwriting and modern production – Bon Iver fans, for example – will love it. Sarah Cracknell of Saint Etienne on … Laura Nyro: Eli and the Thirteenth Confession (Columbia, 1968) She doesn’t have the recognition that she’s due. Other people, such as Barbra Streisand and the 5th Dimension, had hits with her songs: she was a bit of a Carole King. This was her second album – she was 20 at the time. She had so much passion in her songwriting, her voice and her arrangements. Very theatrical, in a way: she clearly influenced Kate Bush. I love the changes in tempo – these are songs of many parts. Her singing style was a mixture of jazz, gospel, soul and pop. But she had a real fear of performing live that stemmed from a disastrous appearance at the Monterey festival. She retreated from the limelight after that, although she carried on making records such as the cover versions album Gonna Take a Miracle, with Labelle, which is another brilliant album. Tom Ogden of Blossoms on … Dion: Born To Be With You (Phil Spector Records, 1975) Phil Spector produced six of the tracks; I’m a big fan of his Wall of Sound. Spector was drinking a lot and quite fucked-up when he was making this record. Dion disowned it and he faded into obscurity. He described it as “funeral music”. I think it’s a great pop record: grand and epic. It’s got that Be My Baby sound, with a lot of the Wrecking Crew on. I love Only You Know and In and Out of the Shadows, which were both co-written by Spector and Gerry Goffin, who used to write with Carole King. It was actually James Skelly of the Coral, who produced our album, who put me on to it. Musicians love it, such as Bobby Gillespie and Pete Townshend. And Bruce Springsteen, who visited the studio during the recording of it. It’s got an uplifting melancholy to it, a euphoric heartbreak –an atmosphere I’m always trying to recreate. Moby on … Simple Minds: Sons and Fascination/Sister Feelings Call (Virgin, 1981) This album charted when it was released, but over time has slipped gently into quasi-obscurity. Simple Minds went on to become a stadium rock band, leading most people to forget that before super-stardom they were idiosyncratic, electronic and Bowie-influenced. I first heard this in early 1982 when I was a junior at high school in Darien, Connecticut, and for me it was everything that suburban America in 1982 was not. It was atmospheric, weirdly European and disco-influenced at a time when radio in the States was all shiny American pop and pedantic rock. It’s a remarkable record that deserves its place in the canon of great Bowie-inspired albums. Jim Kerr of Simple Minds on … Robert Wyatt: Nothing Can Stop Us (Rough Trade, 1982) This is without doubt one of my favourite albums. Before its release, Robert Wyatt was known to me as drummer and co-vocalist of Soft Machine, through listening to John Peel, who almost single-handedly championed him throughout his solo career. Peel brought Wyatt further attention, particularly in 1983 when his original version of Elvis Costello and Clive Langer’s Falklands war-inspired song Shipbuilding reached No 2 in his Festive 50. By that time, I was already well under the influence of Nothing Can Stop Us. It was on my Walkman throughout that summer, usually as I hoofed it on a daily basis from Paddington up to Shepherd’s Bush, where my mates and I were busy occupying ourselves with the recording of a bunch of songs that would be released as New Gold Dream. I loved listening to the album in its entirety, and repeatedly so. I still do. Why? You could begin by listening to At Last I Am Free, followed by Strange Fruit, and then the aforementioned Shipbuilding. And perhaps like me you, too, will get a lump in the throat listening to what was surely a purposefully pale and wan rendition of Red Flag. I don’t think Robert Wyatt knows how great an artist he really is. Green Gartside of Scritti Politti on … The Clark Sisters: Is My Living In Vain (Sound of Gospel, 1980) This was given to me by a writer I met in New York in about 1982: this recording of rapturous devotion to God has abided with me ever since. It’s so good … it almost passeth all understanding. Taped live in 1979 at Detroit’s Bailey Cathedral, Elbernita “Twinkie” Clark with her four sisters and their mother, group founder Dr Mattie Moss Clark, perform some of the most ineffably sublime music I have ever heard. As funky as grandpa’s drawers and with an ecstatic sense of yearning, the sisters’ goosebump-inducing singing – sometimes fragile, sometimes fearsome – is put to the service of eight exquisitely crafted paeans to the Lord. You can find a clip of the sisters in their floor-length pastel chiffon gowns performing a version of the album’s title song on YouTube, which is magnificent but only hints at the record’s treasures. In 1983, the Clark Sisters performed at the Grammys, provoking the ire of their church, which forbade Mattie Moss from ever performing with her daughters again. Her singing of They Were Overcome on this album is one of the loveliest things I know. A couple of years after I was first given the record, the sisters came to London to sing at [the] Westminster Hall. After their astonishing appearance I approached them to express my admiration and gratitude. I was invited to visit the family next day at a house in Tottenham, or maybe it was Finsbury Park. I’m sure I was a nuisance but they were gracious and I was blessed with some albums from their back catalogue. Is My Living In Vain is an exalted delight and is up there with the venerated best. Petite Meller on … The Clark Sisters: You Brought the Sunshine (Sound of Gospel, 1981) I was recommended these sisters by a female Uber driver in LA; I’d just played my song Baby Love to her. It was my best musical ride. She heard the gospel vocals in my song and said: “You’ve got to hear these girls!” They’re sisters who sing these big gospel songs with so much energy and love. It’s inspiring to listen to as it gives me ideas. I love the rawness of the recordings from those days. Go find them … you won’t regret it. Naughty Boy on … Nitin Sawhney: Beyond Skin (Outcaste, 1999) I was in the sixth form when I came across this. I was working in Watford WH Smith in the music department, and I’d get 25% discount, so I ordered it in and used to listen to it on my PlayStation because I didn’t have a CD player. I was fascinated because Sawhney was British-Asian, too: I didn’t think it was possible to make Asian sounds and still be cool. On the surface, the album was about nuclear weapons, but really it was about a personal quest to find yourself, with lots of songs about love. It’s quite dark, but the lyrics are full of light. He was refusing to be bound by any rules. He combined flamenco music with Qawwali, jazz with drum’n’bass. It made me ultimately brave. Once I’d finished sixth form, I was ready to start my journey as a composer and producer. Being boxed-in wasn’t an option because of this album. Sean Paul on … Buju Banton: ’Til Shiloh (Loose Cannon/Island, 1995) I bought this at the Derrick Harriot record shop in Kingston, Jamaica. It was one of the few stores that would carry albums as soon as they were released; they used to rent movies on VHS as well, so it was a popular spot. When it came out, Buju was already a dancehall superstar but it took him to a different level. Most dancehall albums at that time were usually a collection of hits that were already out but this was made up of new material. When I got home and put it on the stereo, it was mind-blowing. Buju was in full-on rasta mode and every single song was absolute fire. The consciousness was turned all the way up. Even on the party songs and girl tunes he was talking from a higher perspective. Champion and Murderer may have been the hardcore boom shots that everyone knows but Til I’m Laid to Rest and Not an Easy Road spoke to me deeply and truly inspired me even more to pursue music. Everyone needs to listen to this dancehall reggae gem and see who Buju Banton really is. Faris Badwan of Cat’s Eyes and the Horrors on … Faine Jade: Introspection: A Faine Jade Recital (Sandiland, 1968) This is one of my favourite psychedelic records – and one of the rarest. Get it now! It has the visceral edge of the Velvet Underground in places and the wistfulness of Syd Barrett in others. Faine Jade is effectively a solo project from Chuck Laskowski, a Long Island-based singer and guitarist who previously released one single with the Rustics in 1966. Barrett similarities run through the record; one of my favourite things about Syd’s songs is the feeling that they could go in any direction, at any moment. They are totally tense, raw and unpredictable, and the songs on Introspection follow a similar creative path. Laskowski claims to have been unaware of Pink Floyd at the time, which is totally believable as the tracks never stray into homage territory. While seeking to emulate some of the British psych sounds of the time, Introspection retains the identity of late-60s amphetamine-driven US garage. Don’t Hassle Me captures the spirit of rebellious youth, and Ballad of the Bad Guys is a burst of garage rock that Between the Buttons-era Rolling Stones fans will be into. The tension reaches its height on People Games Play, a song that combines the “ostrich guitar” strumming of Lou Reed with familiar late-60s percussion and unsettling, monotone vocals. There’s definitely a bit of the Byrds in here as well. The lyrics are fairly typical of the Timothy Leary era, with mystical lines such as, “Trim the wick with scarlet scissors,” but they fit the mood. Laskowski went on to release an album with the country rock band Dustbowl Clementine in 1970 but has since been largely inactive. More recently, Faine Jade gained wider exposure as MGMT covered the folk-rock title track Introspection on their debut Oracular Spectacular. Laskowski even gave his seal of approval by appearing with them on the closing date of their accompanying US tour. Petula Clark on … Michel Colombier: Wings (A&M, 1971) Herb Alpert produced this album, mostly in LA and Paris. It was a hugely expensive project, a mixture of jazz, rock, symphonic, with fantastic people on it – Bill Medley, Paul Williams – and some great jazz musicians. It’s one of those masterpieces that isn’t what you’d call a commercial record, but it’s one of my favourites. I love Herb, and Michel, who was a great composing talent. It was a bit of a love-in! There’s some amazing music on it: very moving – there’s a song on it called Emmanuel, for Michel’s son, who died very young – but it also rocks like mad. It was very personal to Michel, who was a very unusual musician. He was often in another place, another world. It was made for pure pleasure. You could call it a kind of folly. Alexis Taylor of Hot Chip on … Franco Battiato: Foetus (Sony/BMG Italy, 1971) It’s progressive rock but more short song-based than overblown 15-minute rock like Yes, Genesis or ELP. He’s a composer and songwriter who’s still one of Italy’s best-known musicians; a sort of Italian Peter Gabriel. He moved away from this strange experimental record towards a more poppy, new wave direction; Foetus is his first solo album. It’s a very beautiful-sounding, analogue synth-based record, but also very pop: the songs are very immediate, melodic and easy on the ear. The Italian version was the first one I really loved; then I came across the English version and that suddenly opened it up; now I knew what the songs were about. It’s a very original take on describing your place in the world; not your usual singer-songwriter confessionals. It’s similar to the experimental pop approach of a Brian Wilson mixed with someone like Jim O’Rourke from 90s underground Chicago. Alexis Krauss of Sleigh Bells on … Eccentric Soul: The Deep City Label (Numero Group, 2006) The Numero Group collect really old compilations from obscure labels no longer in existence. This album is all of the tracks from a soul label based in Miami called Deep City; most of the music is mid-to-late-60s. A lot of the players were part of Florida marching bands – the cover of the album shows them wearing the most sick, badass uniforms – who later went on to run more successful studios that released funk and disco. This predates that stuff; it’s tracks that had no commercial success, but it does feature artists such as Betty Wright. It’s similar to what was going on in Detroit, only a little funkier. It’s a little rough around the edges, but if you like old soul, it’s great. Andrew Savage of Parquet Courts on … The Necessaries: Event Horizon (Sire, 1982) This is a record that has even evaded diehard fans of Arthur Russell, who played keyboards in the group during their short lifespan and wrote two of the album’s best songs: Driving and Talking at the Same Time and More Real. When I listen to Event Horizon, I marvel that it isn’t one of the most influential records in rock music. But it didn’t make the impact it intended to, and was forgotten by Sire and eventually by fans. Russell went on to a celebrated solo career after quitting the band by jumping out of the van at the mouth of the Holland Tunnel in New York, while on the way to a gig in New Jersey. But this is a record that needs to be examined further by anybody interested in this era of rock music. It’s an elusive missing piece to the lore of the downtown scene. Everyone who walks through the door of my apartment is subjected to and is changed by it. Mark Stewart of the Pop Group on … The Fire This Time: Dancing On John Wayne’s Head (Extreme, 1995) It’s a shining example of an activist-musician using art as a weapon. The guy who got it together is Pat Andrade, who organises indigenous resistance, helping Aboriginal people, with songs about native rights issues and the way corporations own the government. In the punk days, people tended to wear politics like a haircut, but Pat actually walks what he talks. He was influenced by us [Pop Group/On-U Sound] to a certain extent. There are loads of guests – Augustus Pablo, Chuck D, Mikey Dread – on this album. He’s a real internationalist; a dub activist. It’s resistance through reggae. What he’s talking about is really real. Charlie Simpson of Busted and Fightstar on … Aereogramme: A Story In White (Chemikal Underground, 2001) When people talk about artists who don’t get the recognition they deserve, Aereogramme are always the first band I think of. It’s a stunning record, so different to anything I’d heard before: atmospheric, with beautiful melodies and really heavy riffs. I got into Mogwai through my brother when I was 11 or 12 and I thought it would be great to have that sort of music with vocals and Aereogramme did just that. I love the contrast of light and dark. It was definitely an influence on Fightstar. Funnily enough, Iain Cook the guitarist, is now in Chvrches, so he did finally get some recognition. Shirley Manson of Garbage on … Hey! Elastica: In on the Off Beat (Virgin, 1984) They were my peers growing up in Edinburgh. I had a massive crush on Giles, the singer with the thunderbolt hair: she was like a rock star, with incredible charisma and an image that would still look killer today. Back then she appeared to come from Mars: she was like a female David Bowie to me. I worked in Miss Selfridge and she came into the store one day and I kept staring at her. Later I got introduced to her at a club and became obsessed with her and her band. I still think they deserve more recognition; they were a fantastic pop band. The record was produced by Tony Visconti and Martin Rushent, and the result is a strange mix of white funk, jangly 80s guitar, catchy pop and synths, with girl group harmonies and some “alternative” flavour. They flamed brightly for a few minutes then seemed to disappear, but they’re really unique. Rebecca Ferguson on … Lisa Gerrard: The Best of (4AD, 2007) She used to sing with Dead Can Dance. She is kind of classical and sings in her own language that she makes up. She works a lot with Hans Zimmer and she’s just unreal. She did the theme from Gladiator, Now We Are Free. That made me want to find out more about her. I really like the song Sanvean (I Am Your Shadow). It’s quite dark; heavy and emotional. It creates a mood and it’s moving. To me, she’s one of the best vocalists of all time. If someone went on The X Factor and sang Now We Are Free, it would be unbelievable. It’s whether the audience are ready for that. Gilbert O’Sullivan on … Carole King: Writer (Ode, 1970) This was Carole King’s album before Tapestry, which I don’t think anybody bought apart from me and a couple of other people. She made an album before it, in 1968, with a group called the City because she didn’t really like being a frontperson. But Writer was significant because it was the prelude to Tapestry. There are some wonderful songs here such as Up on the Roof and Goin’ Back – covers of her own songs. But the album only sold about 10 or 20,000 whereas Tapestry sold 10 or 20m! James Taylor is on it, and [guitarist] Danny Kortchmar; a lot of the same people who were on Tapestry. It’s a really lovely album. It definitely influenced my writing, particularly the chord sequences on Child of Mine. If I’d grown my hair and worn jeans and a denim shirt I would have easily fitted into that category of singer-songwriter. But I dared to be different and chose an unusual image. Stuart Braithwaite of Mogwai on … Abner Jay: True Story of Abner Jay (Mississippi, 2009) This is the only record I own that I love that has jokes on. I tend to like miserable, depressing, pretentious music. Abner Jay was a one-man-band, who classed himself as an entertainer – “The last great southern black minstrel show,” as he described himself. He’d move from town to town, selling vinyl records and cassettes that he published on his own label. It’s folk-blues; the kind of thing that, when you hear it, you can’t believe it hasn’t sold a million copies. It’s a guy singing his heart out, playing amazing music. The songs are absolutely incredible, poignant, dark, really captivating and wild. He wrote them about Vietnam, cocaine, the moon landing. My favourite one on this album is I’m So Depressed. That’s the one that blew me away. I’m not sure if it’s a joke, but it’s really moving.
 
Topic 5
Amma Asante: ‘I’m here to disrupt expectations’ Amma Asante is drinking tea – “If you have PG Tips, all the better,” she calls to the retreating waiter – in the plush quietness and gleaming surfaces of London’s Cafe Royal. Despite traffic jams and torrential rain, she is impeccably calm, certainly calmer than many film-makers would be had their latest production been selected to open this year’s London film festival. But Asante, whose previous films A Way of Life and Belle garnered her high praise and multiple awards, including a Bafta, is clearly a star in the making – and possibly also a star-maker; Gugu Mbatha-Raw, whom she cast in her breakthrough part as the title character in Belle, has just appeared opposite Matthew McConaughey in the American civil war drama Free State of Jones. Earlier this year Asante was also invited to become a member of the US Academy of Motion Picture Arts and Sciences, which has had its biggest ever intake of new members following intense criticism over the lack of racial diversity in Oscar nominees. In joining a Hollywood club with a decades-long reputation for being largely white, male and aged over 50, she’ll now have voting rights on the Oscars, and a part to play in steering the industry and what comes to our screens in the future. For the moment, though, she’s concentrating on A United Kingdom, which had an unexpected – and even inconvenient – genesis. About 18 months ago, Asante was about to move not only home but also country, quitting the Netherlands, where she had lived for eight years, in favour of Denmark, where her husband is from. Amid all the upheaval and readjustment the phone rang. At the other end was actor David Oyelowo, whom Asante had known since they worked together on the BBC drama Brothers and Sisters back in 1998. Oyelowo, fresh from playing Martin Luther King in Selma, wanted to persuade her to be part of an idea whose moment had come – “a labour of love”, as he described it. The project was to film the life of Seretse Khama and Ruth Williams, the first prime minister of Botswana and his wife, an office clerk from Eltham. Their marriage, in 1948, when Botswana was still the British protectorate of Bechuanaland, had immense ramifications, both personal and political: Khama, who had met Williams at a missionary society dance in London, had been supposed to return from his stint at Balliol College, Oxford and subsequent studies for the bar to take up the kingship of the Bamangwato people. He was not supposed to return with a white, English bride, and particularly not just as neighbouring South Africa had made interracial marriage illegal under the apartheid system; her arrival angered both Bamangwato chiefs and many who couldn’t believe that their future leader would choose an outsider above a local. Ruth Williams’s family also opposed the marriage, and there was vehement objection from the British government, enraged by what they saw as a dangerous misstep in managing regional relationships. Oyelowo had first come across Susan Williams’s book Colour Bar, on which the film is based, in 2010, through producers Justin Moore-Lewy and Charlie Mason, who had acquired the rights. Since then, the three had struggled to get the project, with Oyelowo playing Khama, off the ground. But the story of Khama, Williams and Bechuanaland’s gradual journey towards independence immediately struck a chord with Asante, fresh from her success with the recently released Belle, which also drew on a complex piece of history to explore relationships across racial divides. Her father, she tells me, was a pan-African, a man who believed in a united states of Africa. “He grew up in Ghana when it was still the Gold Coast; grew up, as my mother did, as the child of a colony, and watched it become independent. And Ghana was the first sub-Saharan country to gain its independence, so we always lived with that badge on our chest; I was always raised knowing that was the country that I came from. I grew up being able to repeat – at seven or eight years old — the speeches of Kwame Nkrumah, who became the first president of Ghana.” Consequently, she explains, she was gripped not only by the fierceness and endurance of the romantic relationship at the heart of the story, but also by the intricacy and subtleties of its sociopolitical setting. Reading her way through Williams’s book – it’s brilliant, she says, but so dense with complex detail that she could only read 18 pages a day – she realised that she wanted to explore how Khama came to a point where he could contemplate utterly changing the political landscape of his country. “Even though I didn’t know the story,” she remarks, “I was very aware of the young, privileged men of Africa who moved through the UK in the 1940s, who were sent to be educated. I knew it because the women weren’t.” What she didn’t want, she explains, was to privilege one aspect of the drama over the other. And neither did she think it was necessary: “You could create a very political backdrop against the love story. Because, really, what is interesting about being a black man married to a white woman today? Yes, in certain quarters, it’s still difficult and there is still a taboo. But it’s not that interesting – why pick them, as opposed to any other interracial couple? What’s really interesting is what happened once this couple chose to fall in love, the period in which they fell in love, which was right as South Africa was about to enshrine apartheid into its laws, and the fallout that occurs.” She notes – while also acknowledging the earlier film’s vital importance at the time – that A United Kingdom is not a rerun of Guess Who’s Coming to Dinner, the 1967 film in which a black man played by Sidney Poitier courts a white woman, to the consternation of her parents. Rather, she says, she had to find those things in the story that would resonate with contemporary issues. Among those is the issue of transition and identity. One facet of the story she focused on explores the idea that someone might be sent away at a formative age to experience life and education in another country and yet still be expected to return essentially unaltered; it also shows those at home, inching their way towards establishing nationhood in the face of societal change. I tell her that I was struck by the numerous interwoven stories of restriction and emancipation, and the different weight that history accorded them. Near the start of Asante and screenwriter Guy Hibbert’s film, Khama and his wife, played by Oyelowo and Rosamund Pike, return to Bechuanaland and are met with hostility, despite his previous popularity; he determines to address the kgotla – a public meeting – and put his case. Scores of Bamangwato men, many of them dressed in suits, walk from their villages to attend, but there is barely a woman to be seen. Asante nods: she dotted a few around the edges, she remembers, as if to suggest that they couldn’t help themselves from coming to listen, but there was a firm message that politics was not for women. And yet she knew that she had to represent the view of Bamangwato women. “When I first came to the script, the point of view of the black female wasn’t really there, and it was very important,” she says. “I thought about my mother, I thought about my aunts; my mother was born and raised in a very rural village, but her brother is a chief. And the idea that he should go abroad and return, even with someone of the same colour but who was an outsider, and say, this is going to be your queen, I just imagined what their response would be. And there you have it, in the film.” Asante has had a lifetime of considering the nuances that attach themselves to the questions of identity and power informing her work. Now 47, she reckons that she is in a position to empower two sides of her identity – her Ghanaian heritage and her British upbringing – to be in dialogue with one another. “I allow that conversation to happen, and it’s a pleasure,” she explains. “And I don’t know what side I’ll come out on each day, or what decision I’ll come out with on each day, but it is a dynamic rather than a conflict.” Is she able to put into words what characterises these different parts of her? She mentions her pride in the traditions of her parents’ Ghanaian background, and of how important it is to her to be able to speak their language. “And yet, the very British side of me, who is the child of immigrants, is the side of me that welcomes outsiders – the modern British side, that is – and enjoys crossing boundaries and sharing boundaries and being open to what an outsider might bring. But I’m still deeply protective of my traditions at the same time.” (Amusingly, as we both ponder the miniature glass cloche covering the miniature biscuit that has accompanied tea, she puts her mild aversion to elaborate service down to her British “side”.) She grew up in Streatham, which she describes, in the early 1980s and beyond, as “a pretty racist environment” – complete with graffiti on the walls and lit matches pushed through the letterbox. “That was just a way of life,” she says now, inadvertently making reference to the title of her first feature film, “but I was aware of the stress it put my parents through.” Her accountant father’s response was to tell his family that there was one thing they had to remember at all times: “Know that you are loved.” Fascinatingly, these exact words recur as a line in Belle (2013), the story of Dido Elizabeth Belle, the child of a British admiral and an African slave, who was brought to England by her father and left in the care of her great-uncle, Lord Mansfield; they are the words spoken to her by her father, whom she only knows for a few hours, as he bids her farewell. Even more poignantly, Asante’s father died during the filming of Belle, and she talks movingly about his impact on her work. She will always, she thinks, create benevolent fathers who are also flawed; hers, whom she describes as her hero, “made mistakes, but when he got it right, he got it really right”. Belle grew up in Kenwood House in Hampstead, surrounded by great material privilege and familial love, but simultaneously excluded from vast swaths of society by the colour of her skin. As in A United Kingdom, there is a love story; but there is also a highly involved narrative that chronicles the changing legal position of slave cargo – at heart, the degree to which slaves being transported at sea were regarded as human beings rather than mere possessions, to be jettisoned at the drop of a hat. Both elements of the film unite to portray a mixed-race woman growing in self-recognition and self-possession, and balancing the different claims made on her loyalties. Both movies also imply that a key moment in the journey towards selfhood is the acceptance that individuals contain multitudes. As a child, Asante began to act, and joined the cast of Grange Hill; she was part of the “Just Say No” campaign, and was one of nine cast members to visit Ronald Reagan’s White House. But she would also develop lines to use in her off-screen life; for instance, she always used to reply “Ghana” when asked where she was from, because “Streatham” seemed to cause confusion of the “No, where are you really from?” variety. “So that became too complex,” she recalls, “and also it was a big fat rejection, because I actually felt as British as anybody else but I would constantly be reminded that I wasn’t. And so it was easier to just say African.” But things changed somewhat when her debut, A Way of Life, was released. Set in Wales, the film tells the story of a young, single mother fighting extreme disadvantage, and also of her Turkish, Muslim neighbour. It started to get a little attention, and “quite often I would read about myself, and it would be, ‘young British film-maker’. And when you see words written about you, they’re very powerful.” Did she feel that, in a sense, she was being claimed? Yes, she replies, “but there was a sense of, well, that’s what I’ve been saying all along, but haven’t been allowed to say. But that’s exactly what I am. I’m a young British director.” We talk more broadly about the issues of migration and the resistance to it that are bedevilling the world at the moment. Asante locates in much of the fear that surrounds the conversation an interesting insight into entitlement. “I often think about what we might look back at in 100 or 200 years’ time from now and see as really…” – she grasps for the word – “primitive. Because we fear, we really believe, there isn’t enough to share, and there really isn’t enough to go around, because that’s a narrative that we’re given. But that’s because we’ve decided that certain boundaries should exist and must exist, and you should stay over there, because the world over there is created for you, and the world over here is created for us. Well, that’s never worked.” At the time, she points out, change is always complicated, and when it happens too quickly, can be problematic. “You can’t have a country of fearful people,” she says, and in A United Kingdom, she is understanding of the competing demands on the Attlee and Churchill governments, both of which adopted problematic stances towards Bechuanaland as they sought to rebuild postwar British society. And yet, as she also says and the film makes clear, there was a good outcome: Seretse Khama took his country towards independence and democratic representation, and there it remains. She has already been criticised, she says, for making too much of a crowd-pleaser, to which she retorts that she can’t change history. But does she think that underlying that attitude is an unfamiliarity, perhaps even tantamount to disbelief, with the business of telling an African success story? She nods vigorously. “There was an argument over whether we should show some of the more beautiful images that we have in the film of Africa. This is why you need a person of colour at the table. Because I said, why not? That’s the Africa I know. Hundreds of thousands of people travel to Botswana every single year to go and see the animal life there. Why would we pretend that that doesn’t exist? Why wouldn’t we show the beautiful sunsets? I remember waking up in my mother’s African village to beautiful sunrises and beautiful sunsets. “We’re so used to seeing flies in African children’s faces, we’re so used to seeing what I call a degraded Africa, that does not have a person of colour at the centre of their own story – they’re usually a supporting character who’s an observer of their own story – that sometimes I think that when you see it told a different way, which means that you take a character like Rosamund Pike played in Ruth and flip the switch and make her the other, then it makes some people feel uncomfortable. Your expectations are disrupted. And I believe that’s what I’m here for. I hold that flag.” Asante is full of praise for Pike, who came to film after Gone Girl, and immediately embraced the no-makeup, frizzy hair and sensible shoes look that her character adopted when she moved to Botswana (there are rather more swinging skirts with nipped-in waists at the jazz clubs that feature in the film’s London scenes). “To me, she embodied the courage that I imagined Ruth had,” she says. Particularly impressive was Pike’s insistence that she would simply drop to the ground during a scene in which Williams, suffering from diphtheria, collapses on a dusty road. Asante, worried about the numerous rocks in the path, had had sleepless nights wondering how they could conceal a mattress, but had to content herself with setting the crew to remove as many stones as they could. When one of Khama and Williams’s sons visited the set, he delivered the ultimate imprimatur: “It’s not every day you see your mother and father come back to life.” Next, Asante is going to tackle the Nazis. Where Hands Touch, which she has written herself, will start filming in October, with The Hunger Games’s Amandla Stenberg and Captain Fantastic’s George MacKay starring as a teenage couple facing the not inconsiderable obstacle of his membership of the Hitler Youth and the fact that she is a mixed-race girl living in the Third Reich. Once again, issues of identity play an integral part, as does Asante’s abiding interest in capturing social and political structures at the moment where they begin to fall apart. We conclude by talking about broader issues of representation within the film industry, and specifically in the context of her recent membership of the Academy. How effective does she feel that development will be in promoting change and inclusion in the entertainment business? It is, she says, a “substantial and relevant” move, and she commends the Academy for doing it. But she remains realistic: “When you’re in it, it seems slow and it feels slow. When we look back in 100 years, who knows how it will look with hindsight. However, it does feel like we’re turning a corner. It’s not a short corner, it’s a very big bend, and we’re some way around it and we’ve still got a long way to go. Let’s be really honest about this: the Oscars reflect the industry, so the Oscars can change but they can only do so much without the industry changing as well.” In other words the movies need to get made in the first place, so that audiences are not presented with eight identical films when they go to the multiplex. Cinemagoers, too, can play their part, choosing to see a more diverse range of films as they are released, and not necessarily waiting until they come out on DVD. “It’s really interesting, “she continues, “that if you walk into an industry party and it’s predominantly male, predominantly of a certain age, predominantly white, it starts to feel old-fashioned. It doesn’t feel progressive. When you walk into a place and you see women, and you see people of colour, and varying abilities and disabilities, it feels like it’s somehow a reflection of the world – you’re in the world, and that we’re in a relevant industry.” She laughs, remembering her recent trip to a vibrant Toronto. “That didn’t mean to say that the lovely old white men were gone. They were still there!” The bottom line, she thinks, is that the industry needs to see a broadening of the wares as a business opportunity, not merely as a matter of morality: “If you do not have a flourish of new lifeblood,” she says, “you don’t get a beautiful ocean, you get a dull, dank puddle.” A United Kingdom opens the London film festival on Wednesday and will be in cinemas from 25 November Race on screen: critic Jonathan Romney’s highlights from this year’s London film festival Chi-Raq Dir: Spike Lee The Greek comedy of Lysistrata’s sex strike, adapted as the story of a Chicago woman who campaigns to stop gang war Spike Lee’s most acclaimed film for ages – a jovial yet impassioned musical strike against violence within black communities. Angela Bassett, Wesley Snipes and Samuel L Jackson join newcomer Teyonah Parris in an uproarious slice of hip-hop Brecht. Daughters of the Dust Dir: Julie Dash An evocation of a community of island-dwelling African American women in 1902 Now restored, Julie Dash’s 1991 debut feature opened up a new direction in independent US cinema that has never been followed up. Fusing black history, costume drama and a vision of feminist utopia, this dream-like film was one of the inspirations for Beyoncé’s Lemonade visuals. The Birth of a Nation Dir: Nate Parker The story of Nat Turner, a preacher who led a slave revolt in Virginia in the 1830s A Sundance-winning debut from actor turned writer-director Nate Parker. It polemically appropriates the title of DW Griffith’s 1915 film – a classic forever identified with American racism, against which Parker boldly takes up the cudgels. Divines Dir: Houda Benyamina A young woman from the Paris banlieue hustles to survive, while getting emotionally entangled with a male breakdancer The debut from French director Houda Benyamina, inspired by her experiences of the 2005 Paris riots, was one of this year’s Cannes breakout titles. Anarchic, ferociously energetic and joyously flouting the sexual stereotypes of hood drama, it introduces the explosively talented Oulaya Amamra as heroine Dounia. Hissein Habré, A Chadian Tragedy Dir: Mahamat-Saleh Haroun The former president of Chad prepares to stand trial for the crimes of his regime Mahamat-Saleh Haroun is one of the foremost contemporary African directors, his dramas including Abouna and A Screaming Man. Here he’s in a less familiar role as documentarist, scrutinising the past and present traumas of his own country. The 60th BFI London film festival takes place across the capital, 5-16 October
 
Topic 6
'This is insane. This is three Brexits': Trump supporters savour special night Just before 3am on Wednesday at the Hilton hotel in Midtown Manhattan, Donald Trump made his entrance to his victory party amid chants of “U-S-A! U-S-A!”. If they could have heard it in the nearby convention centre where they awaited in vain for Hillary Clinton, it might have sounded like a threat. Just as at his freewheeling rallies, his entrance to the crowded ballroom was heralded by the theme music of Air Force One, a Hollywood action film starring Harrison Ford as the American president. All eyes turned up to the balcony. There stood a tall figure in dark suit with white shirt, red tie and familiar shock of orange hair. But this was no movie. This was the president-elect. Trump – who at 70 will be the oldest person ever to assume the office – clapped and raised a triumphant fist above a blue “Make America Great Again” banner. He was followed by a royal train of grinning family members, political allies and campaign aides, some scarcely able to believe what just happened. Behind them the curtains were illuminated red, white and blue. An improbable, rollicking, at times farcical campaign that had begun with a ride down an escalator at Trump Tower in June last year – in the days when he was dismissed as a clown posing no possible threat to the republic – culminated in an exultant strut down a staircase at a nearby hotel. Trump gave the thumbs up and applauded some more as he walked on to a stage where two red “Make America Great Again” baseball caps were mounted in glass cases like religious relics. He took the podium against a backdrop of 24 US flags plus state flags, with son Barron on his left and running mate Mike Pence on his right, as the crowd chanted “U-S-A! U-S-A!”. After 17 months of bile and braggadocio in which he threatened to jail his opponent, suddenly Trump was Mr Magnanimous: “I’ve just received a call from Secretary Clinton. She congratulated us – it’s about us – on our victory and I congratulated her and her family on a very, very hard-fought campaign.” He added: “We owe her a major debt of gratitude for her service to our country. I mean that very sincerely. Now it’s time for America to bind the wounds of division.” It was not quite plagiarism on the scale of future first lady Melania Trump at the Republican national convention, where she copied large parts of a Michelle Obama speech, but it did bear an uncanny resemblance to Abraham Lincoln’s second inaugural address: “Let us strive on to finish the work we are in, to bind up the nation’s wounds.” Yet less than an hour earlier, when Clinton’s face flashed up on giant TV screens showing conservative Fox News, the guests at Trump’s victory party had erupted in loud boos, chants of “Lock her up! Lock her up!” and a hearty rendition of “Na na na na, na na na na, hey hey, goodbye”. For a night, this bland high-ceilinged room in a bland corporate hotel was the centre of the political universe. A business tycoon, reality TV celebrity and architect of one of the most divisive and incendiary campaigns in memory – some compared him to Hitler or Mussolini – had become the most powerful person on the planet, his finger on the nuclear trigger. “First,” he said, “I want to thank my parents who I know are looking down on me right now.” His mother, Mary MacLeod, was from Stornoway in the Outer Hebrides, once described by Trump as “serious Scotland”. His father, Fred Trump, the son of a German immigrant, became one of the New York’s biggest developers and landlords. After a formative spell at military academy, Trump went the Wharton School at the University of Pennsylvania and joined the family business, taking control of it in 1971. He has claimed his father gave him a “small loan of a million dollars” to help. The firm expanded into Manhattan, and the Trump name spread internationally, but he suffered his share of business failures, notably when four casinos went bust in Atlantic City. In 2003 his celebrity soared with The Apprentice, in which contestants battled for a shot at a management job within his organisation and he could say with relish, “You’re fired!” His eruption on the political stage was not entirely unexpected. Once a registered Democrat and donor to the party, he entered the 2000 race as a Reform party candidate but did not last. He also led the “birther movement” after repeatedly questioning the birthplace of Barack Obama. He finally conceded this year that the US president was born in Hawaii but offered no apology, fuelling the allegation that he had run a racially charged, white nativist campaign. He also faced a string of sexual assault allegations on his way to the White House. Trump may have been propelled to a shocking, paradigm-shattering victory by blue-collar workers, but the guests at his election-night event were decidedly moneyed. The men were in suits and ties, the women in dresses. They began filtering in after 6pm in somewhat subdued mood; just like Brexit champion Nigel Farage on the eve of that result, campaign manager Kellyanne Conway appeared to lower expectations by complaining of a lack of support from Republican stalwarts. Yet what would follow would be a night of rising hope, of belief spreading around the room like a wildfire, of daring to believe that their man might just pull off the biggest upset in modern political history. TV celebrity Omarosa Manigault, Trump’s director of African American outreach, held court with reporters, insisting that the candidate was supremely confident but that she felt “butterflies”. She mused on the circularity of having worked on The Apprentice at Trump Tower years ago and now being back there watching her mentor become “leader of the free world”. National spokeswoman Katrina Pierson also showed up. “Are you nervous?” someone asked. Pierson replied: “Nothing to be nervous about.” The drinks began to flow. Someone said: “We’re making America great again.” A friend replied: “Trying, trying.” Each time Fox News flashed up a Trump victory in a reliably red state, the guests cheered and waved signs with slogans. Each time it showed Clinton had won a Democratic stronghold, they booed. Then the Republican candidate won Ohio and North Carolina. Suddenly, what had seemed like a pipe dream felt just a little more tangible. Jeff Sado, 58, a property broker and film producer, said: “I’m very excited. It looks good so far. You know what they say: when you win Ohio, you win the presidency. I’ve always liked Trump, and if you look at our country as a corporation, who better to run it than a businessman?” The crowd became thicker and noisier with more “Make America Great Again” caps in evidence. Confidence surged into every corner of the room. And then there was Florida. The crowd erupted in its biggest roar of the night so far and people high-fived. It was game on. Wearing one of those caps, Benjamin Marchi, 38, who owns a home healthcare company, said: “Driving up, we were depressed. We felt this was not going to go our way tonight. We were saying, even though he might lose, he was setting up the party to reach out for voters we haven’t reached since Ronald Reagan. But now it looks like he might win the whole thing.” Marchi made comparison with Britain’s vote to leave the European Union. “This Brexit wave, it reaches across oceans. It really does. Never underestimate ordinary people because eventually they show up and vote.” The excitement also infected Diana Loffredo, 32, an events planner. “It’s crazy,” she said. “This is history in the making right here. I didn’t think so before but now I really do. Amazing. I’m amazed, ecstatic. She was the favourite and now he’s turned the tables.” Her husband, Scott Loffredo, 32, was watching the big screen when Fox News declared Wisconsin for Trump, a stunning surprise. “That’s it!” he exclaimed. “It’s over! This is history!” Asked to characterise his emotions, Loffredo replied: “It’s hard to describe a feeling. I cannot overcome the utter disbelief. It’s sheer shock. I cannot break that shell. This is insane. This is three Brexits.” The sports event atmosphere took on a darker tone. The crowd chanted: “Lock her up! Lock her up!” Every so often the TV feed cut to Clinton’s election party where faces were disconsolate. Trump’s supporters booed and jeered without compassion. Thomas Stewart, a member of Trump’s national security committee, said of the Democrat’s followers: “I think they were a little arrogant, a little unfriendly. There were some Clinton people on the plane today and they were taunting me because I had Trump material in my briefcase. I thought, ‘Guys, you don’t have to be rude.’” As the momentum continued to build, Brian Lynch, 55, general manager of a country club, said: “It’s orgasmic. It’s like Brexit and, by the way, God bless London. People in London got it right. They want their country back; America wants its country back. It’s the same thing.” By now the room was nearly full but there was long wait for further results. Some broke into a chorus or two of “God bless America”. Some, after several hours on their feet, opted to sit on the floor. The atmosphere was becoming increasingly hot and claustrophobic. The TV showed Wall Street stock prices tumbling. Thomas Hilbert, 22, a portfolio analyst from Indianapolis, was watching his fortune diminish in real time. “I’m in biotech and it’s going to be down big tomorrow,” he said. “Everything’s going to be down. It’s definitely a price worth paying because in the long run it’s going up.” People studied their phones for the latest vote counts in Pennsylvania. But tiredness was creeping in. One woman could be heard saying: “At 3am I’m leaving.” But then, finally, came the announcement of a once unthinkable, perhaps unpalatable statement: Donald Trump elected US president. The crowd erupted in unbridled euphoria with high fives all round. Their “champion”, as Pence put it, made his entrance to Air Force One and departed to the sound of another golden oldie from his rallies, the Rolling Stones’ You Can’t Always Get What You Want. The Stones have objected to his use of the track. But now Trump is about to be president of the United States, who is going to stop him?
 

Let us find the closest document to the given one

In [20]:
new_request_original = '''There were four minutes remaining and none of the Newcastle United fans had left. 
Even with their team a man down and four goals down, they stayed. 
Even with another reminder of how their well-intentioned manager, Steve Bruce, 
struggles to build on the good work of Rafa Benítez, 
they kept standing there, kept singing, defying the rain and the pain.'''

# removing everything except alphabets`
new_request = new_request_original.replace("[^a-zA-Z#]", " ")

# removing short words
new_request = ' '.join([w for w in new_request.split() if len(w)>3])

# make all text lowercase
new_request = new_request.lower()


# tokenization
tokenized_doc = new_request.split()

# remove stop-words
tokenized_doc = [item for item in tokenized_doc if item not in stop_words]

# de-tokenization
detokenized_request = ' '.join(tokenized_doc)

y = vectorizer.transform([detokenized_request]).toarray().T
y.shape, v.shape
Out[20]:
((1000, 1), (7, 1000))
In [21]:
score = u @ (sigma[:, np.newaxis] * v.dot(y))
print(score.shape)
idx_best = np.argmax(score)
print(documents[idx_best])
(4551, 1)
Premier League: 10 things to look out for this weekend 1) Start of a tough run for the Hammers On the last day of the 2006-07 season Manchester United, who had won the title five days earlier, fielded a weakened side – Cristiano Ronaldo, Ryan Giggs, Paul Scholes, Rio Ferdinand and Nemanja Vidic were all left out of the starting XI – at Old Trafford against a West Ham team who needed at least a point to avoid relegation. Carlos Tevez, who was to join United a few weeks later, scored the only goal on the stroke of half-time. “They couldn’t have come to Old Trafford on a better day,” said Sir Alex Ferguson after the game. “We had already won the league and the edge was off our game.” There was also a 1-0 win in December 2001, against a wretchedly out-of-form United side that were completing a memorably horrific run of five defeats in seven league games. Those two games are the Hammers’ only highlights in a miserable run of top-flight visits to Old Trafford that now extends over 30 years and in which they have otherwise drawn once and lost 20 times. And now they must go there twice in four days, with Sunday’s match being followed by an EFL Cup quarter-final on Wednesday (in the same time period they have visited Old Trafford four times in cup competitions, losing two and winning one). With the Manchester double-header to be followed by games against Arsenal and Liverpool, stories this week suggesting “West Ham chiefs have started to consider their options should they feel forced to make a change” are not just unwelcome but almost cruel. After the visit to Anfield the Hammers have a less daunting run of four fixtures before the turn of the year and it would seem sensible to delay any judgment until they have been completed, which will helpfully coincide with the start of a new transfer window and, less helpfully, another game against Manchester United. SB • Are Manchester United really the unluckiest team in the Premier League? 2) Karanka’s bewildering persistence with Negredo Álvaro Negredo has failed to score for Middlesbrough since forcing home a close range debut goal with his shoulder against Stoke City on the opening day of the season and there is a growing clamour on Teesside for Aitor Karanka to drop the on-loan Valencia striker from a team that is joint bottom of the Premier League goalscoring charts alongside Hull with just 10. Karanka, whose side face Leicester City on Saturday, recently came out in defence of his compatriot, who has failed to find the net in 11 consecutive matches and looked woeful against Chelsea, where his obvious lack of speed and mobility came in for criticism. “He is working and fighting but he is not playing at Chelsea or Manchester City,” said Karanka, before expanding on a theme that is unlikely to boost dressing-room morale at the Riverside. “He is not with the team-mates he had in the past or the team-mates Diego Costa had at Chelsea.” Negredo has played 85 minutes or more in 10 of the 12 matches he has featured in for Boro this season and on the only occasion he was substituted – replaced by Jordan Rhodes against Tottenham Hotspur – Karanka’s switch was greeted with loud applause from the Riverside faithful. Middlesbrough’s manager may still have faith in his striker, but the fans do not. Rhodes and his fellow striker David Nugent have yet to complete a game in eight Premier League appearances between them this season and surely can’t do any worse than the man who has restricted them to little more than fleeting cameos off the bench. BG • Leicester City top dogs after Shinji Okazaki leads win over Club Brugge • Ranieri delighted but desperate to focus on Premier League problems • Danny Drinkwater to serve three-match ban for violent conduct 3) Cherries struggle against top five Bournemouth have impressed all impartial observers since their promotion in 2015, and indeed for a while before that, but their results against the current Premier League top five have disappointed: in 12 games so far they have won one – against Chelsea shortly before José Mourinho’s sacking last December – lost 10 and sit on the wrong end of an aggregate score of 31-5 (every other team that was in the division last season has been beaten at least once except Watford and Leicester, against whom they have neither won nor lost). Arsenal won both of their meetings last season by the same score, 2-0, and will face a Bournemouth side forced to play without the influential and injury-free midfielder Jack Wilshere, on loan from Arsenal. Despite his absence it might be a tough day for the woodwork, with these teams being the two most post-rattling in the top flight: the Cherries lead the way in this regard, having struck the frame of the goal 13 times so far, and Arsenal follow behind with eight. SB • Wenger not panicking on Arsenal second place in Champions League • Barney Ronay: Özil’s vision prevents Arsenal from drifting against PSG • Match report: Arsenal 2-2 Paris Saint-Germain 4) A touch of dead ball inspiration from Sigurdsson? Between them, Crystal Palace and Swansea City have managed just four wins and a staggering 15 defeats in 24 Premier League matches so far this season, a state of affairs that makes this contest the weekend’s equivalent of two drunks swinging at each other in an alley. Should either manager lose a game likely to be low on finesse but no less compelling a spectacle for its absence, they will find themselves the subject of no end of criticism from fans for whom the spectre of relegation looms increasingly large. Alan Pardew seems genuinely delusional, having convinced himself his side do not concede from set-pieces even though the stats suggest otherwise. Nine of the 21 goals shipped by Palace this season have come from dead ball situations and in Gylfi Sigurdsson, Swansea have one of the most accurate set-piece specialists in the business. Whether it’s from one or more of the free-kicks and corners Pardew’s team have proved so hopelessly inept at defending, the in-form Icelandic midfielder could well prove instrumental in helping Bob Bradley secure his maiden victory as Swansea City manager in a game that looks must-win for both men in charge. BG • The Knowledge: players confused by penalty rebounds 5) Ighalo’s woes to continue There has only been one home win in the last eight matches between Watford and Stoke, the away side winning five of those games including both of last season’s encounters. But Stoke have only won one away game since their visit to Vicarage Road in March – at Hull last month – and will probably have to overcome a Watford side buoyed not only by last week’s victory over Leicester but by the new formation that brought it. When preparing for his last visit to Hertfordshire Mark Hughes spoke about the Hornets’ key threat at the time, their front two of Odion Ighalo and Troy Deeney. “The two guys up top have had a big influence on what they’ve done,” he said. “They are a good pairing who work off each other really well and certainly they are something we’ll talk about before the game.” This time he needn’t bother: Ighalo’s influence in recent months has been minimal, leading to him being dropped in favour of Isaac Success for last month’s victory at Middlesbrough. Injuries to both Success and Watford’s other first-team striker, Stefano Okaka, allowed Ighalo to return to the side for their following three games but last week he was on the bench again as Walter Mazzarri played a 5-4-1 formation in which Troy Deeney was given considerably more effective support by a combination of the two wide midfielders, Roberto Pereyra and Nordin Amrabat, and by Etienne Capoue’s running from central midfield. When Deeney was replaced late in the game, it was by the recently-recovered Okaka; with Success now ready to return to the squad, Ighalo’s hopes of a return to the starting XI appear, like his recent form, underwhelming. SB • Football Weekly Extra: AC Jimbo and co preview the weekend 6) A third consecutive win for Sunderland? Free-scoring Sunderland have never beaten Liverpool at Anfield in the Premier League era but will fancy their slim chances of bucking that trend as they arrive on the back of consecutive wins for the first time since last May. Sunderland last won three consecutive league games three seasons and three managers ago, on the run-in of the 2013-14 campaign when wins over Chelsea, Cardiff City, Manchester United and then West Brom helped them pull off the mother of all escape acts. The bookies give them little or no chance of beating Jürgen Klopp’s Liverpool, who drew a rare blank against Southampton last weekend and have had a full week to find their range. You can get odds of 16-1 against David Moyes’s side making it three wins on the spin, but with confidence high, Moyes having bought himself some much-needed wriggle room and Victor Anichebe joining Jermain Defoe among the goals, Sunderland could conceivably leave Anfield with a point or even more. Of course the far more likely scenario is that they will get thumped but in facing top class opposition will at least get to see if their two recent victories were more down to good luck (Bournemouth) and the poor quality of their opposition (Hull City) than any major advances they have made under the stewardship of Moyes. BG • Steven Gerrard retires from football after ‘incredible career’ • Paul Wilson: Charlton and Guardiola offer Gerrard lessons from history • Sean Ingle: Do stats support ‘benefits’ of Liverpool’s European absence? 7) Burnley have a chance of an upset Manchester City’s last two Champions League games were followed by disappointing 1-1 draws at home to Southampton and Middlesbrough, and now they must follow a similar result at Borussia Mönchengladbach with a visit to a side that has already beaten Liverpool and Everton (as well as Watford and Crystal Palace) and come within a whisker of holding Arsenal, all at home. Burnley are the division’s Jekyll and Hyde side, boasting the sixth-best home record with an average 1.86 points per game (having played once more at home than any other team) and the second-worst away record, with the goalless draw at Old Trafford last month securing the only point they have won in five games on their travels. Motivated by the rollicking Sean Dyche gave them following a 4-0 capitulation at West Bromwich Albion on Monday – he told the press they “got drunk on the ball” and “just looked weak willed” – and against opponents who are themselves out of form and against whom they have a decent recent record (amounting to two draws and a win each in four Premier League encounters, though Burnley’s victory was a tight 1-0 win in March 2015, and City’s a 6-1 thumping in April 2010), there is reason for genuine optimism. Dyche said his side are relying on little more than “the marvel of football” and the fact “random results turn up”, but he is perhaps understating the chances of an upset. SB • Joey Barton back training with his former club Burnley • City through after Silva earns draw at Mönchengladbach • Yaya Touré left off shortlist for 2016 African player of the year award • Luis Enrique gives Messi to Manchester City rumours short shrift 8) Some sanity after the all poppy madness Football is never slow to embrace a cause and the Premier League has promised to throw its weight behind Stonewall’s rainbow laces initiative on a weekend when its own branding will feature a rainbow motif and most, if not all, Premier League players will wear rainbow laces on their boots as part of a wider push to encourage diversity in grounds around the country. Along with several extremely courageous former footballers, the ’s chief football correspondent, Daniel Taylor, continues to shine a light on the hitherto unreported scandal of historical cases of child abuse of footballers in a depressing story that looks likely to run and run. Considering some of those victims who have come forward to tell their horrific stories previously felt unable to speak out for fear of being labelled “gay”, any campaign to support LGBT people and stamp out homophobic abuse in football can only be applauded. BG 9) Some resilience from Spurs Ten minutes. That’s how long Chelsea need to keep Tottenham Hotspur at bay this weekend to rack up 600 Premier League minutes without conceding a goal. Should they beat Spurs and hold them scoreless, Antonio Conte’s men will have recorded seven consecutive league wins without conceding a goal, two shy of the record set by Stockport County, then of League Two, between 13 January and 2 March 2007. It will be intriguing to see how Spurs bounce back from the midweek disappointment of their defeat at the hands of Monaco, in which there were several conspicuous absentees from Mauricio Pochettino’s starting lineup and few of those the manager did select covered themselves in glory. After their midweek meltdown, Tottenham could hope for no stiffer test than a run-out against the Premier League leaders with their apparently impregnable defence and an attack that is behind only Liverpool in terms of goals scored. With Pochettino having questioned the mental fortitude of his players during the week, the manner in which Spurs bounce back from Wednesday’s Champions League reverse ought to give a fair indication of whether their season will end with a half-decent title challenge or merely end up petering out and finishing up in an underwhelming and characteristically Spursy fashion. BG • Pochettino: Tottenham will stay at Wembley for Europa League • Summer signings and lack of savvy: why Spurs failed in Europe • Pochettino says changes needed after Spurs flop in Monaco • Barney Ronay: Conte stamps his dynamic personality on Chelsea 10) Koeman’s return to Southampton It is the season of reunions for Southampton, who after facing Liverpool’s selection of ex-Saints last week prepare for Ronald Koeman’s first return to the club he departed in the summer under something of a cloud, a few weeks after promising supporters that “I know nothing about the Everton job” and that not only does “everybody know I have a year on my contract” but he “could sign a [new] contract next week”. After his move was announced the former Southampton goalkeeper Artur Boruc tweeted something Koeman had said a couple of moths previously, criticising “the lack of loyalty in modern day football” and asserting not only that would not be tempted away from the St Mary’s Stadium for “short-term gains”, but he “would hate to ever become that kind of manager”. As he walks out before the game he may become the latest manager to be reminded that it is not so much the leaving of a club by which they will be judged, but the manner of it. SB • ‘What’s this geezer doing? He’s hopeless’ – the Ali Dia story, 20 years on • Everton Under-23s to sleep rough for homeless charity
In [22]:
print(sorted(score.ravel())[::-1][:10])
[0.1926413029576342, 0.18637279384967628, 0.18464519140512234, 0.1829021315603602, 0.18210910662170277, 0.17802423126548572, 0.1774632399857713, 0.1771421467788238, 0.17574163035083412, 0.17550382215861288]

Application 2: recommender systems

What data do we have?

  • Matrix user-item
  • Elements of the matrix are ratings
  • A lot of missing data

How can we use SVD?

Movielens dataset with ratings of movies

In [24]:
movies = pd.read_csv('../files/movies.gz', index_col='movieid', header=0, encoding='unicode-escape')[['movienm', 'genreid']]
ratings = pd.read_csv('../files/ratings.gz', header=0)

Example of entry

In [25]:
movies.head()
Out[25]:
movienm genreid
movieid
1 Toy Story (1995) Animation, Children's, Comedy
2 Jumanji (1995) Adventure, Children's, Fantasy
3 Grumpier Old Men (1995) Comedy, Romance
4 Waiting to Exhale (1995) Comedy, Drama
5 Father of the Bride Part II (1995) Comedy
In [26]:
ratings.head()
Out[26]:
userid movieid rating
0 1 1193 5
1 1 661 3
2 1 914 3
3 1 3408 4
4 1 2355 5

Set the list of preferences

In [27]:
best_movies = "matrix|die hard"
target_movies = movies.loc[movies.movienm.str.contains(best_movies, flags=2)]
target_movies
Out[27]:
movienm genreid
movieid
165 Die Hard: With a Vengeance (1995) Action, Thriller
1036 Die Hard (1988) Action, Thriller
1370 Die Hard 2 (1990) Action, Thriller
2571 Matrix, The (1999) Action, Sci-Fi, Thriller

Find the indices of the favourite films

In [28]:
favorite_movies_ids = target_movies.index
print(favorite_movies_ids)
Int64Index([165, 1036, 1370, 2571], dtype='int64', name='movieid')

Create matrix with ratings

In [29]:
data_matrix = spsp.csr_matrix((ratings.rating.values.astype('f8'), 
                               (ratings.userid.values, ratings.movieid.values)))
print(data_matrix.shape)
(6041, 3953)

Compute SVD

In [30]:
rank = 30
_, S, Vt = spsplin.svds(data_matrix, k=rank, return_singular_vectors='vh')

Check decreasing of the singular values

In [31]:
plt.plot(S[::-1] / S[-1])
plt.xlabel("Index of singular values", fontsize=18)
plt.yticks(fontsize=18)
plt.xticks(fontsize=18)
plt.grid(True)

Compute correlations

In [32]:
print(Vt[:, favorite_movies_ids].shape)
correlation = Vt.T @ Vt[:, favorite_movies_ids]
print(correlation.shape)
score = correlation.sum(axis=1)
print(score.shape)
# movies.loc[np.argsort(-Vt.T @ Vt[:, favorite_movies_ids].sum(axis=1))[:15]] # assuming binary preference vector
(30, 4)
(3953, 4)
(3953,)

Compute resulting recommendations

In [33]:
top_n = 10
print(np.sort(score)[::-1][:top_n])
movies.loc[np.argsort(-score)[:top_n]]
[0.15287975 0.15033298 0.14251449 0.12089341 0.11414237 0.10847293
 0.10257672 0.09429381 0.09029753 0.0862588 ]
Out[33]:
movienm genreid
movieid
457 Fugitive, The (1993) Action, Thriller
2571 Matrix, The (1999) Action, Sci-Fi, Thriller
589 Terminator 2: Judgment Day (1991) Action, Sci-Fi, Thriller
1610 Hunt for Red October, The (1990) Action, Thriller
1036 Die Hard (1988) Action, Thriller
1240 Terminator, The (1984) Action, Sci-Fi, Thriller
377 Speed (1994) Action, Romance, Thriller
2916 Total Recall (1990) Action, Adventure, Sci-Fi, Thriller
1370 Die Hard 2 (1990) Action, Thriller
2353 Enemy of the State (1998) Action, Thriller

Generalizations

Principal Component Analysis

Intuition

Imagine, that you have a dataset of points. Your goal is to choose orthogonal axes, that describe your data the most informative way. To be precise, we choose first axis in such a way, that maximize the variance (expressiveness) of the projected data. All the following axes have to be orthogonal to the previously chosen ones, while satisfy largest possible variance of the projections.

Let's take a look at the simple 2d data. We have a set of blue points on the plane. We can easily see that the projections on the first axis (red dots) have maximum variance at the final position of the animation. The second (and the last) axis should be orthogonal to the previous one. source

This idea could be used in a variety ways. For example, it might happen, that projection of complex data on the principal plane (only 2 components) bring you enough intuition for clustering. The picture below plots projection of the labeled dataset onto the first to principal components (PC's), we can clearly see, that only two vectors (these PC's) would be enogh to differ Finnish people from Italian in particular dataset (celiac disease (Dubois et al. 2010)) source

Problem

The first component should be defined in order to maximize variance. Suppose, we've already normalized the data, i.e. $\sum\limits_i a_i = 0$, then sample variance will become the sum of all squared projections of data points to our vector ${\mathbf {w}}_{{(1)}}$, which implies the following optimization problem: $$ {\mathbf {w}}_{{(1)}}={\underset {\Vert {\mathbf {w}}\Vert =1}{\operatorname {\arg \,max}}}\,\left\{\sum _{i}\left({\mathbf {a}}_{{(i)}}\cdot {\mathbf {w}}\right)^{2}\right\} $$

or

$$ \mathbf {w} _{(1)}={\underset {\Vert \mathbf {w} \Vert =1}{\operatorname {\arg \,max} }}\,\{\Vert \mathbf {Aw} \Vert ^{2}\}={\underset {\Vert \mathbf {w} \Vert =1}{\operatorname {\arg \,max} }}\,\left\{\mathbf {w} ^{\top}\mathbf {A^{\top}} \mathbf {Aw} \right\} $$

since we are looking for the unit vector, we can reformulate the problem:

$$ {\displaystyle \mathbf {w} _{(1)}={\operatorname {\arg \,max} }\,\left\{{\frac {\mathbf {w} ^{\top}\mathbf {A^{\top}} \mathbf {Aw} }{\mathbf {w} ^{\top}\mathbf {w} }}\right\}} $$

It is known, that for positive semidefinite matrix $A^\top A$ such vector is nothing else, but eigenvector of $A^\top A$, which corresponds to the largest eigenvalue. The following components will give you the same results (eigenvectors).

So, we can conclude, that the following mapping:

$$ \underset{n \times k}{\Pi} = \underset{n \times d}{A} \cdot \underset{d \times k}{W} $$

describes the projection of data onto the $k$ principal components, where $W$ contains first (by the size of eigenvalues) $k$ eigenvectors of $A^\top A$.

Now we'll briefly derive how SVD decomposition could lead us to the PCA.

Firstly, we write down SVD decomposition of our matrix:

$$ A = U \Sigma W^\top $$

and to its transpose:

$$ \begin{align} A^\top &= (U \Sigma W^\top)^\top \\ &= (W^\top)^\top \Sigma^\top U^\top \\ &= W \Sigma^\top U^\top \\ &= W \Sigma U^\top \end{align} $$

Then, consider matrix $A A^\top$:

$$ \begin{align} A^\top A &= (W \Sigma U^\top)(U \Sigma V^\top) \\ &= W \Sigma I \Sigma W^\top \\ &= W \Sigma \Sigma W^\top \\ &= W \Sigma^2 W^\top \end{align} $$

Which corresponds to the eigendecomposition of matrix $A^\top A$, where $W$ stands for the matrix of eigenvectors of $A^\top A$, while $\Sigma^2$ contains eigenvalues of $A^\top A$.

At the end: $$ \begin{align} \Pi &= A \cdot W =\\ &= U \Sigma W^\top W = U \Sigma \end{align} $$

The latter formula provide us with easy way to compute PCA via SVD with any number of principal components: $$ \Pi_r = U_r \Sigma_r $$

Example. 🌼Iris dataset

Consider the classical Iris dataset source

We have the dataset matrix $A \in \mathbb{R}^{150 \times 4}$

In [1]:
import numpy as np
import matplotlib.pyplot as plt

from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler

iris        = load_iris()
A           = iris['data']
labels      = iris['target']
classes     = iris['target_names']
label_names = np.array([classes[label] for label in labels])
colours     = ['red', 'blue', 'green']
print('🤖: Dataset contains {} points in {}-dimensional space'.format(*A.shape))
🤖: Dataset contains 150 points in 4-dimensional space
In [2]:
# Data normalization with zero mean and unit variance
A_std = StandardScaler().fit_transform(A)

u,s,wh = np.linalg.svd(A_std)
In [3]:
total_variance = sum(s)
variance_explained = [(i / total_variance)*100 for i in sorted(s, reverse=True)]
cumulative_variance_explained = np.cumsum(variance_explained)

xs = [0.5 + i for i in range(4)]
plt.bar(xs, variance_explained, alpha=0.5, align='center',
        label='Individual explained variance')
plt.step(xs, cumulative_variance_explained, where='mid',
         label='Cumulative explained variance')
plt.ylabel('Explained variance')
plt.xlabel('Principal components')
plt.legend(loc='best')
plt.xticks([0,1,2,3,4])
plt.grid()
plt.plot()
Out[3]:
[]
In [4]:
rank = 2
w = wh.T
projections = u[:,:rank] @ np.diag(s[:rank])
In [5]:
for label, colour in zip(classes, colours):
    plt.scatter(projections[label_names == label, 0],
                projections[label_names == label, 1],
                label = label,
                c = colour)
plt.xlabel('PC 1')
plt.ylabel('PC 2')
plt.legend(loc='best')
plt.grid()
plt.show()
In [6]:
from sklearn.decomposition import PCA as sklearnPCA
sklearn_pca = sklearnPCA(n_components=2)
projections_sklearn = sklearn_pca.fit_transform(A_std)

for label, colour in zip(classes, colours):
    plt.scatter(projections_sklearn[label_names == label, 0],
                projections_sklearn[label_names == label, 1],
                label = label,
                c = colour)
plt.xlabel('PC 1')
plt.ylabel('PC 2')
plt.legend(loc='best')
plt.grid()
plt.show()

Example. 🍷 Wine dataset

In [9]:
import numpy as np
import matplotlib.pyplot as plt

from sklearn.datasets import load_wine #lol
from sklearn.preprocessing import StandardScaler

wine        = load_wine()
A           = wine['data']
labels      = wine['target']
classes     = wine['target_names']
label_names = np.array([classes[label] for label in labels])
colours     = ['red', 'blue', 'green']
print('🤖: Dataset contains {} points in {}-dimensional space'.format(*A.shape))

# Data normalization with zero mean and unit variance
A_std = StandardScaler().fit_transform(A)

u,s,wh = np.linalg.svd(A_std)

total_variance = sum(s)
variance_explained = [(i / total_variance)*100 for i in sorted(s, reverse=True)]
cumulative_variance_explained = np.cumsum(variance_explained)
🤖: Dataset contains 178 points in 13-dimensional space
In [ ]:
xs = [0.5 + i for i in range(13)]
plt.bar(xs, variance_explained, alpha=0.5, align='center',
        label='Individual explained variance')
plt.step(xs, cumulative_variance_explained, where='mid',
         label='Cumulative explained variance')
plt.ylabel('Explained variance')
plt.xlabel('Principal components')
plt.legend(loc='best')
plt.xticks([0,1,2,3,4])
plt.grid()
plt.plot()
In [10]:
rank = 2
projections = u[:,:rank] @ np.diag(s[:rank])

for label, colour in zip(classes, colours):
    plt.scatter(projections[label_names == label, 0],
                projections[label_names == label, 1],
                label = label,
                c = colour)
plt.xlabel('PC 1')
plt.ylabel('PC 2')
plt.legend(loc='best')
plt.grid()
plt.show()