Inference functions
- Derek Ferguson
- Jun 15, 2018
- 2 min read
So, the next thing we see in ML explanations using Tensor Flow are inference functions. In the case of the lesson I'm following now, the input data we've been using - house sizes and prices - have now been joined by 2 variables - a factor that will be multiplied by the size and an offset that will be added to the price. No definitions - what's going on?
So, this is simpler than the normalization - requiring not a background in Statistics, but just first year algebra. The unstated assumption here is that the relationship between house size and house price can be expressed as a line - meaning that as your house gets bigger, the price goes up or down - the only question is exactly by how much. Well, all lines in algebra are expressed in terms of the famous y = mx+b equation. So, what we're really looking at here are the values that TensorFlow is going to guess for "m" and "b" - known in algebra as the slope and y-intercept, in order to get a line that best fits the cloud of data points we're feeding in.
It did raise the question in my mind... why do we have to have a factor against the house size and the offset against the price. I guess it goes back to how we defined the input. We plotted the house size against the x axis, therefore it gets the slope. I guess, as a matter of convention, it looks like the data we expect to have in hand goes on the x axis and the data we will try to predict after our model is trained goes on the y axis. So, if we felt we were going to be trying to predict the size of a host based on its cost, we could invert our data and everything would work just as well.
Comentarios