Search

Translate

Evaluating hypothesis in machine learning

What is hypothesis?

The model have certain conditions to approximate the target function and this conditions are called hypothesis. In other words it is a statement which is derived from the training dataset or sample set and can be further used for finding the target function.
For example: The model which identifies presence of diabetes in a person classifies the data based on certain conditions like if the fasting plasma glucose is 126 mg/dl or higher then the person has diabetes if it is less than 100ml/dl then the person has no diabetes, these conditions are called hypothesis.

Why we have to evaluate hypothesis?

  1. We have to find the accuracy of learned hypothesis to conclude whether the model works well or not and to use it or not.
  2. Evaluating hypothesis is integral component of many learning methods that is without evaluating we can't implement the model in real world.

Terms to consider while evaluating:

Bias: 

Bias is the difference between the predicted and actual values. In other words how far the model predicts the data from the actual values. When the model has high bias it means the prediction will be inaccurate, since it pays little attention on training data. It over simplifies the model by ignoring the in depth relation between features and the target function.

Variance:

Variance is variability in the prediction of the model. It occurs when the model is highly sensitive to the changes in the features. Model with high variance pays lot of attention to training data and captures each and every details in it. Such models performs well on training data but fails to generalize the relationship between the features within the data which leads to overfitting.

Underfitting:

underfitting model has high bias and low variance or we can say accuracy of the model over both training and testing data is low.

Overfitting:

Overfitting model has low bias and high variance or we can say accuracy of the model over training data is high and testing data is low.

best fitting:

best fitting model has low bias and low variance or we can say accuracy of the model over both training and testing data is high. The best fitted model lies between under fitting and overfitting.

Methods of evaluating:

  1. Evaluate the learned hypothesis.
  2. compare the accuracy of two hypothesis.
  3. compare when only limited data is available.

Evaluating hypothesis accuracy:

Sample Error and True Error:

Sample error is the fraction of samples which are misclassified. Samples are chosen from the entire population.
Example: if 5 samples are misclassified out of 20 samples, then sample error = 5/20 = 0.25.
True error is the probability that a randomly drawn instance from the entire distribution is misclassified.
True error is difficult to calculate as it is the representation of entire population hence we calculate sample error, which is the estimate of true error. But, the sample data may or may not represent the entire population. So to know,

"How good an estimate of true error is provided by the sample error?" 

we need to calculate confidence interval.

Confidence interval:

Confidence interval is a range where we are certain that estimate of true error exists. This range between which a given estimate can vary is referred to as "margin of error"

In general it is calculated by,
where errors(h), is the sample error.

confidence level is likelihood of existence of estimate in a confidence interval if we perform an experiment on samples repeatedly. By default trainers set the confidence level at 95%. As you increase the confidence level further the confidence interval range become wider.
Previous
Next Post »