In the mind of a computer, a data set is any collection of data. It can be anything from an array to a complete database.
Example of an array:
[99,86,87,88,111,86,103,87,94,78,77,85,86]
By looking at the array, we can guess that the average value is probably around 80 or 90, and we are also able to determine the highest value and the lowest value, but what else can we do?
And by looking at the database we can see that the most popular color is white, and the oldest car is 17 years, but what if we could predict if a car had an AutoPass, just by looking at the other values?
That is what Machine Learning is for! Analyzing data and predict the outcome!
MEAN
In Machine Learning (and in mathematics) there are often three values that interests us:
- Mean - The average value
Example: We have registered the speed of 13 cars:
speed = [99,86,87,88,111,86,103,87,94,78,77,85,86]
What is the average, the middle, or the most common speed value?
Mean
The mean value is the average value.
To calculate the mean, find the sum of all values, and divide the sum by the number of values:
(99+86+87+88+111+86+103+87+94+78+77+85+86) / 13 = 89.77
The NumPy module has a method for this:
Use the NumPy mean()
method to find the average speed:
Get your python IDE set:
Insert the code below:
import numpy
speed = [99,86,87,88,111,86,103,87,94,78,77,85,86]
x = numpy.mean(speed)
print(x)
Returns: 89.76923076923077
Part Two coming soon stay tuned.
No comments:
Write Comments