# Who is who on French presidential election, 2017, based on Facebook

This research presents calculation of distance between supporters of candidates on French presidential election, 2017, based on their behavior in social networks.

Steps of analysis:

- French presidential election, 2017
- Distance matrix
- Projection of distance matrix into 2-d plane

**French presidential election, 2017:**

The first round of the 2017 French presidential election will be held on 23 April 2017. Should no candidate win a majority, a run-off election between the top two candidates will be held on 7 May 2017 (link to wiki).

Top 3 candidates according to exit-polls: Marine Le Pen (27%), Emmanuel Macron (24%), François Fillon (19%). Exit polls expect 2nd round with Le Pen and Macron or less probable Le Pen and Fillon.

The distance between candidates correlates with the percentage of users which will migrate from one candidate to another during the 2nd tour. At the same time, some supporters will migrate from outsiders to top candidates with approaching of the election date.

So, provided approach can be used for prediction of the 2nd tour results. Also, it can help with understanding how supporters can more probable migrate from one candidate to another.

**Distance matrix:**

It was calculated using next steps:

- Generated features based on social data (followers of each candidates)
- Calculated variance of each normalized feature
- Order of feature by variation from biggest to lowest
- Select top 5–7 features
- Use list of these features as a vector
- Find correlation between vectors
- Distance=5–5*correlation

Two candidates with correlation=1, the same as distance=0, look the same for supporters. Both of them will have 50% probability of support in case of choice from 2 candidates.

Of course, some high-level conclusions can be done from this matrix. E.g., distances between Le Pen and other top candidates (Fillon, Macron, Hamone, Melenchone) are high. It means that in the case of second round election main part of other candidates supporters will vote for the opponent of Le Pen more than for her. Also, we can see that distance between Macron and not top3 candidates is lower than the difference between Fillon and other not top3 candidates. In general, it correlates with results of exit polls which show us that as a result of 2nd round difference between Macron and Le Pen (61%-39%=22%) will be higher than the difference between Fillon and Le Pen (56%-44%=8%).

**Projection of distance matrix onto 2-d plane:**

Projection of distance matrix on 2-d plane is good example of visualization and more convenient for understanding of relation.

On this graph, you can see the projection of matrix distance onto a 2-d plane.

Distance=5–5*correlation as was mentioned above. Namely, it can be from 0 in the case of perfect correlation between vectors to 10 in the case of opposite direction.

- Black lines — distance more than 6.
- Blue lines — distance from 4 to 6.
- Brown line — distance from 2 to 4.
- Red dash lines — less than 2.

Candidate (** ratio1**, ratio2):

**— Smart Forecast prediction from the previous post, ratio2 — last result of exit polls.**

*ratio1*For not top5 candidates, we depicted only distance with nearest candidates from top5 candidates. For all not top5 candidates it is Emmanuel Macron.

Projection calculation:

Xi,Xj,Yi,Yj –coordinates of top 5 candidates on 2-d plane.

d(I,j) — actual distance from the real distance matrix — see above.