Rule based Vs ML based example-2


Let us continue our discussion. As we saw in our rule based approach our outcome is totally determined by what new rule we create. It has less to do with what our earlier rules were.
In case of learning our next prediction takes into account all the data we gathered so far.
This boundary is not very crisp and we are free to adjust our learning where it gives more weight to one type of data and less to other and similarly we can define a rule which says that we ‘ll act according to our learning and rule can simply to apply one type of learning. But the difference is apparent from this context also. Focus of rules is more on taking decision based on answer of concrete question while learning forms a continuous trajectory which you need to follow to decide your point of interest.

Now let us formally define our rule that we followed in our onion example:

It was like:

Rule :
If you paid $y for x kg of onion then price of onion per kg is $(y/x)

Learning approach was as follows :
Keep track of past spending on onion. Your future spending will depend on that.

As we can see the second statement as of now doesn’t specify what steps you need to follow to reach on future spending. But it does stress that you need to keep track of all past spending. So, this is one type of learning in which our assumption is that the future outcome is based on the past events. Or we are trying to find a pattern in things that we saw in past and once we have that pattern we know what is the next outcome that follows that pattern. A parallel can be draw to the learning by experience in human beings.
For example, if you are on a journey where you only know your goal and not your optimal route then you can choose one of the following ways to decide your next path. Either at each step you stop and ask few questions and then decide what the next route is. Or you just follow a route which seems most suitable which you followed so. Far and keep changing it based on what obstacle you get on this route.

Coming back to our onion price example again. We can put additional factors to determine how much we need to pay for particular amount of onion. For example, in case of rule based approach we can add cost of going to market along with onion price. Similarly, to a learning algorithm we can add one more data set to specify how our future price will be impacted by adding one more feature to determine our future outcome.  Now our learning will decide the outcome based on two factors and our rule will have one more rule to add to determine total price.  In case of rule based system this will add one more step in calculation. And suppose you have 2 markets from where you can onions and travel time for both are different then there will an additional rule to first decide which market you went to correctly calculate travel expense.
Needless to say that our learning algo will also need additional data for any added feature. And probably a wise selection from your side on what learning approach you need to follow. Maybe we can get a glimpse from above discussion on how we approach to the added complexity in our problems.




Comments

Popular posts from this blog

Software Developers and the Estimations

Rule based Vs ML based example