Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Module 2A: Assignment
Weightage: 30 Marks
Assessment task:
You are recent hire that works at a start-up AI image company. Your new job requires several tasks to support the different teams of the company. Your first task is implemented an AI knowledge-based
system to help customers with some of the terminology of AI. Some of the terminology is simple, i.e. names and years of famous AI events, but other terminology needs to be more detailed. In addition,
the new business has been receiving malware, so your second task is write a filter that can detect the malware from genuine software. Lastly, many customers of the company provide images that
require further post processing, your final task is to write an algorithm that can find portion of pixels within a single colour space. For example, it may be useful to identify one colour of pixels versus
another, as in black and white photographs.
If successful, the company will put your applications in productions for customers. You will therefore need to provide detailed comments in the code explaining the steps you have taken to design your
solution. As deliverables, you will complete the following three (3) parts:
Parts
1. Programming Part 1: Write a programme that accesses a AI knowledge-base to search for facts based on the user's input.
2. Programming Part 2: Write a programme that specifies the level of confidence in malware detection.
3. Programming Part 3: Write a programme that implements the flood fill algorithm, identifys and changes the marked pixels.
Instructions:
1. Complete all three parts of the assignments by write the Python codes.
2. Run your codes to ensure that the required outputs are delivered.
3. Submit the assignment for grading and to get feedback.
Programming Part 1: Create an AI History/Definition knowledge-based system
Assessment task:
Write a programme that accesses a AI knowledge-base to search for facts based on the user's input. There are 4 steps involved, you will complete the code for step 1 and 4 only.
Marks:
This part is worth 10 Marks. This part is divided by three assessments (3 marks, 4 marks, 3 marks).
Instructions:
1. Write your Python code in place of "your code here" placeholder below.
2. Run your code by clicking on 'run' cell in the toolbar before you submit.
3. You will get the feedback once you submit the assignment.
Submission:
Click on the submit button on the top right after you run the code.
Step 1
Read through the AI text book for this course and gather facts for the AI knowledge-based system.
1. Write at least five about either the history or provide definition in regards to Artifical Intelligence.
2. At least one fact needs to integer number, at least one fact needs to string and at least one fact needs to a list.
3. One fact needs to be defind as 'turing-test-proposed-year' i.e. in what year was the turing test proposed (Check module 1).
Step 2
Applications runs only while the running variable is 'true' which is written below.
Step3
The below code delivers a friendly message to the user by printing 'Hi, I'm an AI History/Definition Knowledge based system'.
Hi, I'm an AI History/Definition Knowledge based system
Step 4
Write the code to a. Ask the user to enter his/her facts that may or may not be in the facts (the system should be able to handle inquiries that are not in the facts database). b. After getting the user-
input, write the code to match the facts with the knowledge base that was defined above for three step 1. c. Inform the user about the identifed fact and the report back the findings.
What would you like to know?
definition of ai
Artificial Intelligence is defined as the ability of a digit computer or robot to perform tasks that the intelligent beings conduct. It is used to automating manual and
repetitive tasks
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
/var/folders/zl/qk8rctjx0x107swqndlw35_h0000gn/T/ipykernel_75389/582220439.py in
8 ###
9 while running:
---> 10 question_asked = str(input('What would you like to know? \n')).lower()
11
12 if 'definition' in question_asked \
~/opt/anaconda3/lib/python3.9/site-packages/ipykernel/kernelbase.py in raw_input(self, prompt)
1175 "raw_input was called, but this frontend does not support input requests."
1176 )
-> 1177 return self._input_request(
1178 str(prompt),
1179 self._parent_ident["shell"],
~/opt/anaconda3/lib/python3.9/site-packages/ipykernel/kernelbase.py in _input_request(self, prompt, ident, parent, password)
1217 except KeyboardInterrupt:
1218 # re-raise KeyboardInterrupt, to truncate traceback
-> 1219 raise KeyboardInterrupt("Interrupted by user") from None
1220 except Exception:
1221 self.log.warning("Invalid Message:", exc_info=True)
KeyboardInterrupt: Interrupted by user
Programming Part 2: Malware Detection Bayesian Network
Write a programme that specifies the level of confidence in malware detection.
Assessment task:
In this Part 2, you'll write the code that specifies the level of confidence in malware detection. The programme consists of many steps that are partially written.
Marks:
This part is of 10 Marks. This part is divided by fives assessments (2 marks each).
Instructions:
1. Write your Python code in place of "your code here" placeholder below.
2. Run your code by clicking on 'run' cell in the toolbar before you submit.
3. You will get the feedback once you submit the assignment.
Submission:
Click on the submit button on the top right after you run the code.
Step 1
Import the pomegranate library.
Step 2
Define the probabilities for code.
Define the probabilities for resize.
Define the probabilities for signature
Define the probabilities for outcome
Step 3
Create the Bayesian Network.
Add the states to the network
Add the edges
Train the model
Step 4
Define probabilities with values that need to overwritten by the model
Calculate a probability that is less that 0.01 for a given observation (assign to low_probability)
0.005700000000000001
True
Calculate a probability that is less than 0.1 but greater than 0.01 for a given observation (assign to medium_probability)
0.020999999999999994
True
Calculate a probability that is greater than 0.1 for a given observation (assign to high_probability)
0.12600000000000003
True
Calculate predictions based on the evidence that is less than 0.5 and assigned it to low_probability_prediction.
0.19750000000000015
True
Calculate predictions based on the evidence that is greater than 0.8 and assigned it to high_probability_prediction.
0.8049999999999998
True
Part 3
Write a programme that implements the flood fill algorithm, identifys and changes the marked pixels. Furthermore, blank pixels are ignored.
Assessment task:
In this part, you'll write the code that implements the flood fill algorithm, identifys and changes the marked pixels. Furthermore, blank pixels are ignored. To do this, you'll use any breadth first search
algorithm. The code is partially written below.
Marks:
This part is of 10 Marks. This part is divided by two assessments (5 marks each).
Instructions:
1. Write your Python code in place of "your code here" placeholder below.
2. Run your code by clicking on 'run' cell in the toolbar before you submit.
3. You will get the feedback once you submit the assignment.
Submission:
Click on the submit button on the top right after you run the code.