首页 新闻 聚焦 科技 财经 创业 综合 图片 视频

IT界

旗下栏目: 行业 生态 IT界 创新

讲解INT104编程设计、Python,CSS

来源:互联网 发布时间:2021-04-04
讲解INT104编程设计、Python,CSS
INT104: Artificial Intelligence Spring 2021
Lab 4: Linear Algebra and Probability
Disclaimer: 1. Lab reports deadlines are strict. University late submission policy will be applied.
2. Collusion and plagiarism are absolutely forbidden (University policy will be applied).
3. Report is due 14 days from the date of running this lab
4.1 Objectives
• Solve the general Problems on linear algebra and probability knowledge.
4.2 Problem Statement
Given a two-dimensional array, where each row represents an instance (or object). For each row, the first 5
columns are the attributes of the instance and the final column is the label of the instance such as
a0, a1, a2, a3, a4, l
As you’ve seen, all attributes can take two values 0 or 1.
4-1
4-2 Lab 4: Linear Algebra and Probability
Now you’re required to compute the following estimated probabilities: p(l = 0), p(l = 1), p(ai = 0|l =
0), i = 0, 1, 2, 3, 4 and p(ai = 1|l = 0), i = 0, 1, 2, 3, 4, p(ai = 0|l = 1), i = 0, 1, 2, 3, 4 and p(ai = 1|l = 1), i =
0, 1, 2, 3, 4.
4.3 Lab Report
• Write a short report which should contain a concise explanation of your implementation, results and
Observations (see the coursework template).
• Please insert the clipped running image into your report for each step with the mark.
• Submit the report and the python source code electronically into ICE.
• The report in pdf format and python source code of your implementation should be zipped into a single
file. The naming of report is as follows:
e.g. StudentID LastName FirstName LabNumber.zip (123456789 Einstein Albert 1.zip)
Hints: 1) use the Fraction of the Given events in all instances to estimate the probabilities (N is the total
number of the instances and # is the size of the set).
Lab 4: Linear Algebra and Probability 4-3
p(l = 0) = #{l = 0}
N
(4.1)
p(ai = 0|l = 0) = #{ai = 0, l = 0}
#{l = 0}
(4.2)
p(l = 1) = #{l = 1}
N
(4.3)
p(ai = 0|l = 1) = #{ai = 0, l = 1}
#{l = 1}
(4.4)
2) read the data from the file.
import csv
csv_file = open(’binary_data.csv’)
csv_reader = csv.reader(csv_file, delimiter=’,’)
Marking scheme:
• Read the text file and parse its content into a matrix. (20 scores)
• Compute the prior probabilities p(l = 0) and p(l = 1) (20 scores)
• Compute the Conditional probabilities p(ai = 0|l = 0), i = 0, 1, 2, 3, 4 and p(ai = 1|l = 0), i = 0, 1, 2, 3, 4,
p(ai = 0|l = 1), i = 0, 1, 2, 3, 4 and p(ai = 1|l = 1), i = 0, 1, 2, 3, 4 (60 scores)
 
请加QQ:99515681 或邮箱:99515681@qq.com   WX:codehelp
  免责声明:珠穆朗玛网对于有关本网站的任何内容、信息或广告,不声明或保证其正确性或可靠性,用户自行承担使用网站信息发布内容的真假风险。
责任编辑:珠穆朗玛网