首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
C++/Java编程讲解、辅导Python留学生程序 辅导Database|讲解SPSS
项目预算:
开发周期:
发布时间:
要求地区:
School of Computer Science
The University of Adelaide
Artificial Intelligence
Assignment 3
1. Introduction
This assignment has two parts: Probability Graph Model (Section 2) and Part-of-Speech Tagging (Section 3). Both
UG and PG students need to finish both parts. In part one, you are expected to perform approximate inference on
a given PGM using C++/Java/Python and submit the codes to the Web Submission system. In part two, you are
expected to provide your work for the required computation in a pdf and submit the pdf in MyUni, Assignment 3.
2. Probability Graph Model (10 marks)
Your task is to perform approximate inference on a probabilistic graphical model (PGM) of Boolean random
variables using likelihood weighted sampling, as described in lecture. You will work on two networks (Burglar and
Fire). The networks and example queries are provided in the textual files attached on MyUni and will be described
in the later section.
2.1 The task
You need to write a program (C++/Java/Python) to parse the input file of network and to create and populate an
internal data structure of the PGM. The program also need to parse the input query file correctly and evaluate the
conditional probability distribution of the query variable, given the evidence. The result must be written as two
decimal values corresponding to the values of P(QueryVar=true|...) and P(QueryVar=false|...) onto the standard
output stream, separated by white space. For example:
0.872 0.128
Note that if you write anything else before these two numbers, automark will interpret that output as the answer,
almost certainly resulting in a test failure.
2.2 File Format
The format of the network file is:
N
rv0 rv1 ... rvN-1
0 0 1 ... 0
1 0 0 ... 1
...
0 1 1 ... 0
mat0
mat1
...
matN-1
N is the number of random variables in the network;
rv* are the random variable names (arbitrary alphanumeric strings);
The matrix of zeros and ones specifies the directed arcs in the graph; a ‘1’ in the (i, j) entry indicates there
is an edge from i to j, so the i-th variable is a parent of the j-th variable.
mat are two dimensional arrays of real numbers (in ASCII) that specify the conditional probability table of
each random variable conditioned on its parents; If a node has m parents, then the matrix needs to specify
the probability of each outcome (true, false) conditioned on 2m different combinations of parent values, so
the matrix will be 2
m x 2 (rows x columns). Treating true as 1, and false as 0, concatenate the values of the
parents in their numerical order from most significant bit to least significant bit (left to right) to create a
row index r. The entry in the first column, r-th row is then the probability that the variable is true given the
values of the other variables (the entry in the corresponding 2nd column is the probability that the variable
is false). Thus, the first row of the matrix corresponds to all conditioning variables taken the value false (r
= 000… 0), and the last row has all conditioning variables true (r = 111 …1).
For example if the variable A has parents C and F where C is the 3rd variable specified and F is the 6th, then
C,F = 00, 01, 10, 11 correspnd to row r = 0, 1, 2, 3 of the table. The CPT entries for P(A|C,F) entries will be:
The format of the query file is:
P(rvQ | rvE1=val, rvE2=val, ...)
where rvQ is the name of the query variable, and rvEx are the names of the evidence variables with their respective
true/false values specified.
2.3 Deliverables
Implement random forest for wine quality prediction in either C/C++, Java or Python.
C++. In the case of C/C++, you must supply a makefile (Makefile) with a rule called inference to compile your
program into a Linux executable named inference.bin. Your program must be able to be compiled and run as follows:
$ make inference
$ ./inference.bin [graphfile] [queryfile]
JAVA. In the case of JAVA, you must write your program in the file inference.java. Your program must be able to be
compiled and run as follows:
$ javac inference.java
$ java inference [graphfile] [queryfile]
Python. In the case of Python, write you program in the file inference.py. Your program must be able to be run as
follows:
$ python inference.py [graphfile] [queryfile]
At the moment, only an older version of Python (version 2.7.5) is supported on the school servers. If you are not
familiar enough with this version of Python, PLEASE DO NOT USE PYTHON for the assignment.
1.3 Expected run time
Your program must be able to terminate within 1 minutes on the server.
1.4 Web Submission Instructions
You must submit your program on the Computer Science Web Submission System. This means you must create the
assignment under your own SVN repository to store the submission files.
The SVN key for this submission is
2021/s1/ai/assignment3
The link to the Web Submission System used for this assignment is:
https://cs.adelaide.edu.au/services/websubmission/
After submit your codes through SVN, navigate to 2021, Semester 1, Artificial Intelligence, Assignment 3 (for COMP
SCI 3007 7059 students). Then, click Tab “Make Submission" for this assignment and indicate that you agree to the
declaration. The automark script will then evaluate your codes.
1.5 Assessment
Your code will be compiled and run, testing its outputs for the two networks with several queries each. Two example
queries have been provided to you. Since the results are stochastic, the query answers will not be exact and will
vary from run to run. The answers will therefore be tested against a tolerance of ±1 (i.e. your answers must be
within 1% of the true values), so you must ensure convergence to this level of precision (by giving more samples).
If it passes all tests you will get 10% of the overall course mark. The objective of the tests is to check for the correct
operation of your implementation. Hence, the basis of the assessment is to compare your results against the
expected results.
Although it is an auto-assessment, I will randomly pick up some codes to check manually.
3. Part-of-Speech Tagging – Viterbi (5 marks)
In this part, you will do POS tagging via Viterbi algorithm for the sentence Janet will back the bill. This is the example
in our lecture and also in the textbook here (https://web.stanford.edu/~jurafsky/slp3/8.pdf).
The transition probabilities computed from the WSJ corpus without smoothing are in the table below. Rows are
labelled with the conditioning event; e.g., P( VB |MD ) is 0.7968.
The Observation likelihoods computed from the WSJ corpus without smoothing are in the following table:
The computation for the three columns are shown in the following figure:
3.1 The task
In this task, you need to calculate v3(3). Note that the computation of v1(1) to v1(7) and v2(2) are provided in the
lecture slides and the textbook. To compute v3(3) you first need to compute v2(1), v2(3), v2(4) ,v2(5), v2(6), v2(7).
For PG students, you need to further calculate v4(7). Note that to compute v4(7), you need to know v3(1) to v3(7).
3.2 Deliverable
You will provide your exact working for the computation of v2(1), v2(3), v2(4) ,v2(5), v2(6), v2(7) and v3(3) into a
report in pdf format. You need to write the detailed process and the results. Using equations provided by your text
editor. Hand-written equations (e.g., in image format) will not be marked.
Please submit the pdf to MyUni, Assignment 3
3.3 Assessment
Use correct equation, correct value to compute, and get correct results.
UG: 5 marks for v3(3), include intermediate results
PG: 2 marks for v3(3), 3 marks for v4(7), include intermediate results.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!