The social trend in the industry has shifted users’ expectations to highly personalized experiences, presenting them with only personally relevant information. This presentation should arm you with the skills to make your system more intelligent and the arsenal of designs and tools to do it with.
To introduce the basics we will discuss how to implement very familiar recommendations like LinkedIn’s degrees of separation, Facebook’s friend suggestions & smart news feeds, and Amazon’s product recommendations. Also personal experiences from real world rails projects will be shared to better understand issues with performance, scale and limitations to certain tools. At the end of 45 minutes you will walk away with the ability to implement personalized recommendations in your app by understanding:
* How to discover relationships in your data
* Effectively model these relationships to infer personalized recommendations
* Successful patterns for incorporate these recommendations in your rails application
10. theagiledeveloper.com
@mdeiters
CreaBve
RevoluBon
the
Golden
Age
of
Adver;sing
Thursday, June 10, 2010
11. theagiledeveloper.com
@mdeiters
Their
vision
of
consuming
life
had
liIle
to
do
with
actual
experience
of
American
consumers
Thursday, June 10, 2010
12. theagiledeveloper.com
@mdeiters
An
Academic
approach
“Adver;sers
followed
the
wishes
of
conserva;ve
corporate
clients,
who
wanted
the
safe,
“scien;fc”
adver;sing
Thursday, June 10, 2010
14. theagiledeveloper.com
@mdeiters
In
the
late
40’s,
only
.05%
of
Americans
had
a
TV
End
of
50’s,
sBll
only
about
50%
5
years
later
in
1962,
90%
of
Americans
had
a
TV
Thursday, June 10, 2010
15. theagiledeveloper.com
@mdeiters
Audience
SegmentaBon
Adver;sing
was
comfortable
“Male
dominated”
“academic”
approach
Thursday, June 10, 2010
16. theagiledeveloper.com
@mdeiters
SimilariBes
in
Web
Development
Today
Thursday, June 10, 2010
18. theagiledeveloper.com
@mdeiters
We’ve
been
doing
CRUD
for
30
years
boring
for
us
and
the
user
Thursday, June 10, 2010
19. theagiledeveloper.com
@mdeiters
Our
CreaBve
RevoluBon
How
can
we
change
our
approach
Thursday, June 10, 2010
20. theagiledeveloper.com
@mdeiters
RecommendaBons
=
Money
Amazon
is
reportedly
making
~25%
of
25% sales
on
personalized
suggesBons
Net
sales
are
at
$7.13
billion
in
the
first
quarter
Jan-‐Mar
2010
-‐
roughly
2
billion
in
3
months
75%
Thursday, June 10, 2010
21. theagiledeveloper.com
@mdeiters
RecommendaBons
=
Traffic
#1
&
#2
–
StumbleUpon's
rank
among
social
media
traffic
sources
in
the
US.
118%
-‐
the
growth
in
acBve
users
since
2009.
Almost
10
Million
registered
users
400
–
average
number
of
Bmes
a
user
stumbles
per
month.
Thursday, June 10, 2010
22. theagiledeveloper.com
@mdeiters
Discovering
the
relaBonships
in
your
data
Modeling
the
relaBonships
Using
graphs
in
your
Rails
App
Thursday, June 10, 2010
23. theagiledeveloper.com
@mdeiters
President Obama ”The greatest thing about Facebook, is that you can
quote something and totally make up the source.” - George
Washington
Dick Cheney
Precious
John Adams lol...so true
Thursday, June 10, 2010
24. theagiledeveloper.com
@mdeiters
President Obama ”The greatest thing about Facebook, is that you can
quote something and totally make up the source.” - George
Washington
Dick Cheney
Precious
John Adams lol...so true
Thursday, June 10, 2010
25. theagiledeveloper.com
@mdeiters
http://www.hackdiary.com/2010/02/10/algorithmic-recruitment-with-github/
Thursday, June 10, 2010
26. theagiledeveloper.com
@mdeiters
Social
Networking
Content
Website
AnalyBcs
PredicBve
Analysis
Thursday, June 10, 2010
27. theagiledeveloper.com
@mdeiters
Discovering
the
relaBonships
in
your
data
Modeling
the
relaBonships
Using
graphs
in
your
Rails
App
Thursday, June 10, 2010
28. theagiledeveloper.com
@mdeiters
RelaBonal
Databases
!=
works
SQL
is
set
based
Thursday, June 10, 2010
31. theagiledeveloper.com
@mdeiters
Example:
Finding
2
degrees
away
for
a
user
in
SQL
-‐
100
people
executes
in
0.01
sec
-‐
1000
people
executes
in
0.1
sec
-‐
4000
people
executes
in
17.78
sec
-‐
60K
over
an
hour
Thursday, June 10, 2010
32. theagiledeveloper.com
@mdeiters
SQL
Smell
2
degrees more
then
2
degrees
SELECT b FROM ( WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS
WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS ( SELECT a, b, 1 AS distance,
( SELECT a, b, 1 AS distance, a || '.' || b || '.' AS path_string a || '.' || b || '.' AS path_string,
FROM edges2 b AS direct_connection
WHERE a = 1 -- set the starting node FROM edges2
WHERE a = 1 -- set the starting node
UNION ALL
UNION ALL
SELECT tc.a, e.b, tc.distance + 1,
tc.path_string || e.b || '.' AS path_string SELECT tc.a, e.b, tc.distance + 1,
FROM edges2 AS e tc.path_string || e.b || '.' AS path_string,
JOIN transitive_closure AS tc ON e.a = tc.b tc.direct_connection
WHERE tc.path_string NOT LIKE '%' || e.b || '.%' FROM edges2 AS e
AND tc.distance = 0 JOIN transitive_closure AS tc ON e.a = tc.b
) WHERE tc.path_string NOT LIKE '%' || e.b || '.%'
SELECT b FROM transitive_closure AND tc.distance < 3
UNION ALL )
(WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS SELECT * FROM transitive_closure
( SELECT a, b, 1 AS distance, a || '.' || b || '.' AS path_string --WHERE b=3 -- set the target node
FROM edges2 ORDER BY a,b,distance
WHERE a = 4 -- set the target node
UNION ALL
SELECT tc.a, e.b, tc.distance + 1,
tc.path_string || e.b || '.' AS path_string
FROM edges2 AS e
JOIN transitive_closure AS tc ON e.a = tc.b
WHERE tc.path_string NOT LIKE '%' || e.b || '.%'
AND tc.distance = 0
)
SELECT b FROM transitive_closure
)) AS immediate_connections
GROUP BY b
HAVING COUNT(b) > 1;
Courtsey of http://techportal.ibuildings.com/2009/09/07/graphs-in-the-database-sql-meets-social-networks/
Thursday, June 10, 2010
33. theagiledeveloper.com
@mdeiters
How
is
Luke
connected
to
Princess
Leah?
First Last
1 Luke Skywalker
2 Darth Vader
3 Princess Leah
Thursday, June 10, 2010
34. theagiledeveloper.com
@mdeiters
How
is
Luke
connected
to
Princess
Leah?
First Last
1 Luke Skywalker
2 Darth Vader
3 Princess Leah
Thursday, June 10, 2010
35. theagiledeveloper.com
@mdeiters
How
is
Luke
connected
to
Princess
Leah?
First Last
1 Luke Skywalker
2 Darth Vader
3 Princess Leah
Thursday, June 10, 2010
36. theagiledeveloper.com
@mdeiters
Graphs
Rela;onships
are
a
First
Class
Ci;zen
just
like
the
data
First Last
1 Luke Skywalker
Father
2 Darth Vader
Father
3 Princess Leah
Thursday, June 10, 2010
37. theagiledeveloper.com
@mdeiters
Rows
Nodes
First Last
1 Luke Skywalker
Node
Father
Point
2 Darth Vader
Actor
Father
Vertex
3 Princess Leah
Thursday, June 10, 2010
38. theagiledeveloper.com
@mdeiters
Edges
First Last
1 Luke Skywalker
Edge
Father
Rela;onship
2 Darth Vader
Arc
Father
Link
3 Princess Leah
Thursday, June 10, 2010
39. theagiledeveloper.com
@mdeiters
Less
complex,
100%
natural
Luke
Darth
Princess
Thursday, June 10, 2010
40. theagiledeveloper.com
@mdeiters
Discovering
the
relaBonships
in
your
data
Modeling
the
relaBonships
Using
graphs
in
your
Rails
App
Thursday, June 10, 2010
41. theagiledeveloper.com
@mdeiters
In
Memory
Ruby
Graph
Great
for
small
staBc
datasets
or
ad
hoc
querying
Thursday, June 10, 2010
42. theagiledeveloper.com
@mdeiters
RGL
Rails App
RGL
or
BackroundRB
Rails App
RGL
Thursday, June 10, 2010
48. theagiledeveloper.com
@mdeiters
class Person
include Neo4j::NodeMixin
property :name
has_n :friends
end
Neo4j.start
Neo4j::Transaction.run do
andreas = Person.new :name => 'andreas'
john = Person.new :name => 'John', :age => 30
andreas.friends << john
end
Thursday, June 10, 2010
49. theagiledeveloper.com
@mdeiters
Neo4jr-‐social
More
REST,
Less
Java
Rails App RDBMS
Neo4jr-social
Neo4j
Solr
Lucene
Memcache
Thursday, June 10, 2010
50. theagiledeveloper.com
@mdeiters
Neo4jr-‐social
The
SOLR
of
Graphs
(uses
Neo4jr-‐simple)
#> sudo gem install neo4jr-social
#> start-neo4jr-social
Thursday, June 10, 2010
51. theagiledeveloper.com
@mdeiters
No
JRuby
Required
Packaged
as
self-‐contained
jeIy
webserver
Deployable
WAR
Focused
on
SNA
Basic
Built
in
Querying
Extensible
~/.neo4jr-‐social
Thursday, June 10, 2010
59. Dijkstra
(Who
do
we
follow
on
Twiber
in
common
-‐
on
steroids)
score: 20 score: 5
score: 5
score: 5
score: 5
score: 5
score: 10
score: 10
Thursday, June 10, 2010
60. Closeness
Centrality
(Who
has
the
most
followers
on
Twiber)
Thursday, June 10, 2010
61. Betweenness
Centrality
(Who
has
more
influen;al
people
following
them
on
Twiber)
http://www.stoweboyd.com/message/its-betweenness-that-matters-not-your-eigenvalue-the-dark-ma.html
Thursday, June 10, 2010
62. theagiledeveloper.com
@mdeiters
http://www.hackdiary.com/2010/02/10/algorithmic-recruitment-with-github/
Thursday, June 10, 2010