Will Machine Learning kill Business Logic?



JFokus, Stockholm, February 2019

Oliver Zeigermann / @DJCordhose

http://bit.ly/ml-jfokus-intro

Programmer's approach: Code Rules by Hand


if age < 25:
    if speed > 140:
        return red # young people, fast cars: high risk
    else:
        return yellow # young people: medium risk
            

if age > 75:
    return red # old people: high risk
            

if miles_per_year > 30:
    return red # a lot of driving: high risk
if miles_per_year > 20:
    return yellow #  a bit of driving: medium risk
            

return green # otherwise: low risk
            

https://colab.research.google.com/github/djcordhose/ai/blob/master/notebooks/sklearn/classic-code.ipynb

Approaching with data




  • 0 - red: many accidents
  • 1 - green: few or no accidents
  • 2 - yellow: in the middle

Let's check: Is the data we have any good?

Would we able to rank me (47) for a car having 100 mph top speed, driving 10k miles per year?

Decision Bounaries

Code in Scikit-learn

Scikit-learn: most popular classic machine learning lib

Training


from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier()
clf.fit(X_train, y_train)
            

Prediction


y_pred = clf.predict(input)
        
https://scikit-learn.org/stable/modules/classes.html
https://colab.research.google.com/github/djcordhose/ai/blob/master/notebooks/sklearn/dt-intro.ipynb

Decision Trees

Up to 70% accuracy on unknown data

The Issue: Overfitting

Training Score

Test Score

Training and test scores clearly divert

Code in TensorFlow using Keras API

TensorFlow: most popular deep learning lib


# model    
model = keras.Sequential()

model.add(Dense(200, name='hidden1', input_dim=3))
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(Dropout(0.6))

model.add(Dense(500, name='hidden2'))
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(Dropout(0.6))

model.add(Dense(3, name='softmax', activation='softmax', optimizer='adam'))

model.compile(loss='categorical_crossentropy')
                    

# training
model.fit(X_train, y_train, epochs=2000)
                    

# prediction
y_pred = model.predict([[100, 47, 10]])
        
https://colab.research.google.com/github/djcordhose/ai/blob/master/notebooks/tensorflow/nn-reg.ipynb

There is no general AI

Consciousness or autonomous learning
does not exit in machines

AI and machine learning is not like super-humans

Wrap-Up

  • Machine Learning can learn from existing data and generalize from it
  • Sometimes, it can be an alternative to explicit, classic business logic
  • No machine has common knowledge of the world, though
  • Machine Learning is an engineering effort. There is no strong AI that you just throw a problem at and it will solve it automatically. Dr. Sebastian Wieczorek, Head of AI @SAP
  • ML approach might be a mismatch with classic and agile approaches

JFokus 2019: Will Machine Learning kill Business Logic?

Oliver Zeigermann / @DJCordhose
http://bit.ly/ml-jfokus-intro