Ch. 18 Artificial intelligence (AI)
Dijkstra’s Algorithm
- Finds the shortest path between two points on a graph
- Each point on the graph is called a node or a vertex
- Steps:
- Give the start vertex a final value of 0
- Give each vertex connected to the last vertex a working value, if it already has a working value, only replace it with another if that’s lower
- Check the working value of any vertex that has not been assigned a final value, assign the smallest value to that vertex, that is now its final value
- Repeat steps 2 and 3 until the end vertex is reached, and all vertices have been assigned a final value
- Trace the route back from the end vertex to the start vertex to find the shortest path between those two vertices
A* algorithm
- Based on Dijkstra, but adds an extra heuristic value — a guess on how far we have to go to reach the next destination most efficiently
- Examples on a heuristic value is the diagonal remaining distance of the node to the end vertex
- For example, the two values are added and the path with the smallest sum is the chosen route
Machine learning categories
- Supervised learning
- Known input and output data is made available
- Learning will end when the model produces an acceptable level of performance
- Regression-type: target will be to predict a quantitative value such as a number
- Classification-type: target is a qualitative value such as whether a customer is worth sending marketing emails to
- Unsupervised learning
- Only a measured set of input values but no corresponding output
- The task is to identify some underlying structure or the distribution of the dataset
How artificial neural networks have helped with machine learning
- Deep Learning
- Artificial neural networks are based on the interconnections between neurons in the human brain
- Handle huge amounts of data
- Machine Learning
- Systems that learn without being programmed to learn
- Reinforcement Learning
- Learning on the basis of “reward and punishment”
- Uses trial and error in algorithms to determine which action gives the most optimal outcome
Back propagation of errors and regression methods
- Back propagation
- The initial outputs from the system are compared to the expected outputs and the system weightings are adjusted to minimise the difference between actual and expected results.
- Calculus is used to find the error gradient in the obtained outputs: the results are fed back into the neural networks and the weightings on each neuron are adjusted (note: this can be used in both supervised and unsupervised networks).
- Once the errors in the output have been eliminated (or reduced to acceptable limits) the neural network is functioning correctly and the model has been successfully set up.
- If the errors are still too large, the weightings are altered – the process continues until satisfactory outputs are produced.
- Regression
- To make predictions from given data by learning some relationship between the input and the output