联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2019-01-17 10:42

CMPSCI 383 – Fall 2018

Homework 5 Extra Credit

Due Wednesday 12/12/2018 at 11:59pm

If too much is never enough, you can implement the following for extra credit. Each extra credit

task will be worth 25% of a homework assignment.

EC Task 1: Using the training data file, implement the Apriori association rules algorithm for use

with the congressional voting data. The original paper is probably the most helpful for

implementation details; note that it outlines other algorithms as well.

Your program should be executable from the command line, with a corresponding file named

“Apriori.java” or “apriori.py”, and should take a filename and a minimum support parameter on

the command line. For example:

%> python apriori.py /path/to/congress_train.csv 19

For this exercise, consider rules concerning with positive “Yea” votes as making up a frequent

item set. You program should output a series of rules, one per line, like so:

3 -> 29

19, 28 -> 16

24, 31, 40 -> 33

Where the numbers are the column indices in the training file (starting with 0).

EC Task 2: Using the training data file, implement the PC structure learning algorithm (there’s

some background on slides 37-47 that we didn’t cover in class in the notes from lecture 10; it’s

also described on slide 45 here). Your program should conduct hypothesis tests using the

chi-square statistic to determine conditional independence (you are welcome to use a stats

library such as scipy for these calculations).

Your program should be executable from the command line, with a corresponding file named

“Pc.java” or “pc.py”, and should take a filename and an alpha parameter value on the command

line. For example:

%> java Pc /path/to/congress_train.csv 0.01

You should output the “skeleton” of the system as a series of edges, one per line (you do not

need to orient the edges):

19 - 42

22 - 25

22 - 28

Again, the numbers here should correspond to the column indices found in the training file

(starting with 0 for the first column).


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp