Slide 1

Slide 1 text

15th Feb 2017 - TRUG Michal Poczwardowski [email protected] dmp @ 3cityIT slack

Slide 2

Slide 2 text

f Machine learning - field of study that gives computers the ability to learn without being explicitly programmed. Arthur Samuel, 1959

Slide 3

Slide 3 text

gathered data determines output supervised vs unsupervised

Slide 4

Slide 4 text

● Recommendations ● Expert systems ● Spam filters ● Classifications ● Google Search

Slide 5

Slide 5 text

● Decision Tree - ID3 ● Jaccard Index ● K-means clustering ● Naive Bayes ● Artificial Neural Networks ● + more more more

Slide 6

Slide 6 text

? ● Complicated written using unknown symbols might be discouraging ● Use prepared tools / libraries

Slide 7

Slide 7 text

? ● lack of stuff ● speed (historical) ● old gems / not so many resources ● ML and AI experts mosty use Java and Python, Ruby hasn't got much love - most of them come from Universities and more scientific studies - Ruby is just not used in such environments

Slide 8

Slide 8 text

● github.com/igrigorik/decisiontree ● github.com/reddavis/K-Means ● github.com/francois/jaccard ● github.com/davidcelis/recommendable (for models)

Slide 9

Slide 9 text

#1 1: require 'decisiontree' 2: 3: attributes = ['Temperature'] 4: training = [ 5: [36.6, 'healthy'], 6: [37, 'sick'], 7: [38, 'sick'], 8: [36.7, 'healthy'], 9: [40, 'sick'], 10: [50, 'really sick'], 11: ]

Slide 10

Slide 10 text

#2 12: dec_tree = DecisionTree::ID3Tree.new(attributes, training, 'sick', :continuous) 13: dec_tree.train 14: 15: test = [37.5, 'sick'] 16: decision = dec_tree.predict(test) 17: puts "Predicted: #{decision} ... True decision: #{test.last}" # => Predicted: sick ... True decision: sick

Slide 11

Slide 11 text

1: a = ["likes:jeans", "likes:blue"] 2: b = ["likes:jeans", "likes:women", "likes:red"] 3: c = ["likes:women", "likes:red"] 4: 5: # Determines how similar a pair of sets are 6: Jaccard.coefficient(a, b) 7: #=> 0.25 8: 9: Jaccard.coefficient(a, c) 10: #=> 0.0 11: 12: Jaccard.coefficient(b, c) 13: #=> 0.6666666666666666 14: 15: # According to the input data, b and c have the most similar likes.

Slide 12

Slide 12 text

-

Slide 13

Slide 13 text

- 1: require 'k_means' 2: 3: data = [[1,1], [1,2], [1,1], [1000, 1000], [500, 500]] 4: kmeans = KMeans.new(data, centroids: 2) 5: kmeans.inspect 6: => [[3, 4], [0, 1, 2]]

Slide 14

Slide 14 text

- f : ● K-means exaple HERE ●

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

● https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer ● http://otobrglez.opalab.com/ruby/2014/03/23/simple-ruby-recommendation-system.html ● https://en.wikipedia.org/wiki/Jaccard_index ● https://en.wikipedia.org/wiki/K-means_clustering ● https://en.wikipedia.org/wiki/ID3_algorithm

Slide 17

Slide 17 text

thanks!