Skip to content
Snippets Groups Projects
layout.md 5.55 KiB
Newer Older
  • Learn to ignore specific revisions
  • # Targeted audience
    
    - Researchers from DBIOL, BSSE and DGESS having no machine learning experience yet.
    - Basic Python knowledge.
    - Almost no math knowledge.
    
    # Concepts
    
    
    schmittu's avatar
    schmittu committed
    - two days workshop, 1.5 days workshop + .5 day working on own data / prepared data.
    
    - smooth learning curve
    
    schmittu's avatar
    schmittu committed
    - explain fundamental concepts first, discuss  exceptions, corner cases,
      pitfalls late.
    
    schmittu's avatar
    schmittu committed
    - plotting / pandas? / numpy first. Else participants might be fight with these
    
    schmittu's avatar
    schmittu committed
      basics during coding sessions and will be disctracted from the actual
      learning goal of an exercise.
    
    schmittu's avatar
    schmittu committed
    - jupyter notebooks / conda, extra notebooks with solutions.
    - use prepared computers in computer room, setting up personal computer during last day if required.
    - exercises: empty holes to fill
    
    schmittu's avatar
    schmittu committed
    TBD:
    
    schmittu's avatar
    schmittu committed
    # Course structure
    
    schmittu's avatar
    schmittu committed
    ## Part 0: Preparation (UWE)
    
    schmittu's avatar
    schmittu committed
    - quick basics matplotlib, numpy, pandas?:
    
    schmittu's avatar
    schmittu committed
    TBD: installation instructions preparation.
    
    schmittu's avatar
    schmittu committed
    TBD: prepare coding session
    
    schmittu's avatar
    schmittu committed
    ### Coding session
    
    
      - read dataframe from csv or excel sheet with beer features
      - do some features vs features scatter plots
    
    
    
    schmittu's avatar
    schmittu committed
    ## Part 1: Introduction  (UWE)
    
    - What is machine learning ?
      
      - learning from examples
      - working with hard to understand data.
      - automatation
    
    - What are features / samples / feature matrix ?
      - always numerical / categorical vectors
      - examples: beer, movies, images, text to numerical examples
     
    - Learning problems: 
       
        - unsupervised:
        
          - find structure in set of features
          - beers: find groups of beer types
        
        - supervised:
        
          - classification: do I like this beer ?
            example: draw decision tree
      
      
    ### Code walkthrough:
       
      - classification: linear SVM classifier or logistic regression example
      - clustering: scikit-learn example to find clusters, tbd: which algorithm
    
    
    ## Part 2a: supervised learning: classification
    
      Intention: demonstrate one / two simple examples of classifiers, also
                 introduce the concept of decision boundary
                 
      - idea of simple linear classifier: take features, produce real value ("uwes beer score"), use threshold to decide
        -> simple linear classifier (linear SVM e.g.)
        -> beer example with some weights
     
      - show code example with logistic regression for beer data, show weights, plot decision function
    
    ### Coding session:
    
      - change given code to use a linear SVM classifier
      
      - use different data (TBD) set which can not be classified well with a linear classifier
      - tell to transform data and run again (TBD: how exactly ?)
     
    
    schmittu's avatar
    schmittu committed
    ## Part 2b: supervised learning: regression (TBD: skip this ?)
    
    schmittu's avatar
    schmittu committed
      Intention: demonstrate one / two simple examples of regression
    
    
      - regression: how would I rate this movie ?
        example: use weighted sum, also example for linear regresor
        example: fit a quadratic function
    
      - learn regressor for movie scores.
    
    
    ## Part 3: accuracy, F1, ROC, ...
    
    
    schmittu's avatar
    schmittu committed
    Intention: accuracy is usefull but has pitfalls
    
    
    - how to measure accuracy ?
    
    schmittu's avatar
    schmittu committed
    
      - (TDB: skip ?) regression accuracy
      - 
    
      - classifier accuracy:
        - confusion matrix
    
    schmittu's avatar
    schmittu committed
        - accurarcy
    
        - pitfalls for unbalanced data sets
            e.g. diagnose HIV
        - precision / recall
        - ROC ?
    
    ### Coding session
    
    
    schmittu's avatar
    schmittu committed
    - evaluate accuracy of linear beer classifier from latest section
    
    
    - determine precision / recall
    
    
    schmittu's avatar
    schmittu committed
    - fool them: give them other dataset where classifier fails.
    
    
    ## Part 4: underfitting/overfitting
    
    classifiers / regressors have parameters / degrees of freedom.
    
    - underfitting:
    
      - linear classifier for points on a quadratic function
    
    - overfitting:
    
      - features have actual noise, or not enough information
        not enough information: orchid example in 2d. elevate to 3d using another feature.
      - polnome of degree 5 to fit points on a line + noise
      - points in a circle: draw very exact boundary line
    
    - how to check underfitting / overfitting ?
    
    
    schmittu's avatar
    schmittu committed
      - measure accuracy or other metric on test dataset
    
      - cross validation
    
    
    ### Coding session:
    
    - How to do cross validation with scikit-learn
    - use different beer feature set with redundant feature (+)
    - run crossvalidation on classifier
    
    schmittu's avatar
    schmittu committed
    - ? run crossvalidation on movie regression problem
    
    schmittu's avatar
    schmittu committed
    ## Part 6: pipelines / parameter tuning with scikit-learn
    
    - Scicit learn api:  recall what we have seen up to now.
    - pipelines, preprocessing (scaler, PCA)
    - cross validatioon
    - parameter tuning: grid search / random search.
    
    ### Coding par
    
    Planning: stop here, make time estimates.
    
    # DAY 2
    
    ### Part 6:
    
    Intention: quick walk throught throug reliable classifiers, give some background
    idea if suitable, let them play withs some incl. modification of parameters.
    
    to consider: decision graph from sklearn, come up with easy to understand
    diagram.
    
    
    - Neighrest neighbours
    - SVMs
      - demo for RBF: different parameters influence on decision line
    - Random forests
    - Gradient Tree Boosting
    
    schmittu's avatar
    schmittu committed
    
    ### Part 7: Start with neural networks. .5 day
    
    
    
    
    
    
    
    ### Coding session
    
    - apply SVM, Random Forests, Gradient boosting to previous examples
    - apply clustering to previous examples
    - MNIST example
    
    
    ### Coding session
    
    - build SVM and Random forest crossval pipelines for previous examples
    - use PCA in pipeline for (+) to improve performance
    - find optimal SVM parameters
    - find optimal pca components number
    
    ## Part 7: Best practices
    
    - visualize features: pairwise scatter, tSNE
    - PCA to undertand data
    - check balance of data set, what if not ?
    - start with baseline classifier / regressor
    - augment data to introduce variance
    
    ## Part 8: neural networks
    
    - overview, history
    - perceptron
    - multi layer
    - multi layer demoe with google online tool
    - where neural networks work well
    - keras demo
    
    ### Coding Session
    
    - keras reuse network and play with it.