The Master Algorithm (Book Review) a.k.a Data the Final Frontier


P.S: Copy of my blog in Linkedin

Book Review of “The Master Algorithm”  MasterAlg-01

Prof.Pedro Domingos has done a masterful job of unboxing Machine Learning – and unboxing is the right word!

A very insightful book that would bring tears (of joy, not misery) to the eyes of Data Scientists and Data Engineers; not to mention the C-Suite execs who would acquire deep wisdom of the data kind (am not sure if they would shed tears, they would if they could….)

And for those who haven’t read the book yet you should run – not walk, to the nearest store (or to the nearest Amazon web site with a speedy DNS) and buy one (or more!)

While you are waiting for the book to arrive (by second day shipping – you’all have prime shipping don’t you ?) you could prime yourself for the intellectual feast by reading the two resources :

Prologue:

The book can be consumed at least at two levels – first an insight into the domain of algorithms, data and machine learning; but a more exciting level is as an inspiration and a guide post into techniques and mechanisms that augment current models one is working on – a natural extension to Prof.Domingos’ call for action …

I’d like to give you a parting gift …  the great undiscovered ocean stretches into the distance, the gift is a boat-Machine Learning- and it’s time to set sail

My trek through the book – the latter, and what an incredible journey it was ! As Prof.Domingos says

Before we can learn deep truths withmachine learning, we have to discover deep truths about machine learning …

and the book does the latter – in spades!

The society is changing, one learning algorithm at a time” – The prologue runs like a Bond movie (A Tron-esq Master Algorithm/MCP as the next head of Spectre, anyone ?) expanding this idea into various modern day successes, for example “The candidate with the best voter model wins” (Ref my blog All The President’s Data Scientists)

Main Ideas:

The main thesis of the book is around the Five Tribes of Machine learning and the Master Algorithm that unifies all (& more..) The central hypothesis of the book is like so :

 All knowledge – present, past & future – can be derived from data, by a single, universal learning algorithm – the Master Algorithm

Master_Algorithm_1

 

The language is poetic and picturesque, weaving through a lot of deep concepts, conveying the art of possible and the probable, tickling the imagination of the uninitiated as well as the practitioner.

The analogies are very real and reflect the fundamental principles of Machine Learning and Big data viz

  • Learning Algorithms are the seeds, Data the soil & Learned programs the grown plants
  • Machine Learning cartons in super market labelled ‘Just Add Data’
  • Every field needs data commensurate with the complexity of the phenomenon it studies
  • Perceptrons – mathematically impeachable, searing in it’s clarity and disastrous in it’s effects
  • ramblings of a drunkard, locally coherent even if globally meaningless
  • MCMC as drown our sorrows in alcohol, get punch drunk & stumble around all night
  • SVM as a fat snake slithering thru mine field or comparing dimensionality reduction and arranging books on a shelf  !

