270 likes | 280 Views
Explore the stages of problem analysis, reasoning mechanism development, and knowledge engineering in developing rule-based expert systems. Learn about supervised and similarity-based learning methods, including decision trees, neural networks, and k-nearest neighbor classification. Discover concepts such as learnability, induction, and feature weighting in machine learning.
E N D
Machine Learning Lucy Hederman Dip HI KBS Module
KBS Development Stage 1: analysis of the problem that produces a representation of the problem that can be manipulated by the reasoning system - this representation is often a set of attribute values. Stage 2: developing the reasoning mechanism that manipulates the problem representation to produce a solution. Dip HI KBS Module
Stage 2 • Knowledge engineering - manually • rule development for a rule-based ES • Learning - similarity-based • generalise from examples (training data) • Learning - explanation-based • build on prior knowledge • use small number of canonical examples • incorporate explanations, analogy, ... Dip HI KBS Module
Risk Assessment Example • Expert might develop rules like • if collateral is adequate and credit history is good then risk is low. • Alternatively build a system which learns from existing data on loan application decisions (see attached). • Similarity-based learning Dip HI KBS Module
Classifying apples and pears To what class does this belong? Dip HI KBS Module
Supervised Learning • Supervised learning • training data classified already • Unsupervised learning • acquire useful(?) knowledge without correctly classified training data • category formation • scientific discovery • We look at supervised learning only. Dip HI KBS Module
Learnability • Induction depends on there being useful generalisations possible in the representation language used. • Learnability of concepts in a representation language is the ability to express the concept concisely. • Random classifications are not learnable. Dip HI KBS Module
Similarity-based learning • Decision tree (rule) induction • induce a decision tree (set of rules) from the training data. • k-nearest neighbour classification • classify a new problem based on the k most similar cases in the training data. • Artificial Neural Networks • adjust weights in an NN to reduce errors on training data. Dip HI KBS Module
Decision Tree Induction • Aim to induce a tree which • correctly classifies all training data • will correctly classify unseen cases • ID3 algorithm assumes that the simplest tree that covers all the training examples is the best at unseen problems. • Leaving out extraneous tests should be good for generalising. Dip HI KBS Module
ID3 • Top-down construction • add selected tests under nodes • each test further partitions the samples • continue till each partition is homogeneous • Information-theoretic test selection • maximise information gain • ID3 works surprisingly well. Variations and alternatives exist. Dip HI KBS Module
k-Nearest Neighbour Classification • Data base of previously classified cases kept throughout. • Category of target case decided by category of its knearest neighbours. • No inducing or training of a model. • “Lazy” learning • work deferred to runtime • compare with neural networks - eager learners Dip HI KBS Module
“Nearest” - distance/similarity For query q and training set X (described by features F) compute d(x,q) for each x X, where and where Dip HI KBS Module
k-NN and Noise • 1-NN easy to implement • susceptible to noise • a misclassification every time a noisy pattern retrieved • k-NN with k 3 will overcome this • Either • straight voting between the k examples or • weighted votes depending on “nearness” of each example. Dip HI KBS Module
K-NN vs. Decision Trees • Decision trees test features serially. • If two cases don’t match on first feature tried they don’t match at all. • K-NN considers all features in parallel. • For some tasks serial testing is OK, for others it’s not. Dip HI KBS Module
Dimension reduction in k-NN Feature Selection q best features • Not all features required • noisy features a hindrance • Some examples redundant • retrieval time depends on no. of examples n covering examples Condensed NN m examples p features Dip HI KBS Module
100 examples 2 categories Different CNN solutions Condensed NN Dip HI KBS Module
Feature weighting • Feature weights • modify the effect of large continuous distance values • allow some features to be treated as more important than others • pull cases with important features in common closer together. Dip HI KBS Module
Push Pull Feature weighting • Introspective learning - • Test training data on itself • For a correct retrieval • increase weight of matching features (pull) • decrease weight of un-matching features (pull) • For an incorrect retrieval • decrease weight of matching features (push) • increase weight of un-matching features (push) Dip HI KBS Module
(Artificial) Neural Networks • Decision tree induction builds a symbolic “causal” model from training data. • k-NN builds no model. • A neural network is a sub-symbolic, non-causal, distributed, “black box”, model built from training data. • ANN output is continuous whereas a k-NN classifies into discrete classes. Dip HI KBS Module
NN Prediction of Malignancy • A. Tailor and co. paper describes a neural network which computes a probability of malignancy from age, morphological features, and sonographic data. • Describes design and testing of the NN. • Note intro to NNs in the Appendix Dip HI KBS Module
ANN Advantages • Particularly suited to pattern recognition • character, speech, image • Suited to domains where there is no domain theory or model. • Robust - Handle noisy and incomplete data well. • Potentially fast. Parallel processing. • Flexible and easy to maintain. Dip HI KBS Module
ANN Problems • Lack explanation • Currently implemented in software mostly. • Training times can be tedious. • Need lots of training and test data. • True of similarity-based learning in general. Dip HI KBS Module
ANN Processing Element (PE) Summation - gives PE’s activation level Transfer function - modifies the activation level to produce a reasonable output value (e.g. 0-1) . Dip HI KBS Module
There may be additional hidden layers. different topologies different connectivity Choosing ANN structure is based on problem and requires some expertise. Typical ANN Structure PE PE PE PE PE PE PE PE Inputlayer Hiddenlayer Outputlayer Dip HI KBS Module
Learning/Training • Aim to obtain desired outputs for each training example. • Backpropagation is the most popular learning algorithm. • Initialise all weights associated with inputs to each PE. • Present sample inputs to ANN. • Compare ANN outputs with desired output. • Alter weights to reduce the mean square error, and repeat. • until the error is within some tolerance. Dip HI KBS Module
Overfitting Too much training will result in a (k-NN or ANN) model that makes minimal errors on the training data (memorises), but no longer generalises well. Beware. Error Generalisation error In-sample error Training time Dip HI KBS Module
ANN Development Get more better data Collect data Separate into training and test sets Define a network structure Select a learning algorithm Set parameters, values, weights Transform data to network inputs Start training, revise weights Stop and test Use the network for new cases. Reseparate Redefine structure Select another algorithm Reset Reset Dip HI KBS Module