0% found this document useful (0 votes)
4 views

Assignment

Uploaded by

akshat112004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignment

Uploaded by

akshat112004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment (50 Marks)

1. (Marks: 10)
(Feature Masking as regularization) consider linear regression model by minimizing the squared loss
𝑁 2
𝑇
function ∑ (𝑦𝑛 − 𝑤 𝑥𝑛) . Suppose we decide to mask out or “drop” each feature 𝑥𝑛𝑑 of each input 𝑥𝑛
𝑛=1
𝐷
ϵ 𝑅 , independently, with probability (1-p ) (equivalently, retaining the feature with probability p). Masking
or dropping out basically means that we will set the feature 𝑥𝑛𝑑 to 0 with probability (1-p). Essentially, it
would be equivalent to replacing each input 𝑥𝑛 by 𝑥𝑛 = 𝑥𝑛◦ 𝑚𝑛 , where ◦denotes element wise product and
𝑚𝑛 denotes the 𝐷 × 1 binary mask vector with 𝑚𝑛𝑑 ∼ 𝐵𝑒𝑟𝑛𝑜𝑢𝑙𝑙𝑖 (𝑝) (𝑚𝑛𝑑 = 1 means the feature 𝑥𝑛𝑑
was retained; 𝑚𝑛𝑑 = 0 means the feature 𝑥𝑛𝑑 was masked/zeroed).

𝑁 2
𝑇
Let us now define a new loss function using these masked inputs as follows: ∑ (𝑦𝑛 − 𝑤 𝑥𝑛 ) . Show
𝑛=1
that minimizing the expected value of this new loss function (where the expectation is used since the mask
vectors 𝑚𝑛 are random) is equivalent to minimizing a regularized loss function. Clearly write down the
expression of this regularized loss function.

2. Explore, define, and explain the following terms: (11 marks)


1. Least squares problem
2. Generalization
3. Cross-validation, Hold-out validation, Leave-one out validation
4. KKT conditions
5. Feature Correlation
6. Bias and Variance tradeoff
7. Prior Probability, Conditional Probability, and Posterior Probability

3. Explain the issues with the current AI models and the problem of unity of perception. (4 Marks)

4. Consider the following set of training examples: (Marks: 2)

What is the information gain of a2 relative to these training examples? Provide the equation for calculating the
information gain.

5. How do you handle collinearity in a linear regression model? (Hint: read about assumptions of linear regression)
(Marks: 2)

6. Given a dataset for utility fraud detection, you built a classifier model that achieved a performance score of
98.5%. Is this a good model? If yes, justify your answer. If not, what can you do to improve it? (Marks: 2)
7. Why would you Prune a decision tree? (Marks: 2)

8. There is a dictionary containing information about employees in a company. (Marks: 8)


employee_data = { 'EmployeeID': [101, 102, 103, 104, 105],

'Name': ['Alice', 'Bob', 'Charlie', 'David', 'Eve'],

'Department': ['HR', 'Finance', 'IT', 'HR', 'Finance'],

'Salary': [60000, 70000, 80000, 65000, 72000],

'JoiningDate': ['2020-01-15', '2019-03-23', '2021-06-01', '2020-07-30', '2018-11-20']

Your tasks are as follows:

1. Create a pandas DataFrame from the employee_data dictionary.

2. Display the first 3 rows of the DataFrame.

3. Calculate the average salary of employees in each department.

4. Find the employee with the highest salary.

5. Determine the number of employees who joined after January 1, 2020.

6. Add a new column called YearsInCompany that shows the number of years each employee has been in the

company (as of the current date).

7. Filter and display the data of employees who are in the 'Finance' department.

9. (Marks: 9)

Derive the corresponding equations and solutions for the primal and dual problems in binary SVM for the cases

below:

a) hard margin b) soft margin

You might also like