Posts

Showing posts with the label machine learning

Euclidean Distance (similarity)

Bir kümedeki elementlerin benzerliğini ölçen, benzerlik puanı üreten avantajı ve dezavantajı duruma göre değişen algoritmalar bulunmaktadır. Collaborative Intelligence kitabında Euclidean Distance hesaplaması ile film eleştirmenleri arasındaki benzerlik hesaplanmıştır. Senaryoda, kişiler çeşitli filmlere puan vermişlerdir ve bu puanlar üzerinden bir kişinin diğer insanlarla arasındaki benzerlik hesaplanmıştır.Birkaç ekleme dışında kodların tamamını kitaptaki gibi aktarıyorum. from math import sqrt def sim_euclidan_distance(prefs, person1, person2): si={} for item in prefs[person1]: if item in prefs[person2]: si[item]=1 if len(si)==0: return 0 sum_of_squares=sum([ pow( prefs[person1][item]-prefs[person2][item], 2) for item in prefs[person1] if item in prefs[person2] ]) return 1/(1+sqrt(sum_of_squares)) critics={ 'Mustafa': { "The Matrix": 5, "The Godfather": 5, "Se7en": 3, "Babel": 2, "Troy": 4, ...

Predicting game results from fans’ emotions

Image
Facebook’s data science team published a post in which they claim it is possible to predict a football team’s performance mining emotions of its fans. The post tells us before a kick-off, fans seem positive. But the volume of positive emotion is higher in the fans who support the better team. After the match, the winner’s fans feel very high positive emotion, on the other hand other team’s fans feel negative. Actually we do not need any study to predict this correlation between teams and their fans. It is obvious when a team wins, its fans get happy and so they post positive status messages. Yet I think this study is not trivial. Every study does not necessarily bring about a breakthrough.