madlib and mlbase

MADlib and MLbase Quan Fang Xiaofeng Tao MADlib - PowerPoint PPT Presentation

MADlib and MLbase Quan Fang Xiaofeng Tao MADlib Analy7cs Library What is a mad lib? - From bigdatablog.emc.com What is a mad lib?


  1. MADlib ¡and ¡MLbase ¡ ¡ Quan ¡Fang ¡ Xiaofeng ¡Tao ¡

  2. MADlib ¡Analy7cs ¡Library ¡ ¡

  3. What ¡is ¡a ¡mad ¡lib? ¡ -­‑ ¡From ¡bigdatablog.emc.com ¡

  4. What ¡is ¡a ¡mad ¡lib? ¡ -­‑ ¡From ¡bigdatablog.emc.com ¡

  5. MAD ¡Methodology ¡ • Cohen, ¡Jeffrey, ¡et ¡al. ¡"MAD ¡skills: ¡new ¡analysis ¡ prac7ces ¡for ¡big ¡data." Proceedings ¡of ¡the ¡ VLDB ¡Endowment ¡2.2 ¡(2009): ¡1481-­‑1492. ¡ • What ¡does ¡MAD ¡stand ¡for? ¡ ¡

  6. Magne7c ¡ • Use ¡all ¡data ¡sources ¡regardless ¡of ¡ format ¡or ¡quality ¡

  7. Magne7c ¡Agile ¡ • Use ¡all ¡data ¡sources ¡regardless ¡of ¡ format ¡or ¡quality ¡ • Support ¡dynamic ¡workflow ¡and ¡ whatever ¡data ¡analysts ¡need ¡

  8. Magne7c ¡Agile ¡Deep ¡ • Use ¡all ¡data ¡sources ¡regardless ¡of ¡ format ¡or ¡quality ¡ • Support ¡dynamic ¡workflow ¡and ¡ whatever ¡data ¡analysts ¡need ¡ • Analyze ¡large ¡datasets ¡without ¡ sampling ¡

  9. Magne7c ¡Agile ¡Deep ¡ • Goal: ¡Give ¡analysts ¡access ¡to ¡familiar ¡math ¡ concepts, ¡sta7s7cal ¡methods, ¡and ¡algorithms ¡ for ¡database ¡ • Use ¡tradi7onal ¡SQL ¡and ¡a ¡wide ¡range ¡of ¡ extension ¡languages ¡

  10. Data ¡Parallel ¡Sta7s7cs ¡ • Give ¡analysts ¡access ¡to ¡familiar ¡math ¡concepts ¡ and ¡sta7s7cal ¡methods ¡for ¡database ¡ • Database ¡methods ¡are ¡data ¡parallel ¡and ¡have ¡an ¡ SQL ¡like ¡interface ¡ • Database ¡methods ¡fall ¡into ¡one ¡of ¡the ¡following ¡ layers ¡of ¡abstrac7on: ¡ – Scalar ¡ – Vector ¡ – Matrix ¡ – Func7on ¡

  11. MAD ¡DBMS ¡ • Loading ¡and ¡Unloading ¡ – Sca]er ¡/ ¡Gather ¡streaming ¡for ¡fully ¡parallel ¡access ¡ – External ¡tables ¡ ¡ • Extract-­‑Transform-­‑Load ¡(ETL) ¡and ¡Extract-­‑ Load-­‑Transform ¡(ELT) ¡

  12. MAD ¡DBMS ¡ • Mul7ple ¡storage ¡formats ¡ – External ¡tables ¡ – Heap ¡format ¡ – Append-­‑mostly ¡format ¡ • Different ¡storage ¡formats ¡per ¡table ¡par77on ¡ • Atomic ¡par77on ¡exchange ¡

  13. MAD ¡Programming ¡ • Tradi7onal ¡SQL ¡queries ¡with ¡extensions ¡ • Map/Reduce ¡func7ons ¡wri]en ¡in ¡Python, ¡Perl, ¡ or ¡R ¡ • Wide ¡range ¡of ¡extension ¡languages ¡ ¡

  14. MAD ¡Implementa7ons ¡ • MADlib ¡ – Library ¡for ¡data ¡analy7cs ¡that ¡can ¡run ¡on ¡ Greenplum ¡or ¡PostgreSQL ¡ • Greenplum ¡database ¡ ¡ – Massively ¡parallel ¡processing ¡database ¡

  15. MADlib ¡ • Library ¡for ¡widely ¡used ¡sta7s7cs, ¡data ¡mining, ¡ and ¡machine ¡learning ¡that ¡runs ¡on ¡top ¡of ¡a ¡ SQL ¡database ¡ – Regression ¡models ¡ – Machine ¡learning ¡ – Linear ¡systems ¡ – Topic ¡modelling ¡ – Descrip7ve ¡sta7s7cs ¡ – And ¡more…. ¡(see ¡doc.madlib.net) ¡ ¡

  16. MADlib ¡History ¡ • S7ll ¡in ¡early ¡stages ¡of ¡development ¡ • In ¡use ¡by ¡some ¡research ¡universi7es ¡and ¡ companies ¡ • Heavily ¡sponsored ¡by ¡Greenplum ¡

  17. MADlib ¡Interface ¡ • Interface ¡consists ¡of ¡extensible ¡SQL ¡like ¡scripts ¡ that ¡call ¡MADlib ¡func7ons ¡ • Wide ¡range ¡of ¡extension ¡languages ¡possible ¡ but ¡C++ ¡/ ¡Python ¡recommended ¡ • Designed ¡for ¡portability ¡

  18. MADlib ¡User ¡Extensions ¡ • User ¡defined ¡aggregates ¡and ¡func7ons ¡in ¡C++ ¡ • Driver ¡func7ons ¡use ¡Python ¡to ¡wrap ¡mul7ple ¡ MADlib ¡SQL ¡calls ¡ • Templated ¡queries ¡are ¡supported ¡with ¡Python ¡ wrappers ¡ ¡ ¡

  19. MADlib: ¡Logis7c ¡regression ¡

  20. MADlib ¡Example: ¡K-­‑means ¡ • Run ¡K-­‑means ¡ ¡ SELECT * FROM madlib.kmeanspp( 'km_sample', 'points', 2, 'madlib.squared_dist_norm2', 'madlib.avg', 20, 0.001 );

  21. MADlib ¡Example: ¡K-­‑means ¡ • Calculate ¡silhoue]e ¡coefficient ¡ SELECT * FROM madlib.simple_silhouette( 'km_s ample', 'points', (SELECT centroids FROM 'km_centroids'), 'madlib.squared_dist_norm2' );

  22. Live ¡demo ¡ • Postgres ¡command ¡line ¡ • Principal ¡Component ¡Analysis ¡ – pca_train() ¡ – pca_project() ¡

  23. Conclusion ¡ • Due ¡to ¡the ¡economics ¡of ¡data ¡(cheap, ¡high ¡ volume), ¡data ¡warehouses ¡in ¡the ¡future ¡need ¡ to ¡focus ¡on ¡data ¡analy7cs ¡ – Magne7cally ¡a]ract ¡all ¡data ¡sources ¡ – Agile ¡analysis ¡workflow ¡ – Deeply ¡analyze ¡large ¡datasets ¡without ¡sampling ¡ • MADlib ¡provides ¡analysts ¡with ¡such ¡a ¡toolbox ¡ that ¡is ¡portable ¡across ¡SQL ¡databases ¡

  24. MLbase: ¡A ¡Distributed ¡Machine-­‑ Learning ¡System ¡ ¡

  25. Four ¡foci ¡ ¡ • (1) ¡A ¡new ¡declara7ve ¡language ¡to ¡specify ¡ML ¡ tasks ¡ • (2) ¡A ¡novel ¡op7mizer ¡to ¡select ¡ML ¡algorithms ¡ • (3) ¡Provide ¡answers ¡early ¡and ¡con7nuously ¡ refine. ¡ • (4) ¡Design ¡a ¡distributed ¡run-­‑7me ¡op7mized ¡for ¡ the ¡data ¡access ¡pa]erns ¡of ¡ML ¡

  26. A ¡Declara7ve ¡Approach ¡to ¡ML ¡ SQL ¡ Result ¡ MQL ¡ Model ¡

  27. MLbase ¡Architecture ¡ Declarative result ML Task (e.g., fn-model & summary) Algorithms, ¡ User Data, ¡Sta7s7cs ¡ 2 ¡ Master Server Parser Meta-Data ML Contract + Adap%ve ¡ Code LLP Binders of Master Op%mizer ¡ Algorithms 3 ¡ COML ¡ (Optimizer) Statistics PLP Executor/Monitoring ML Developer Runtime Runtime Runtime Runtime …. MLI ¡ 1 ¡ Interface ¡between ¡ MLBase ¡and ¡ Distributed ¡Infra ¡

  28. MLI: ¡Machine ¡Learning ¡Interface ¡ 1 ¡ Declarative result ML Task (e.g., fn-model & summary) User Master Server Parser Meta-Data ML Contract + Code LLP Binders of Master Algorithms COML (Optimizer) Statistics PLP Executor/Monitoring ML Developer Runtime Runtime Runtime Runtime …. MLI ¡ 1 ¡ Interface ¡between ¡ MLBase ¡and ¡ Distributed ¡Infra ¡

  29. MLI: ¡Machine ¡Learning ¡Interface ¡ 1 ¡ • Shield ¡ML ¡Developers ¡from ¡low-­‑level-­‑details. ¡ • Independence ¡between ¡ML ¡algorithm ¡and ¡ run-­‑7me ¡ • Current ¡supported ¡run-­‑7mes: ¡ TupleWare ¡

  30. Algorithms ¡Pool ¡ 2 ¡ Declarative result ML Task (e.g., fn-model & summary) Algorithms, ¡ User Data, ¡Sta7s7cs ¡ 2 ¡ Master Server Parser Meta-Data ML Contract + Code LLP Binders of Master Algorithms COML (Optimizer) Statistics PLP Executor/Monitoring ML Developer Runtime Runtime Runtime Runtime ….

  31. Algorithms ¡Pool ¡ 2 ¡ Extensibility ¡ ML Developer + ¡ Implementa%on ¡ MLBase ¡defined ¡Contracts ¡ Algorithms ¡pool ¡ Type ¡(e.g., ¡classifica7on) ¡ • Parameters ¡ • Run7me ¡(e.g., ¡O(n)) ¡ • Input-­‑Specifica7on ¡ • Output-­‑Specifica7on ¡ • … ¡ •

  32. MLbase ¡Architecture ¡ Declarative result ML Task (e.g., fn-model & summary) User Master Server Parser Meta-Data ML Contract + Op%mizer ¡ Code LLP Binders of Master LLP ¡& ¡PLP ¡ Algorithms 3 ¡ COML (Optimizer) Statistics PLP Executor/Monitoring ML Developer Runtime Runtime Runtime Runtime ….

  33. Query ¡Op7miza7on(Logical ¡Learning ¡Plan) ¡ 3 ¡

  34. 3 ¡ Run ¡Time ¡(Physical ¡Learning ¡Plan) ¡ • (1) ¡The ¡master ¡distributes ¡ML ¡tasks ¡to ¡workers ¡ • (2) ¡Monitor ¡progress ¡ • (3) ¡Handle ¡failures ¡

  35. Conclusion ¡ ¡ • MLbase’s ¡core ¡is ¡its ¡op7mizer ¡ • Transforms ¡a ¡declara7ve ¡ML ¡task ¡to ¡a ¡ sophis7cated ¡learning ¡plan ¡ • Quickly ¡returns ¡a ¡first ¡quality ¡answer, ¡ improves ¡in ¡the ¡background ¡ • To ¡be ¡fully ¡distributed ¡and ¡offers ¡a ¡run-­‑7me ¡ able ¡to ¡exploit ¡ML ¡algorithms ¡ ¡

  36. ML Developer

Recommend


More recommend