CSCI 479 -- Machine Learning
Spring 2026 - Assignment 3
Submit deadline: 10:00, 6 March 2026, Friday
Problem Description:
The data set used in this assignment comes from the Car Evaluation Data Set
that is available at http://archive.ics.uci.edu/ml/datasets/Car+Evaluation.
The data set is donated by its creator Marko Bohanec at 1997.
The data set used in this assignment is stored in the csv file
CarData.csv. There are 1728 instances in this
data set.
There are 6 descriptive attributes in this data set:
- BUY: the buying price, with domain {vhigh, high, med, low}.
- MAINT: the maintenance price, with domain {vhigh, high, med, low}.
- DOORS: the number of doors, with domain {2, 3, 4, 5more}.
- PERSONS: the capacity in terms of persons to carry, with domain {2, 4, more}.
- LOG_BOOT: the size of luggage boot, with domain {small, med, big}.
- SAFETY: the estimated safety of the car, with domain {low, med, high}.
The target attribute, EVALUATION, provides a description of the car's value
as unacceptable (unacc), acceptable (acc), good (good), or very good (vgood).
Your tasks:
Overall, your task is to build a Naive Bayes Classifier.
Specifically, you need to perform the following tasks and
document the process along the way:
- Generate and store all the probabilities that will be used by your
Naive Bayes Classifier based on the given data in
CarData.csv. If any of these probabilities is 0,
use Laplace smoothing algorithm wih k=2 to smooth the noises.
(You can use Your Lab 4 program and result with the extension
of Laplace smoothing if needed.)
- Design and implement the Naive Bayes Classifier, and generate
the class labels for each data item that's in the training
data set CarData.csv, regardless what
target class label the data item actually has. Save your
predication result to a csv or text file.
- Implement a program to compare the class labels generated by
your Naive Bayes Classfier and their given class labels, and fill
the following table with corresponding counts or percentages:
| |
Your Result |
| unacc |
acc |
good |
vgood |
| Given Result |
unacc |
|
|
|
|
| acc |
|
|
|
|
| good |
|
|
|
|
| vgood |
|
|
|
|
What to Submit:
Submit a document that explains the whole process
of building, applying and evaluating the Naive Bayes Classifier
using the given Car Data set. Your document should
include at least the following sections:
- Explain how all the necessary probabilities used later in the Naive
Bayes Classifier are generated from the Car Data set. Present
these probabilities in the document in a format that's easy
to understand and interpret. Attach either the souce code file
or the algorithm used to generate these probabilities as an appendix file.
- Explain how to predict the class label for each data object
in the given data set, that is, explain how your Naive Bayes
Classifier works. Attach either the source code file or the algorithm
to make the prediction as an appendix file. Also attach the prediction
result as an appendix file. The prediction result should be presented
in a format that's easy to understand in the attached result file.
- Compare your prediction result with the given class label result.
Present the comparison conclusion in a tabular format in the document.
Attach the source code file or the algorithm used to do
the comparison as an appendex file.
How to submit:
Choose one of the following two ways to submit your work:
- Login to your VIU Learn account,
find the CSCI 479 course page, click on the "Assessment"
drop-down menu, click on the "Assignments" item, then click on
the folder named "A3". Then you can click on the "Add a File"
button to browse and upload your document and appendix files.
- On csci server, in the directory that holds all of your assignment
solution files, enter the command
~liuh/bin/submit 479 A3 .
This submit script currently accepts files with the names
of *.pdf, *.txt, *.csv, *.h, *.cpp, *.py, makefile.
If you need to submit any file with different extension names,
please contact your instructor before submitting.
Last updated: February 3, 2026