精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕

代寫(xiě)CSC 330、代做C/C++編程語(yǔ)言
代寫(xiě)CSC 330、代做C/C++編程語(yǔ)言

時(shí)間:2024-04-03  來(lái)源:  作者: 我要糾錯(cuò)



CSC 330 Programming Languages
Project
Note 1 This project is to be done individually
Note 2 Working with other people is prohibited.
Note 2 Sharing queries or files with other people is prohibited.
A note on Academic Integrity and Plagiarism
Please review the following documents:
• Standards for Professional Behaviour, Faculty of Engineering:
https://www.uvic.ca/engineering/assets/docs/professional-behaviour.pdf
• Policies Academic Integrity, UVic:
https://www.uvic.ca/students/academics/academic-integrity/
• Uvic’s Calendar section on Plagirism:
https://www.uvic.ca/calendar/undergrad/index.php#/policy/Sk_0xsM_V
Note specifically:
Plagiarism
Single or multiple instances of inadequate attribution of sources should result in a failing grade
for the work. A largely or fully plagiarized piece of work should result in a grade of F for the
course.
Submissions will be screened for plagiarism at the end of the term.
You are responsible for your own submission, but you could also be responsible if somebody plagiarizes
your submission.
1 Objectives
After completing this project, you will have experience:
• Programming Functionally
• Basket analysis in big datasets using the A-priori algorithm
2 The A-priori algorithm
The A-priori algorithm is used to identify commonly found groups of items in basket analysis. For example,
if you buy milk, what other item are you likely to buy?
The input file to this algorithm will be a CSV file. Each CSV file is a set of transactions, one per line. A
transaction is a set of items sold together (each item is separated by a delimiter character). A transaction is
guaranteed to have no duplicate items.
1
Our goal is to identify pairs of items that are sold together above certain minimum threshold. A minimum
support threshold is the minimum proportion of transactions an item should appear in order to be be part of
the output (we will call these popular items).
The A-priori algorithm is relatively simple. Assume that i is the number of different items in the dataset,
and n is the number of popular items. Using dictionaries as the main data structure, the memory requirements
for this algorithm are O(max(n
2
, i)) irrespectively of the size of the input (which can be much larger than
the available memory). To accomplish this, the algorithm does two passes on the input data.
• First pass. In the first pass of all transactions, a dictionary of popular items is computed. This dictionary will have as its key the item name, and as its value its frequency (number of transactions where
the item appears). After all transactions are read, compute the minimum support (an integer computed
by multiplying the minimum support threshold by the number of transactions, truncating this number,
i.e. floor). Return a dictionary that contains only the popular items. The result of the first pass is a
dictionary that contains only popular items.
• Second pass. Read the transactions again. This time keep a counter of popular pairs of items. The key
will be the pair of items (item1, item2). The frequency is symmetric, freq(item1, item2) = freq(item2,
item1). For this reason the dictionary should keep only one copy per pair (e.g. order them such
that given item1, item2, the key to the dictionary is always (min(item1,item2), max(item1,item2)).
Return a dictionary that contains only the popular pairs of items. The result of the second pass is a
dictionary that contains only popular pairs of items.
• Report the results. Using the two dictionaries, print a table with the results. See below for details.
Note that some CSV files use ’,’ and some ’;’ as a separator.
3 Your task, should you choose to accept it
Implement 3 functions that implement the 3 steps of the A-priori algorithm
3.1 Preliminaries: how to run your program
Your program is run with the following arguments. See the Makefile for the specifics of how to compile and
run the program. You will find in the Makefile 4 test cases.
<filename> <delimiter> <MinimumSuportThreshold> <linesToPrint>
• filename. A CSV delimited file. One record per line. You can assume there are no duplicates in a
record.
• delimiter. A one character string that indicates the separator between items in a record. Use quotes
around it to avoid the shell to interpret the character.
• MinimumSuportThreshold. The minimum support threshold that an pair should have to be part of the
output (between 0 and 1)
• linesToPrint. Print at most this number of items. If the result has more frequent items than this
number, print only this number of pairs.
2
For example, the command:
./apriori online.csv ’,’ .01 10
uses the file online.csv with delimiter , (comma) and minimum support threshold of 0.01 and requests to print at most the first 10 items.
3.2 Implementation details
Download from Gitlab the tar file. It contains several files. You will only modify and submit apriori.ml.
Note that this file defines a module that must match the signature provided.
Your job is to implement 3 functions:
3.3 First Pass
let do_first_pass ((threshold: float),
(lines: in_channel),
(delim: char)): first_pass_result =
This function takes three parameters:
1. threshold: The minimum threshold (between 0 and 1),
2. lines: a input stream from where to read the lines,
3. delim: the delimiter of the items in each line (a char).
Read the stream with the function input line. Note that this function generates an exception (that
you must handle) when the end of file is reached.
do first pass should return a record with 3 values (see apriori.ml for the definition of the record):
1. the number of transactions in the stream,
2. the minimum support (i.e. the minimum number of times a frequent item should appears), and
3. the dictionary of the frequent items with their corresponding frequency.
To compute the minimum support truncate the floating point number to an integer. The dictionary should
contain only items with at least this support.
3.3.1 Second Pass
let do_second_pass((support: int),
(popItems: items_dict),
(lines: in_channel),
(delim:char)): pairs_dict =
This function takes 4 parameters:
3
1. support: the minimum support (an integer),
2. popItems: the dictionary of frequent items,
3. lines: the input stream with the transactions,
4. delim: the delimiter (a char)
It should return a dictionary that contains the popular pairs equal or above the minimum support threshold and their corresponding frequency.
3.4 print table
let print_table((nTransactions: int),
(popItems: items_dict),
(popPairs: pairs_dict),
(toPrint:int)):int =
This function prints a table with the popular pairs, and some extra information. It takes 4 parameters:
1. nTransactions is the number of records in the file (result of first pass).
2. popItems is the popular items (result of the first pass),
3. freqPairs is the list of popular pairs (result of the second pass).
4. toPrint: print at most a given number of pairs.
The columns of these report are:
• Support of the pair: the proportion of transactions that have this pair.
• The item name.
• The frequency of this item. Number of transactions where this item appears.
• The support of this item. The proportion of transactions that include this item.
• The other item in the pair.
• The frequency of this pair. Number of transactions where this pair appears.
• Confidence: the support of the pair divided by the support of other item. This number represents the
proportion of transactions of the second item where the first item appears. When it one it means that
every time the second item appears, the first also appears.
• Lift. The support of the pair divided by the product of the support of both items.
Running with parameters: Filename [./data/online.csv] Separator [,] Minimum relative support threshold
[0.01] and Print at most 10 tuples.
4
SuppPair-Item - Freq- Support-With - FreqPair- Conf. - Lift
0.010887 regency tea plate green 386 0.014902 regency tea plate pink 282 0.898 60.265
0.010501 regency tea plate roses 457 0.017643 regency tea plate pink 272 0.866 49.097
0.012431 regency tea plate roses 457 0.017643 regency tea plate green 322 0.834 47.281
0.010887 wooden star christmas scandinavian 515 0.019883 wooden tree christmas scandinavian 282 0.832 41.838
0.013512 set/6 red spotty paper plates 527 0.020346 set/6 red spotty paper cups 350 0.818 40.193
0.024863 green regency teacup and saucer 1057 0.040808 pink regency teacup and saucer 644 0.804 19.702
0.010154 poppy’s playhouse kitchen 440 0.016987 poppy’s playhouse livingroom 263 0.797 46.916
0.010115 poppy’s playhouse bedroom 426 0.016447 poppy’s playhouse livingroom 262 0.794 48.274
0.013512 small dolly mix design orange bowl 528 0.020385 small marshmallows pink bowl 350 0.781 38.326
0.012354 bathroom metal sign 709 0.027372 toilet metal sign 320 0.780 28.514
Number items printed: 10
Number transactions: 25902
Number popular items: 592
Number popular pairs: 746
The results should be ordered according to (think order by in SQL):
1. confidence descending,
2. lift descending,
3. item frequency descending,
4. item name, ascending,
5. item name it appears with, ascending.
Use these bindings to format the output (they are defined in apriori.ml):
let lineTitleFormatString = format_of_string
" SuppPair-%s - Freq- Support-%s - FreqPair- Conf. - Liftn"
let lineDataFormatString = format_of_string
"%9.6f %s %6d %8.6f %s %6d %9.3f %9.3fn"
These work in the same way than printf in C. Use Note that the columns for both items (%s) do not
have a width specification. This is because their width will be dynamically computed. The width of each of
the columns is the maximum width of any of the corresponding items to be printed (but cannot be less than
10 characters).
3.5 Tests
The files you downloaded contain several tests. The directory expected contains the expected output. The
directory data contains four datasets. See the Makefile to understand how to run the program and generate
each output. Use diff to compare your output to the expected one (see Makefile).
Your program’s output should be identical to the expected output for the same command line and input
dataset.
3.6 Dictionaries
The dictionaries used in this assignment are non-mutable. As with our assignments, when we insert or delete
from a dictionary, a new dictionary is created. Unfortunately it means that to update a value, you have to
remove it and insert it again. The dictionaries are defined in the file dicts.ml.
To create a dictionary of type ItemMap use Dicts.ItemMap.empty.
To find a value in a dictionary use Dicts.ItemMap.add key value dictionary.
To remove a value use Dicts.ItemMap.remove key dictionary. Both functions are curried.
5
3.7 Grading
The grading is divided into 3 parts:
• First pass: 30%
• Second pass: 30%
• Report: 40%
Your functions will be tested one at a time, using the signature provided.
Your program will be tested in Linux.csc.uvic.ca. Make sure it compiles there. If your program does not
compile, it will receive a zero.
If your program generates any warnings, it will receive a zero.
3.8 Hints
1. The algorithm is relatively straightforward, most of the code you will write is to parse the input and
to format the output.
2. Do not read the stream more than once per pass, because you function might run out of memory.
This means you need to compute its length as you are processing it.
3. Be careful with the output. Your program’s output should match byte-by-byte the expected output.
4. For anything not precisely specified here, see expected output and check/ask in brightspace. There
will a forum to discuss the assignment.
3.9 Other information and restrictions
Violating any of the following restrictions will result in a grade of zero:
1. No mutation.
2. The input stream should not be processed more than once in each function.
3. Your functions should read only one line at a time. You cannot read the entire input stream to
memory.
You can share test cases with others but you are forbidden from sharing source code.
4 What to submit
Submit, via Brigthspace:
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp














 

標(biāo)簽:

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇: CISC3025代寫(xiě)、代做c++,Java程序設(shè)計(jì)
  • 下一篇:CSC3150代寫(xiě)、Java/C++程序語(yǔ)言代做
  • 無(wú)相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲(chóng)
    油炸竹蟲(chóng)
    酸筍煮魚(yú)(雞)
    酸筍煮魚(yú)(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚(yú)
    香茅草烤魚(yú)
    檸檬烤魚(yú)
    檸檬烤魚(yú)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗(yàn)證碼平臺(tái) 理財(cái) WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕
    <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
    <ul id="e4iaa"></ul>
    <blockquote id="e4iaa"><tfoot id="e4iaa"></tfoot></blockquote>
    • <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
      <ul id="e4iaa"></ul>
      <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp><ul id="e4iaa"></ul>
      <ul id="e4iaa"></ul>
      <th id="e4iaa"><menu id="e4iaa"></menu></th>
      国产污污视频在线观看| 欧美色视频一区二区三区在线观看 | 性高潮久久久久久久久久| 亚洲激情视频小说| 国产呦小j女精品视频| 五月天婷婷激情| 国产日韩久久久| 中文字幕电影av| 精人妻无码一区二区三区| 中文字幕日韩综合| 九九热精品在线播放| 亚洲视频在线a| 日韩 欧美 亚洲| 人妻少妇精品无码专区久久| 国产免费一区二区三区四区| 国产高清免费av| 国产一区二区播放| 精品手机在线视频| 欧美福利视频一区二区| 欧美卡一卡二卡三| 日韩一区二区三区不卡视频| 日本免费一区视频| 无码精品人妻一区二区| 在线观看av网页| 亚洲国产精品免费在线观看| 91禁男男在线观看| 高清一区在线观看| 国产一区二区视频网站| 精品无码黑人又粗又大又长| 蜜臀av午夜精品久久| 免费a级黄色片| 日韩在线不卡av| 中文字幕69页| www.com黄色片| 国产视频1区2区| 欧美黄色一级大片| 伊人网av在线| 成人免费看片98欧美| 好吊日在线视频| 日韩女优一区二区| 夜夜爽久久精品91| 国产无人区码熟妇毛片多| 好吊日在线视频| 日韩免费av一区| 亚洲一区二区三区四区五区| 国产性一乱一性一伧一色| 欧美a∨亚洲欧美亚洲| 中文字幕一区二区在线视频| 丁香社区五月天| 麻豆成人在线视频| 中文字幕av久久爽| 国产精品久久欧美久久一区| 日本综合在线观看| 成人av无码一区二区三区| 欧美三级午夜理伦| 成人小说亚洲一区二区三区| 欧美一区二区三区成人片在线| 五月婷婷免费视频| 国产三级小视频| 中文av字幕在线观看| 精品无码久久久久| 亚洲激情视频小说| 久久福利免费视频| 亚洲影院一区二区三区| 久久精品一卡二卡| 亚洲一二三四五| 蜜臀av免费观看| 99久久久久久久久| 婷婷六月天在线| 六月丁香在线视频| 国产美女免费无遮挡| 中字幕一区二区三区乱码| 国产无套精品一区二区三区| 这里只有久久精品视频| 精人妻一区二区三区| 毛片基地在线观看| 亚洲精品无码久久久久| 成人精品在线看| 天天干天天干天天干天天| 国产亚洲欧美精品久久久久久| 午夜一区二区视频| 久久精品无码人妻| 国产高清视频网站| 亚洲天堂视频网| 天堂av免费在线| 国产区精品在线| av在线免费观看不卡| 青青青视频在线免费观看| www视频在线| 亚洲精品天堂网| 色欲欲www成人网站| 久久人妻少妇嫩草av蜜桃| 国产伦精品一区二区三区四区| 亚洲一区 中文字幕| 亚洲v在线观看| 午夜免费福利视频在线观看| 色婷婷av一区二区三区之e本道| 精品无码一区二区三区蜜臀 | 97精品人妻一区二区三区在线 | 色婷婷久久综合中文久久蜜桃av| 国产无套精品一区二区三区| av噜噜在线观看| 99国产精品久久久久久久成人| 亚洲视频 中文字幕| 在线观看中文字幕网站| 亚洲av无码精品一区二区| 天天操天天爽天天干| 深爱五月激情五月| 婷婷久久久久久| 亚洲 美腿 欧美 偷拍| 香蕉国产在线视频| 中文字幕欧美人妻精品| 中文字幕色网站| 亚洲国产精品免费在线观看 | 天天干天天操天天拍| 少妇网站在线观看| 婷婷色在线观看| 亚洲国产精品欧美久久| 亚洲欧洲精品视频| 97超碰国产在线| 国产吃瓜黑料一区二区| 精品丰满少妇一区二区三区| 免费在线观看黄网站| 香蕉视频国产在线| av黄色一级片| 精品国产亚洲av麻豆| 男人的天堂最新网址| 天天av天天翘| 亚洲永久精品ww.7491进入| 91麻豆精品国产91久久综合| 国产精品国产精品国产| 久草视频精品在线| 人妻体内射精一区二区| 一区二区三区免费观看视频 | www欧美激情| 精品一区在线视频| 午夜av中文字幕| 国产激情在线免费观看| 免费精品一区二区| 天天干天天舔天天射| 亚洲精品视频三区| 国产一级视频在线观看| 色呦色呦色精品| 成人午夜视频在线播放| 男女男精品视频站| 一级片在线免费观看视频| 九九在线观看视频| 亚洲男女视频在线观看| 国产三级小视频| 五月天婷婷导航| 国产美女www爽爽爽| 天天操天天干天天摸| 国产精品suv一区二区88| 日本美女一级视频| 草久视频在线观看| 少妇精品无码一区二区| 国产女18毛片多18精品| 午夜精品一区二| 精品人妻一区二区三区蜜桃视频| 色欲无码人妻久久精品| 国产 日韩 欧美 综合| 日日骚一区二区三区| 国产专区第一页| 91禁男男在线观看| 日本一区二区三区网站| 国产极品一区二区| 亚洲精品午夜国产va久久成人| 噜噜噜久久,亚洲精品国产品| 91麻豆精品国产91久久综合| 欧美精品久久久久性色| av无码av天天av天天爽| 日本加勒比一区| 国产资源中文字幕| 成年人三级黄色片| 在线中文字幕网站| 色男人天堂av| 久久丫精品忘忧草西安产品| 999福利视频| 亚洲熟女毛茸茸| 在线一区二区不卡| 日本一二区免费| 黄色av网址在线| 国产精品麻豆一区| 亚洲图片欧美在线| 中文字幕69页| 香蕉免费毛片视频| 五月天婷婷丁香网| 天天干在线播放| 日韩在线视频免费播放| 欧美熟妇乱码在线一区| 国产又粗又黄又猛| 国产成人在线综合| www男人天堂| www.精品视频| av大片在线免费观看| 一级黄色片网址| av在线网站观看| 丰满少妇高潮久久三区 | 欧美一区二区三区成人精品| 久久免费激情视频|