Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Trend Analysis & Machine Learning in PHP

C845a8857cadb4f26a7b4ab7604e413b?s=47 Michael C.
November 16, 2017

Trend Analysis & Machine Learning in PHP

C845a8857cadb4f26a7b4ab7604e413b?s=128

Michael C.

November 16, 2017
Tweet

Transcript

  1. TREND ANALYSIS AND MACHINE LEARNING IN PHP SYMFONYCON CLUJ 2017

    @MICHAELCULLUMUK
  2. TREND ANALYSIS AND MACHINE LEARNING IN PHP SYMFONYCON CLUJ 2017

    @MICHAELCULLUMUK
  3. @MICHAELCULLUMUK ME?

  4. MICHAEL CULLUM @MICHAELCULLUMUK

  5. @MICHAELCULLUMUK STATISTICS

  6. @MICHAELCULLUMUK ARTIFICIAL INTELLIGENCE

  7. @MICHAELCULLUMUK MACHINE LEARNING

  8. @MICHAELCULLUMUK MACHINE LEARNING

  9. @MICHAELCULLUMUK LEARNING Cause
 &
 Effect Context Process Knowledge

  10. @MICHAELCULLUMUK USING Cause Knowledge Process Prediction
 of an
 effect

  11. @MICHAELCULLUMUK Cause Knowledge Process Process Cause Predicted
 effect Effect

  12. @MICHAELCULLUMUK EXAMPLE 1+1= 2 1+2= 3 1+3= 4 2+1= 3

    3+1= 4 Cause Effect
  13. @MICHAELCULLUMUK EXAMPLE 1+1= 2 1+2= 3 1+3= 4 2+1= 3

    3+1= 4 Knowledge
  14. @MICHAELCULLUMUK EXAMPLE 1+1= 2 1+2= 3 1+3= 4 2+1= 3

    3+1= 4 Cause 3+1= Predicted Effect 4 Knowledge
  15. @MICHAELCULLUMUK MACHINE LEARNING AS A 4-STEP PROCESS

  16. @MICHAELCULLUMUK 1. ACQUIRE DATA

  17. @MICHAELCULLUMUK 2. TRAIN MODEL

  18. @MICHAELCULLUMUK 3. ASK YOUR QUESTION

  19. @MICHAELCULLUMUK 4. GET PREDICTED ANSWER

  20. @MICHAELCULLUMUK 1. ACQUIRE DATA

  21. @MICHAELCULLUMUK GOOD LUCK

  22. @MICHAELCULLUMUK 2. TRAIN MODEL

  23. @MICHAELCULLUMUK SUPERVISED LEARNING UNSUPERVISED LEARNING

  24. @MICHAELCULLUMUK SUPERVISED LEARNING

  25. @MICHAELCULLUMUK KNOWN OUTCOMES

  26. @MICHAELCULLUMUK QUALITATIVE - REGRESSION QUANTATIVE - CLASSIFICATION

  27. @MICHAELCULLUMUK QUALITATIVE - REGRESSION QUANTATIVE - CLASSIFICATION

  28. @MICHAELCULLUMUK CLASSIFICATION Rating Conclusion 100 Good 25 Bad 50 Good

    40 Bad
  29. @MICHAELCULLUMUK CLASSIFICATION Rating Conclusion 100 Good 25 Bad 50 Good

    40 Bad
  30. @MICHAELCULLUMUK LINEAR CLASSIFIER Item Value Black PHP
 Devs White Sales

    Sales Test PHP Test
  31. @MICHAELCULLUMUK QUALITATIVE - REGRESSION QUANTATIVE - CLASSIFICATION

  32. @MICHAELCULLUMUK REGRESSION Price % alcohol 5.00 8.25 6.00 10 4.00

    6.75 3.00 5 0 2.5 5 7.5 10 0 1.5 3 4.5 6
  33. @MICHAELCULLUMUK REGRESSION Price % alcohol 5.00 8.25 6.00 10 4.00

    6.75 3.00 5 0 2.5 5 7.5 10 0 1.5 3 4.5 6
  34. @MICHAELCULLUMUK UNSUPERVISED LEARNING

  35. @MICHAELCULLUMUK DISCOVERY

  36. @MICHAELCULLUMUK ASSOCIATION
 CLUSTERING

  37. @MICHAELCULLUMUK ASSOCIATION
 CLUSTERING

  38. @MICHAELCULLUMUK ASSOCIATION Item 1 Item 2 T-shirt Shorts Shorts T-shirt

    Suit Black Shoes Socks Underwear Item 1 Item 2 Black shoes Suit Socks Underwear Underwear Socks T-shirt Socks
  39. @MICHAELCULLUMUK ASSOCIATION Item 1 Item 2 T-shirt Shorts Shorts T-shirt

    Suit Black Shoes Socks Underwear Item 1 Item 2 Black shoes Suit Socks Underwear Underwear Socks T-shirt Socks People who buy socks,
 also often buy underwear People who who buy
 underwear always buy
 socks
  40. @MICHAELCULLUMUK ASSOCIATION Item 1 Item 2 T-shirt Shorts Shorts T-shirt

    Suit Black Shoes Socks Underwear Item 1 Item 2 Black shoes Suit Socks Underwear Underwear Socks T-shirt Socks People who buy socks,
 also often buy underwear People who buy suits
 always buy black shoes People who who buy
 underwear always buy
 socks People who buy black
 shoes, always buy suits
  41. @MICHAELCULLUMUK ASSOCIATION Item 1 Item 2 T-shirt Shorts Shorts T-shirt

    Suit Black Shoes Socks Underwear Item 1 Item 2 Black shoes Suit Socks Underwear Underwear Socks T-shirt Socks People who buy socks,
 also often buy underwear People who buy suits
 always buy black shoes People who who buy
 underwear always buy
 socks People who buy black
 shoes, always buy suits People who buy shorts
 always buy t-shirts People who buy t-shirts,
 also often buy shorts
  42. @MICHAELCULLUMUK ASSOCIATION
 CLUSTERING

  43. @MICHAELCULLUMUK CLUSTER ANALYSIS IS THE TASK OF GROUPING A SET

    OF OBJECTS IN SUCH A WAY THAT OBJECTS IN THE SAME GROUP ARE MORE SIMILAR TO EACH OTHER THAN TO THOSE IN OTHER GROUPS.
  44. @MICHAELCULLUMUK CLUSTER ANALYSIS

  45. @MICHAELCULLUMUK 3. QUESTION
 4. PREDICTED ANSWER

  46. @MICHAELCULLUMUK ALGORITHMS

  47. @MICHAELCULLUMUK LEAST SQUARES

  48. @MICHAELCULLUMUK LEAST SQUARES REGRESSION LINE

  49. @MICHAELCULLUMUK MATHS

  50. @MICHAELCULLUMUK A+BX=Y

  51. @MICHAELCULLUMUK ▸ Each point has an x and y value

    ▸ We need an equation of a line ▸ We move the line an infinite number of times ▸ Each time, we draw a box between every point, and the line, with one corner on the line, and another on the point ▸ The correct line is the one where the sum of the area of all the squares is smallest PROCESS
  52. @MICHAELCULLUMUK DEMO

  53. @MICHAELCULLUMUK PHP

  54. @MICHAELCULLUMUK DEMO

  55. @MICHAELCULLUMUK DEMOS php-ai/php-ml

  56. @MICHAELCULLUMUK CODE $samples = [[60], [61], [62], [63], [65]]; $targets

    = [3.1, 3.6, 3.8, 4, 4.1]; $regression = new LeastSquares(); $regression->train($samples, $targets); echo $regression->predict([64]);
  57. @MICHAELCULLUMUK NEAREST NEIGHBOUR

  58. @MICHAELCULLUMUK NEAREST NEIGHBOUR

  59. @MICHAELCULLUMUK 3-NEAREST NEIGHBOUR

  60. @MICHAELCULLUMUK 5-NEAREST NEIGHBOUR

  61. @MICHAELCULLUMUK MATHS

  62. @MICHAELCULLUMUK PHP

  63. @MICHAELCULLUMUK DEMO

  64. @MICHAELCULLUMUK DEMO 0 1 2 3 4 0 1 2

    3 4
  65. @MICHAELCULLUMUK DEMO 0 1.25 2.5 3.75 5 0 1 2

    3 4
  66. @MICHAELCULLUMUK DEMO $samples = [[1, 3], [1, 4], [2, 4],

    [3, 1], [4, 1], [4, 2]]; $labels = ['a', 'a', 'a', 'b', 'b', 'b']; $classifier = new KNearestNeighbors(); $classifier->train($samples, $labels); echo $classifier->predict([3, 2]);
  67. @MICHAELCULLUMUK USES OF MACHINE LEARNING

  68. @MICHAELCULLUMUK NUMERICAL ANALYSIS

  69. @MICHAELCULLUMUK EXCEPTIONS

  70. @MICHAELCULLUMUK E-COMMERCE

  71. @MICHAELCULLUMUK FAULT DETECTION

  72. @MICHAELCULLUMUK ROOT CAUSE ANALYSIS

  73. @MICHAELCULLUMUK CLASSIFICATION

  74. @MICHAELCULLUMUK NATURAL LANGUAGE PROCESSING

  75. @MICHAELCULLUMUK ANALYSIS OF SUPPORT QUERIES

  76. @MICHAELCULLUMUK ANALYSIS OF LARGE NUMBERS OF DOCUMENTS

  77. @MICHAELCULLUMUK FUN

  78. @MICHAELCULLUMUK ANY QUESTIONS?

  79. THANKS @MICHAELCULLUMUK

  80. TREND ANALYSIS AND MACHINE LEARNING IN PHP SYMFONYCON CLUJ 2017

    @MICHAELCULLUMUK