The book is full of nuggets of wisdom and insights, let me iterate a couple:

  • S-curve as the basis of evolving systems “the most important curve in the world”, quoting Hemingway’s The Sun Also Rises about how he went bankrupt “Two ways – Gradually & then Suddenly!” the S curve of course. Also the S-curve, not Singularity that will explain the evolution of AI
  • The progression from Hopfield’s deterministic spin glass, to work on probabilistic neurons by Hinton, et al.
  • Nature (the program) evolves for the nurture (the data) it gets, and the Baldwin evolution ie “behaviors that are first learned become genetically hardwired” – a strong case for the important step of model evolution after deployment (I had talked about it at The Best of the Worst in Big Data – see slide #7, video of pyata talk)
  • Power laws, where things get better with time, “except, of course, Windows, that gets slower with every version !
  • The jobs machines are good at “Credit applications and car assembly rather than stumbling around a construction site”. The key is, machines can’t be like us and vice versa; humans are good at tasks that require complex context & common sense and we don’t compete with the machines viz. “you don’t outrun a horse, you ride it!” – well said, Prof.Domingos. I also have similar thoughts about AI.

Epilogue:

Absolutely worth reading, in the genre of Stephen Bakers “Final Jeopardy” (my book review) & Stephen Levy’s “In The Plex” (my book review) to name a few. It is instructive to see how much the domain of Machine Learning has evolved in the span of ~4 years !

Trivia:

Works that blend multiple genres are hard to create but provide endless enjoyment. I enjoyed 3 in the last couple of weeks – Prof. Domingos’ The Master Algorithm, the movie Bahubali and the songs (a juxtaposition of Sanskrit/ vernacular) and of course, Spectre (the movie & the motion picture soundtrack)

And am planning on next set of book reviews – a somewhat orthogonal domain- FinTech – Actually am pursuing the MS-CFRM at UWA !

Illuminae (and S – I have both !) belong to a new meta genre – books that give you a multi-dimensional on-line experience; the inverse (or transpose – am watching MIT 18.06) of e-books, that is, you read them like an e-book, but in the physical form !

Fintech-01.png

An excursion into ranking the NBA with Elo


P.S: Copy of my blog in Linkedin

Ranking and odd making are one of the oldest professions, probably dating to around AD 69 – the romans applying inferences on predicting gladiatorial shows! Fast forward, the recent NBA finals have become more interesting (from a Data Science perspective, of course) after the Cavalier’s Win !

Update (for those who were here before) : The Game 4 win by GSW (See the Update section at the end) shows how Elo adjusts for larger Margin Of Victory without oscillation!

One interesting algorithm is the Elo ranking, which has seen application in chess, computer games, NFL, NBA and Facebook ! In the movie Social Network, Eduardo Saverin writes the Elo on the glass, responding to Mark Zuckerberg’s call for the algorithm – the picture says it all !

An Introduction to Elo:

Leaving Eduardo and Mark Zuckerberg aside for a moment and moving on to the world of LeBron James and Steph Curry, Elo ranks teams or individuals in chess, basketball, computer games et al. The rank goes up or down as one wins or loses.

If a team is expected to win and it wins, the Elo rank goes up by a small amount; the gains are higher when a lower ranking opponent wins against a stronger team, with adjustments made for the margin of victory.

After every season, the rank reverts to a norm of 1505 (for Basketball) – but basketball teams being stable Year-to-Year, the folks at 538 has a distribution of 75% carry over and 25% revert to norm – we won’t deal with this now, but I did check this in my R program

Back to the main feature … NBA

The current NBA is a dream series for Elo – the thrills and chills of Elo can be observed! viz. a good matchup, but definitely a seemingly strong team, winning 1st game as expected; and boom, games 2 & 3 won by the (not so) weaker team !

You can see (below) the Elo stats at it’s best viz. capturing the transition, giving credit (and higher ranking) where it is due

I had done Elo for NFL, but wasn’t going to try NBA after game 1, but now lit ooks like a good exercise in data algorithmics …

Fortunately Nate Silver & his team has curated the basketball data from 1946 and explained their methodology. Thanks Guys.

I downloaded the data and did some R programming.

An ugly graph plotting Elo rating for the 2015 season for GSW (black) & CLE (blue).

We can definitely see that GSW is the stronger team, but CLE (Cavaliers) is getting stronger recently – especially as it wins over stronger teams.

Let us trace the stats summary ie the Elo rating of the teams, the point spread predictions, the actual score and the response from the algorithm ….

Stuff that brings tears to the eyes of a Data Scientist !

  • Going to Game 1, Elo said – GSW : 1802; CLE : 1712 ; Point Spread : GSW by 6.78 points. Actual – GSW by 8 points
  • Nothing fancy; the Elo ranking of GSW goes up by a little, CLE goes down a little
  • Going to Game 2, Elo said – GSW : 1806; CLE : 1708 ;Point Spread : GSW by 7.07 points. Actual – CLE by 2 points
  • Now, Elo kicks in ! CLE gains higher Elo (because they won over a stronger team), GSW loses more
  • Going to Game 3, Elo said – GSW : 1798; CLE : 1716 ;Point Spread : GSW by 2.92 points. Actual – CLE by 5 points
  • GSW’s Elo goes down; CLE’s future brightens; GSW still has a slim lead
  • Going to Game 4, Elo says – GSW : 1791; CLE : 1723 ;Point Spread : GSW by 2.3 points ! <- We are here (June 10,2015)

I will update with more Elo stats after Games 4,5,6 & 7 … (am sure it has the possibility to go to 7!)

6/11/15 : See Updates below

Incidentally Nate Silver’s tweets have an unintended consequence ! They are motivating Steph ! I am hoping this is the beginning of GSW’s path to a title …

Updates:

  • [Update 6/11/15 10:31 PM ] Actual : GSW by 21 Points !
  • Nate’s Tweets worked !
  • It is instructive to see the Elo graph. Even though the point spread (21 points) is much larger (than 2 & 5 points from earlier games) the Elo doesn’t go up by a huge amount. This is good, because we don’t want Elo to oscillate, but still should account for the larger than normal point spread. The Margin Of Victory multiplier adjusts that. Interesting to see the graph below, as Nate says it, in one game GSW regained their old position.
  • Going to Game 5, Elo says – GSW : 1810; CLE : 1704 ;Point Spread : GSW by 7.35 points (with home court advantage-refer to the formula (above) for details) ! <- Now, we are here (June 11,2015)
  • [Update 6/14/15] Game 5, GSW by 13 !
  • Going to Game 6, Elo says – GSW : 1814; CLE : 1701 ;Point Spread : GSW by 4.04 points (without home court advantage-refer to the formula (above) for details) ! <- Now, we are here (June 14,2015)

Reference:

  1. http://blogs.mercurynews.com/kawakami/2015/06/09/steph-curry-awakens-in-game-3-its-too-late-its-not-enough-but-its-exactly-what-the-warriors-need-the-rest-of-the-nba-finals/
  2. https://doubleclix.wordpress.com/2015/01/20/the-art-of-nfl-ranking-the-elo-algorithm-and-fivethirtyeight/

Of Byzantine Failures,unintended consequences & Architecture Heuristics


P.S: Copy of my blog in Linkedin

Way …. back in 2007, I gave a talk on Architecture Heuristics – we talked about Byzantine failures, systems with strong bones and the politics of systems architectures.

One would think that all this is way behind us ! Apparently not so ! There is a software bug in 787 GCU ! The root cause – yep you guessed it, integer overflow !

The plane’s electrical generators fall into a failsafe mode if kept continuously powered on for 248 days. The 787 has four such main generator-control units that, if powered on at the same time, could fail simultaneously and cause a complete electrical shutdown

And self-parking car hits pedestrians because …

Keeping the car safe is included as a standard feature, but keeping pedestrians safe isn’t. …

Interesting … whatever happened to the prime directive ? And Pedestrian Recognition – an option in self parking cars ? What next ? Steering wheel as an option ?

And, we keep on building machines that are software intensive ! Ford GT has more code than a 787 !

Back to Architecture Heuristics …

  1. Select technologies that you can dance with & Be flexible in scaling as you grow
  2. Embrace Failure & Influence Scalability
  3. Build systems with good bones (my slides from 2007 sill look relevant!)
  4. Solve the right problems
  5. While we build complex AI systems, remember that our ingenuity is hard to beat – even by the smart machines that we build !
  6. And, those who don’t learn from the history should read these recommendations, they are still valid !
  7. … Of course, pay that extra $3,000 and buy the Pedestrian Detection – you might drive the car in this world (where we humans reside – at least for now) not in Mars !

Take Care of the Ball, Value every Possession & Protect the Rim


P.S: Copy of my blog in Linkedin

CurryWas watching the NBA Western Conference Finals; the Warriors Team, Coach Kerr & Stephen Curry all are inspiration not only for Sports but also for the startup world.

I picked up a few insightful quotations from the post-game conference … will let you fill-in the inferences & lessons to keep this blog short …

Agility & Nimbleness : What I like most about the Warriors, is the way they morph & raise to the occasion. They find ways to reorganize & adapt against different teams … time will tell how they will do against LeBron and the Cleveland Gang … but for now, they are very effective …

[Update 5/24/15] Interestingly, today Tim Kawakami expressed the same sentiment in his blog at San Jose Mercury News !

“Take Care of the ball, value every possession & protect the rim” – Steve Kerr. Lot of truth in this statement … for life and business …

Steve Kerr about Harden “He sees every angle and we try to close as many of them as we can …”. That is all what we need to do in business to get ahead. The talented will make the shots, under any circumstances, like Kobe says … (er, tweets)

So be comfortable in taking those difficult shots !

Lesson for the Rockets : “Don’t play around the edges, play in the paint” echoed by Kevin McHale “Win the paint & win the board” … So true in sports and in startup business …

Curry Flurry : “Stephen Curry is very patient & will let the offense come to him ! Then he starts !” – In game 3 he had 40 points but only one in 1st quarter ! Once he got the offense, he flawlessly executed his characteristic “confidence & smoothness of the shots” …

In short, “Steph”, Kerr said “was Steph” !

BTW, don’t count the Houston Rockets out yet ! Against all odds, they won against LA Cilppers; Harden & Kevin McHale have a way with adversities …

And on another note, I need to update my NFL/ELO blog to applying ELO in BasketBall …

Reference for material & pictures:

  1. http://www.nytimes.com/2015/05/24/sports/basketball/stephen-curry-with-a-little-help-tramples-the-rockets.html
  2. http://scores.espn.go.com/nba/recap?gameId=400796357
  3. http://scores.espn.go.com/blog/statsinfo/post/_/id/105884/harden-swoons-curry-soars-in-game-3
  4. http://uproxx.com/dimemag/2015/05/kobe-bryant-stephen-curry-defense-twitter/
  5. http://diys.didiroesmana.com/trends/golden-state-warriors
  6. http://blogs.mercurynews.com/kawakami/2015/05/23/when-the-warriors-figure-out-an-opponent-this-happens-a-game-3-houston-obliteration-by-the-playoff-monster/

Data Science is the new Electronics


P.S: This is a copy of my blog in Linkedin.

Electronics

A good friend of mine asked me “What exactly is this Data Science”?

That got me thinking – we have tons of blogs on “Who or What is a Data Scientist” including mine.

One can explain the intuition behind Data Science, the pragmas of the profession, but not the essence !

Then I remembered an engineer on a flight to Tokyo, who was at 61G, I was 61H. It was years ago, probably a lot more years than many (or most) of the readers would remember. I asked him what he was doing and his answer was “Helping companies to embed electronics in their products!”. I remember when autos had no electrical circuits except for the lights. Then came ignition electronics, engine electronics and now powerful computers that control almost all functions; except, of course, to roll where we still need old-fashioned wheels & tires !

We are at that stage with Data Science, where the three Amigos of Data Science(Intelligence, Inference and Interface) can be embedded in enterprise systems increasing their capabilities that far exceed the current ones !

We can really build adaptive systems .. not descriptive, not reactive but truly adaptive, that have malleable intelligence instead of the brittle newtonian rules !

As Sonny Elliot would say – Exactically!

Exactically similar to Electronics some years ago ! Now is the time to think Data Science as embeddable modules with Intelligence/Inference at the systems level and interesting Interfaces for the users …

And that, probably, is the mission of Data Scientists …

If they choose to accept … This blog could self-destruct in 5 seconds …5…4…3…2

Data Science with Spark on the Databricks Cloud – Training at SparkSummit (East)


DataSci-03-P24We had a good Data Science training session in Sheraton, Times Square, NY; second day of SparkSummit (East). It was my privilege to co-author and lead the Data Science track, along with Reza, Paco, Andy, Hossein, TD,Joseph and Xiangrui. I have shared the slideset at Slideshare as well as at the Databricks site.

[Update 4/12/15] : The video is posted at Youtube (5hrs!)

This was the second time I was involved with a training fully based off of the Databricks cloud and it worked out very well ! The Databricks cloud was very robust and resilient. Unfortunately we had problems with the wireless at the Sheraton Hotel !DataSci-03-P27
The training was a mixture of hands-on and lecture.We sterted out with a dataset of 30 records and then moved onto the titanic dataset (900) to the movielens medium (1,000,000) and finally with the RecSyschallenge dataset (33,000,000!). What a progression in a day !

You can see the details in the slides. Ping me if you have any questions.

DataSci-03-P28Data wrangling over the RecSysChallenge 2015 data captures the essence of the Databricks cloud. I will quickly cover the RecSys Challenge dataset as an illustration.

The training data consists of 33,003,944 clicks and 1,150,753 buys. Our mission, if we choose to accept is to predict the session-items bought from a test dataset of 8,251,791 clicks.

A quick data exploration workflowdbc-01:

dbc-02

dbc-03

All at scale, in an elastic cloud, seamlessly moving between dev, model, stage and prod ! The magic of Databricks Cloud !

BTW, we also explored the State Of the Union Speeches from Washington, Lincoln, FDR, Clinton, Bush & Obama. The graphs below show a succinct view of the mood of the nation at each periods …

dbc-04

And finally after 100 slides later …!

DataSci-03-P100