Pattern Matching Algorithm In Machine Learning