Random forest algorithms can be trained to identify errors and predict problems in complex systems. For example, problematic conditions on oil and gas pipelines, including leaks, can now be detected automatically by these systems through the analysis of real-time pressure and flow data. This technology-based solution obviates the old, manual, expensive, and inaccurate methods for detecting pipeline leaks, which required visual inspection of miles of pipeline by pilots in light aircraft. These algorithms are also being employed to automatically identify anomalous conditions with applications as varied as medicine, agriculture, and cybersecurity.
k-Nearest Neighbour algorithms can be used to find clusters of stocks with similar trading patterns. Quantitative traders and investors can use these algorithms to automate investment decisions in correlated instruments, which were previously calculated using manually-maintained spreadsheets. Benefits of these algorithms include rapid, accurate responses to changing market conditions, such as those achieved by high-frequency trading systems—which are consistently more profitable than human-operated trading strategies. These algorithms are also being used in retail contexts to understand customer behaviour and in medical contexts to study diseases.