Computer Science Assignment 3 CC
MMIS 671: Final Exam, Fall 2025
Maximum Score: 25 Points
Due October 5, 2025
This work strictly reflects my individual effort
Name: (PRINT NAME)
· Please answer all questions in this document and submit your document on Canvas by the specified deadline.
· Please present your work clearly and concisely so that I can follow your approach and arguments easily. Do not include irrelevant material.
· You may use reference material, but your submission should strictly reflect your individual effort.
· There should be no consultations or collaboration.
· Penalty for collaboration 25 points
· Penalty for late submission 20 points
Question 1. Linear Programming Models [9 Points]
A company supplies 5 types of products to a retailer. It is contractually obliged to meet the demands of the retailer. Because of limited capacity the company may not have sufficient machining time, assembly time, and finishing time available to satisfy the entire demand through its in-house production. Contractual obligation requires the company to make up for any shortfall by procuring the products, at higher costs, from an outsourcing partner. The company aims to meet the demands at minimum cost. The table below summarizes the relevant data. All costs are in dollars. The resource requirements for production are specified in minutes per unit. For example, it takes 1 minute of machine time, 3 minutes of assembly time, and 3 minutes of finishing time to produce each unit of P1.
|
Product |
P1 |
P2 |
P3 |
P4 |
P5 |
|
|
|
Demand |
6000 |
1000 |
2000 |
8000 |
9000 |
|
|
|
Production cost |
38 |
61 |
77 |
52 |
110 |
|
|
|
Purchase cost |
47 |
71 |
90 |
63 |
125 |
|
|
|
|
|
|
|
|
|
Available hours |
Cost / hour |
|
Machine time |
1 |
1 |
3 |
2 |
4 |
1040 |
180 |
|
Assembly time |
3 |
4 |
4 |
3 |
4 |
1440 |
240 |
|
Finishing time |
3 |
2 |
2 |
4 |
2 |
1184 |
60 |
You must formulate the problem as a linear programming model, solve the model using available data to find an optimal production plan, and identify ways to improve the production process through sensitivity analysis.
Task 1.1. Formulate the problem as a linear programming model. [2 Points]
Decision variables:
Objective Function:
Subject to Constraints:
Task 1.2. Solve the LP model and present optimal solutions. [4 Points]
Minimum cost attainable: $ …………….
|
|
P1 |
P2 |
P3 |
P4 |
P5 |
|
Quantity produced |
|
|
|
|
|
|
Quantity purchased |
|
|
|
|
|
|
|
Minutes Available |
Minutes Used |
Minutes NOT Used |
|
Machine time |
|
|
|
|
Assembly time |
|
|
|
|
Finishing time |
|
|
|
Task 1.3. Sensitivity analysis. [3 Points]
What is the maximum amount that the company should be willing to pay to increase the availability of each resource by 1 hour?
· Pay up to $… per hour to increase the availability of machining time.
Reasoning:
· Pay up to $ … per hour to increase the availability of assembly time.
Reasoning:
· Pay up to $ … per hour to increase the availability of finishing time.
Reasoning:
Question 2. Decision Tree Classifier [8 Points]
Data: The zip file “ final.q2.data.zip” contains 3 CSV files:
· “ final.q2.train.csv” contains 10,000 rows and 41 columns. The first column ‘ y’ is the output variable with 2 classes: 0, 1. The remaining 40 columns contain input features: x1, …, x40.
· “ final.q2.test.csv” contains 2,000 rows and 41 columns. The first column ‘ y’ is the output variable with 2 classes: 0, 1. The remaining 41 columns contain input features: x1, …, x40.
· “ final.q2.new.csv” contains 30 rows and 41 columns. The first column ‘ ID’ is an identifier for 30 unlabeled samples. The remaining 41 columns contain input features: x1, …, x40.
Task 2.1. [2 points]
Use 5-fold cross-validation with the 10,000 labeled exampled from “ final.q2.train.csv” to determine the fewest number of rules using which a decision tree classifier can achieve mean cross-validation accuracy of at least 0.95. Report the number of rules needed, and the mean cross-validation accuracy obtained with max_leaf_nodes set at this value.
Fewest number of rules needed: … ( max_leaf_nodes used)
Mean cross-validation accuracy: … ( rounded to 4 decimal places)
Task 2.2. [2 Points]
Train a DecisionTreeClassifier with the hyper-parameter values determined in Task 1 on all 10000 training samples and use it to predict the output class ‘ y’ for the 2,000 examples in “ final.q2.test.csv” . Report the following:
· Accuracy on 2,000 test examples : …. (Rounded to 4 decimal places)
· Classification report for the 2,000 test examples (Rounded to 4 decimal places):
· Confusion matrix for the 2,000 test examples
|
|
Predicted y = 0 |
Predicted y = 1 |
|
Labeled y = 0 |
|
|
|
Labeled y = 1 |
|
|
Task 2.3. [2 Points]
Use the model trained in Task 2 to predict the output class ‘ y’ for the 30 examples in “ final.q2.new.csv”. Specify the predicted classes in the table below:
|
ID |
predicted y |
|
ID_001 |
|
|
ID_002 |
|
|
ID_003 |
|
|
ID_004 |
|
|
ID_005 |
|
|
ID_006 |
|
|
ID_007 |
|
|
ID_008 |
|
|
ID_009 |
|
|
ID_010 |
|
|
ID_011 |
|
|
ID_012 |
|
|
ID_013 |
|
|
ID_014 |
|
|
ID_015 |
|
|
ID_016 |
|
|
ID_017 |
|
|
ID_018 |
|
|
ID_019 |
|
|
ID_020 |
|
|
ID_021 |
|
|
ID_022 |
|
|
ID_023 |
|
|
ID_024 |
|
|
ID_025 |
|
|
ID_026 |
|
|
ID_027 |
|
|
ID_028 |
|
|
ID_029 |
|
|
ID_030 |
|
Task 2.4. [2 Points]
Of the 40 input features which ones are relevant for this classification task?
The following …. ( specify number) input features are relevant for this classification task:
…………… ( specify list of feature names in alphabetical order)
Display your decision tree as an image:
Question 3. Supervised machine learning classifiers [8 Points]
Data: The zip file “ final.q3.data.zip” contains 3 CSV files:
· “ final.q3.train.csv” contains 10,000 rows and 11 columns. The first column ‘ y’ is the output variable with 4 classes: 0, 1, 2, 3. The remaining 10 columns contain input features: x1, …, x 10.
· “ final.q3.test.csv” contains 2,000 rows and 11 columns. The first column ‘ y’ is the output variable with 4 classes: 0, 1, 2, 3. The remaining 10 columns contain input features: x1, …, x 10.
· “ final.q2.new.csv” contains 30 rows and 11 columns. The first column ‘ ID’ is an identifier for 30 unlabeled samples. The remaining 10 columns contain input features: x1, …, x 10.
Task 3.1. [3 points]
Use 5-fold cross-validation with the 10,000 labeled exampled from “ final.q3.train.csv” to identify a classifier that achieves mean cross-validation accuracy of at least 0.96. You should try several classifiers. Try different hyper-parameter values for the better performing classifiers to obtain a good set of hyper-parameter values. Report the following:
Selected model with non-default hyper-parameter values :
Mean cross-validation accuracy: ………… ( rounded to 4 decimal places)
Task 3.2. [3 Points]
Train the classifier with the hyper-parameter values determined in Task 1 on all 10,000 training samples and use it to predict the output class ‘ y’ for the 2,000 examples in “ final.q3.test.csv” . Report the following:
· Accuracy on 2,000 test examples : …. (Rounded to 4 decimal places)
· Classification report for the 2,000 test examples (Rounded to 4 decimal places):
· Confusion matrix for the 2,000 test examples
|
|
Predicted y = 0 |
Predicted y = 1 |
Predicted y = 2 |
Predicted y = 3 |
|
Labeled y = 0 |
|
|
|
|
|
Labeled y = 1 |
|
|
|
|
|
Labeled y = 2 |
|
|
|
|
|
Labeled y = 3 |
|
|
|
|
Task 3.3. [2 Points]
Use the model trained in Task 2 to predict the output class ‘ y’ for the 30 examples in “ final.q3.new.csv”. Specify the predicted classes in the table below:
|
ID |
predicted y |
|
ID_001 |
|
|
ID_002 |
|
|
ID_003 |
|
|
ID_004 |
|
|
ID_005 |
|
|
ID_006 |
|
|
ID_007 |
|
|
ID_008 |
|
|
ID_009 |
|
|
ID_010 |
|
|
ID_011 |
|
|
ID_012 |
|
|
ID_013 |
|
|
ID_014 |
|
|
ID_015 |
|
|
ID_016 |
|
|
ID_017 |
|
|
ID_018 |
|
|
ID_019 |
|
|
ID_020 |
|
|
ID_021 |
|
|
ID_022 |
|
|
ID_023 |
|
|
ID_024 |
|
|
ID_025 |
|
|
ID_026 |
|
|
ID_027 |
|
|
ID_028 |
|
|
ID_029 |
|
|
ID_030 |
|
2
MMIS 671: Final Exam, Fall 2025