- you are given a training set represented in the table below:
You want to apply a machine learning algorithm, like a k-nearest neighbour, which is very sensitive to scales used to measure the attribute values. You, therefore, decide to scale all attributes within the range [0,1]. Please report the values of the rescaled attributes of the last training example:
A1:
A2:
A3:
Correct answer: 0.32;0.26;0.62
Analysis:
We can see the table, the minimum of A1 is 415 and the maximum of A1 is 915. So, compared with the last example, the norm is (575-415)/(915-415)=0.32
as same as A2, the minimum of the A2 is 1.3 and the maximum of A2 is 6.3. So, compared with the last example, the norm is (2.6-1.3)/(6.3-1.3)=0.26
the same as A3, the minimum of A3 is 1.4 and the maximum of A3 is 11.4. So, compared with the last example, the norm is (7.6-1.4)/(11.4-1.4)= 0.62.
- Suppose you have an incremental 1 nearest neighbour learning system that uses the number of identical attributes as its similarity measure. The system retains a new example if it satisfies any of the following conditions (tested in this order):
It has zero similarity to saved examples;
It has two or more equally similar nearest neighbours of different classes;
It would have been misclassified using single nearest neighbour.
Examples that do not satisfy any of these conditions are not retained. The data set given in the table below is presented to this system only once and in the order that it appears in the table.
Explain which examples will be retained and why:
medium,heavy,yellow : Poor ---------Retained because of condition 1
small,medium,brown : Good----------Retained because of condition 1
small,medium,red : Poor--------------Retained because of condition 1
large,medium,brown : Good ---------not retained
large,light,yellow : Poor Answer------not retained.
large,medium,yellow : Good----------not retained.
large,light,red : Poor -------------------Retained because of condition 2
- Model selection in regression analysis can be implemented using Forward and Backward Stepwise Regression. Although these specific procedures are used primarily in regression analysis, the general approach is applicable to most ML algorithms where they are known as:
Greedy forward feature selection
Greedy backward feature elimination
Forward Stepwise Regression involves the following steps:
Initialization:
Loop:
Exit:
Backward Stepwise Regression involves the following steps:
Initialization:
Loop:
Exit:
Analysis:
The steps of this processing are very important when you writing the regression.
- We are trying to predict the monthly rent of a flat given the number of trains to London per day from the closest station. The following data is available:
Consider the family of linear models h1(T)=a0+a1T and find the values of a0 and a1 that minimise the Mean Squared Error (MSE) for the data in the table. Then compute the corresponding R2.
a0:
a1:
MSE:
R2:
MSE:
R2 :
Analysis:
5. Look at following pictures.
Analysis: