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

COMP 330代做、Python設(shè)計程序代寫

時間:2024-04-02  來源:  作者: 我要糾錯



COMP 330 Assignment #5
1 Description
In this assignment, you will be implementing a regularized, logistic regression to classify text documents. The implementation will be in Python, on top of Spark. To handle the large data set that we will be
giving you, it is necessary to use Amazon AWS.
You will be asked to perform three subtasks: (1) data preparation, (2) learning (which will be done via
gradient descent) and (3) evaluation of the learned model.
Note: It is important to complete HW 5 and Lab 5 before you really get going on this assignment. HW
5 will give you an opportunity to try out gradient descent for learning a model, and Lab 5 will give you
some experience with writing efficient NumPy code, both of which will be important for making your A5
experience less challenging!
2 Data
You will be dealing with a data set that consists of around 170,000 text documents and a test/evaluation
data set that consists of 18,700 text documents. All but around 6,000 of these text documents are Wikipedia
pages; the remaining documents are descriptions of Australian court cases and rulings. At the highest level,
your task is to build a classifier that can automatically figure out whether a text document is an Australian
court case.
We have prepared three data sets for your use.
1. The Training Data Set (1.9 GB of text). This is the set you will use to train your logistic regression
model:
https://s3.amazonaws.com/chrisjermainebucket/comp330 A5/TrainingDataOneLinePerDoc.txt
or as direct S3 address, so you can use it in a Spark job:
s3://chrisjermainebucket/comp330 A5/TrainingDataOneLinePerDoc.txt
2. The Testing Data Set (200 MB of text). This is the set you will use to evaluate your model:
https://s3.amazonaws.com/chrisjermainebucket/comp330 A5/TestingDataOneLinePerDoc.txt
or as direct S3 address, so you can use it in a Spark job:
s3://chrisjermainebucket/comp330 A5/TestingDataOneLinePerDoc.txt
3. The Small Data Set (37.5 MB of text). This is for you to use for training and testing of your model on
a smaller data set:
https://s3.amazonaws.com/chrisjermainebucket/comp330 A5/SmallTrainingDataOneLinePerDoc.txt
Some Data Details to Be Aware Of. You should download and look at the SmallTrainingData.txt
file before you begin. You’ll see that the contents are sort of a pseudo-XML, where each text document
begins with a <doc id = ... > tag, and ends with </doc>. All documents are contained on a single
line of text.
Note that all of the Australia legal cases begin with something like <doc id = ‘‘AU1222’’ ...>;
that is, the doc id for an Australian legal case always starts with AU. You will be trying to figure out if the
document is an Australian legal case by looking only at the contents of the document.
1
3 The Tasks
There are three separate tasks that you need to complete to finish the assignment. As usual, it makes
sense to implement these and run them on the small data set before moving to the larger one.
3.1 Task 1
First, you need to write Spark code that builds a dictionary that includes the 20,000 most frequent words
in the training corpus. This dictionary is essentially an RDD that has the word as the key, and the relative
frequency position of the word as the value. For example, the value is zero for the most frequent word, and
19,999 for the least frequent word in the dictionary.
To get credit for this task, give us the frequency position of the words “applicant”, “and”, “attack”,
“protein”, and “car”. These should be values from 0 to 19,999, or -1 if the word is not in the dictionary,
because it is not in the to 20,000.
Note that accomplishing this will require you to use a variant of your A4 solution. If you do not trust
your A4 solution and would like mine, you can post a private request on Piazza.
3.2 Task 2
Next, you will convert each of the documents in the training set to a TF-IDF vector. You will then use
a gradient descent algorithm to learn a logistic regression model that can decide whether a document is
describing an Australian court case or not. Your model should use l2 regularization; you can play with in
things a bit to determine the parameter controlling the extent of the regularization. We will have enough
data that you might find that the regularization may not be too important (that is, it may be that you get good
results with a very small weight given to the regularization constant).
I am going to ask that you not just look up the gradient descent algorithm on the Internet and implement
it. Start with the LLH function from class, and then derive your own gradient descent algorithm. We can
help with this if you get stuck.
At the end of each iteration, compute the LLH of your model. You should run your gradient descent
until the change in LLH across iterations is very small.
Once you have completed this task, you will get credit by (a) writing up your gradient update formula,
and (b) giving us the fifty words with the largest regression coefficients. That is, those fifty words that are
most strongly related with an Australian court case.
3.3 Task 3
Now that you have trained your model, it is time to evaluate it. Here, you will use your model to predict
whether or not each of the testing points correspond to Australian court cases. To get credit for this task,
you need to compute for us the F1 score obtained by your classifier—we will use the F1 score obtained as
one of the ways in which we grade your Task 3 submission.
Also, I am going to ask you to actually look at the text for three of the false positives that your model
produced (that is, Wikipedia articles that your model thought were Australian court cases). Write paragraph
describing why you think it is that your model was fooled. Were the bad documents about Australia? The
legal system?
If you don’t have three false positives, just use the ones that you had (if any).
4 Important Considerations
Some notes regarding training and implementation. As you implement and evaluate your gradient descent algorithm, here are a few things to keep in mind.
2
1. To get good accuracy, you will need to center and normalize your data. That is, transform your data so
that the mean of each dimension is zero, and the standard deviation is one. That is, subtract the mean
vector from each data point, and then divide the result by the vector of standard deviations computed
over the data set.
2. When classifying new data, a data point whose dot product with the set of regression coefs is positive
is a “yes”, a negative is a “no” (see slide 15 in the GLM lecture). You will be trying to maximize the
F1 of your classifier and you can often increase the F1 by choosing a different cutoff between “yes”
and “no” other than zero. Another thing that you can do is to add another dimension whose value is
one in each data point (we discussed this in class). The learning process will then choose a regression
coef for this special dimension that tends to balance the “yes” and “no” nicely at a cutoff of zero.
However, some students in the past have reported that this can increase the training time.
3. Students sometimes face overflow problems, both when computing the LLH and when computing the
gradient update. Some things that you can do to avoid this are, (1) use np.exp() which seems to
be quite robust, and (2) transform your data so that the standard deviation is smaller than one—if you
have problems with a standard deviation of one, you might try 10−2 or even 10−5
. You may need to
experiment a bit. Such are the wonderful aspects of implementing data science algorithms in the real
world!
4. If you find that your training takes more than a few hours to run to convergence on the largest data set,
it likely means that you are doing something that is inherently slow that you can speed up by looking
at your code carefully. One thing: there is no problem with first training your model on a small sample
of the large data set (say, 10% of the documents) then using the result as an initialization, and continue
training on the full data set. This can speed up the process of reaching convergence.
Big data, small data, and grading. The first two tasks are worth three points, the last four points. Since it
can be challenging to run everything on a large data set, we’ll offer you a small data option. If you train your
data on TestingDataOneLinePerDoc.txt, and then test your data on SmallTrainingDataOneLinePerDoc.twe’ll take off 0.5 points on Task 2 and 0.5 points on Task 3. This means you can still get an A, and
you don’t have to deal with the big data set. For the possibility of getting full credit, you can train
your data on the quite large TrainingDataOneLinePerDoc.txt data set, and then test your data
on TestingDataOneLinePerDoc.txt.
4.1 Machines to Use
If you decide to try for full credit on the big data set you will need to run your Spark jobs three to five
machines as workers, each having around 8 cores. If you are not trying for the full credit, you can likely
get away with running on a smaller cluster. Remember, the costs WILL ADD UP QUICKLY IF YOU
FORGET TO SHUT OFF YOUR MACHINES. Be very careful, and shut down your cluster as soon as
you are done working. You can always create a new one easily when you begin your work again.
4.2 Turnin
Create a single document that has results for all three tasks. Make sure to be very clear whether you
tried the big data or small data option. Turn in this document as well as all of your code. Please zip up all
of your code and your document (use .gz or .zip only, please!), or else attach each piece of code as well as
your document to your submission individually. Do NOT turn in anything other than your Python code and
請加QQ:99515681  郵箱:[email protected]   WX:codinghelp













 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:AIC2100代寫、Python設(shè)計程序代做
  • 下一篇:COMP3334代做、代寫Python程序語言
  • 無相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區(qū)
    昆明西山國家級風景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

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

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號-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>
      精品电影一区二区三区| 日本道在线观看一区二区| 国产精品一区在线| 欧美卡1卡2卡| 亚洲午夜久久久久久久久电影院| 国产成人av一区二区| 欧美成人精品3d动漫h| 免费观看在线综合| 欧美一级一区二区| 免费在线观看一区| 精品理论电影在线观看 | 懂色av一区二区夜夜嗨| 国产日韩亚洲欧美综合| 国产高清不卡二三区| 国产精品不卡视频| 日本高清成人免费播放| 婷婷成人激情在线网| 欧美mv日韩mv国产网站| 大胆亚洲人体视频| 一区二区在线看| 欧美精品自拍偷拍| 狠狠色狠狠色综合| 亚洲人精品午夜| 欧美一区永久视频免费观看| 国产中文字幕一区| 亚洲欧洲精品一区二区三区| 日本高清无吗v一区| 久久99在线观看| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91麻豆精品国产91久久久更新时间| 久久亚洲一区二区三区明星换脸| 国产伦精品一区二区三区免费迷 | 欧美刺激午夜性久久久久久久| 国产精品一区不卡| 亚洲精品久久久蜜桃| 日韩午夜在线观看视频| 成人午夜精品在线| 婷婷国产v国产偷v亚洲高清| 国产精品嫩草久久久久| 欧美日韩精品系列| 国产91精品欧美| 日韩综合在线视频| 亚洲精品乱码久久久久久| 日韩午夜激情电影| 日本久久精品电影| 国产一区二区三区免费播放 | 在线播放亚洲一区| 不卡av在线网| 久久精品国产成人一区二区三区 | 精品国产91乱码一区二区三区| fc2成人免费人成在线观看播放| 奇米亚洲午夜久久精品| 亚洲免费在线观看视频| 久久久久久久久久看片| 91精品国产综合久久蜜臀| 在线观看av一区| 99久久精品免费看国产| 国产成人一区二区精品非洲| 日韩电影网1区2区| 亚洲成年人网站在线观看| 中文字幕一区二区三区精华液| 久久免费精品国产久精品久久久久| 欧美高清性hdvideosex| 精品视频1区2区| 在线亚洲一区二区| 99热这里都是精品| 成av人片一区二区| 成人福利电影精品一区二区在线观看| 黑人精品欧美一区二区蜜桃| 久久精品国产一区二区| 乱一区二区av| 蜜桃久久久久久| 男女男精品视频网| 久久精品国产99国产| 美腿丝袜在线亚洲一区| 九九视频精品免费| 国产精品亚洲午夜一区二区三区 | 国产成人av自拍| 国产精品一区二区黑丝| 精品一区二区三区在线观看国产| 日韩av一二三| 免费看日韩a级影片| 久久精品国产秦先生| 久久99国产精品久久99果冻传媒| 精品系列免费在线观看| 国产高清一区日本| 成人永久看片免费视频天堂| 高清国产一区二区| 色狠狠色噜噜噜综合网| 欧美色精品在线视频| 日韩欧美一级在线播放| 精品国产伦理网| 久久蜜桃一区二区| 亚洲三级免费观看| 亚洲国产精品视频| 秋霞电影网一区二区| 国产裸体歌舞团一区二区| 99久久精品国产网站| 欧美日韩精品系列| 久久久不卡影院| 一区二区三区蜜桃网| 久久国产精品99久久久久久老狼| 韩国女主播一区二区三区| 不卡av免费在线观看| 91精品国产品国语在线不卡| 久久精品日韩一区二区三区| 亚洲女同一区二区| 蜜臀av亚洲一区中文字幕| jvid福利写真一区二区三区| 4438x亚洲最大成人网| 欧美国产1区2区| 亚洲18女电影在线观看| 高清日韩电视剧大全免费| 在线日韩一区二区| 久久久精品综合| 午夜精品一区二区三区免费视频| 国产激情一区二区三区桃花岛亚洲| 色94色欧美sute亚洲线路一久| 日韩欧美国产综合一区| 一区二区三区在线观看欧美| 国产乱子轮精品视频| 欧美卡1卡2卡| 一区二区三区日韩| 成人美女视频在线看| 精品国免费一区二区三区| 亚洲黄色免费网站| 成人网页在线观看| 欧美电影免费观看高清完整版在线 | 中文字幕一区二区在线播放| 首页欧美精品中文字幕| 91在线观看地址| 国产欧美一区二区在线| 一区二区三区精品久久久| 高清不卡在线观看av| 精品久久久久久久久久久久久久久| 一区二区三区高清| 99re视频精品| 日韩美女视频19| 国产成人免费视频网站| 精品国产乱码久久久久久浪潮| 亚洲一区电影777| 色偷偷久久一区二区三区| 18成人在线视频| 99久久国产综合色|国产精品| 国产亚洲女人久久久久毛片| 国产一区二区精品久久99| 久久天堂av综合合色蜜桃网| 国产呦精品一区二区三区网站| 91麻豆精品91久久久久久清纯 | 91精品国产91久久综合桃花 | 欧美va亚洲va国产综合| 精品伊人久久久久7777人| 亚洲一区二区3| 91在线免费播放| 国产精品国产馆在线真实露脸 | 亚洲国产另类av| 91国偷自产一区二区开放时间| 亚洲蜜臀av乱码久久精品蜜桃| 国产91精品免费| 国产精品久久毛片av大全日韩| 成人亚洲精品久久久久软件| 国产欧美日韩精品一区| 成人aa视频在线观看| 伊人婷婷欧美激情| 欧美日韩视频在线观看一区二区三区| 亚洲线精品一区二区三区| 欧美日本在线一区| 蜜臀av在线播放一区二区三区| 久久先锋资源网| 色综合久久久久综合体 | 在线播放中文一区| 久久精工是国产品牌吗| 久久久久国产成人精品亚洲午夜| 国产成人免费视频网站高清观看视频 | 亚洲午夜在线电影| 欧美日韩情趣电影| 日本欧美在线观看| 国产日韩精品一区二区三区| 国产福利一区二区三区在线视频| 亚洲欧洲av一区二区三区久久| 欧美日本在线看| 国产在线不卡视频| 一区二区在线观看视频在线观看| 日韩欧美一区二区在线视频| 成人手机电影网| 五月婷婷综合激情| 国产精品麻豆久久久| 538在线一区二区精品国产| 韩国成人精品a∨在线观看| 亚洲免费看黄网站| 26uuu精品一区二区在线观看| 欧美亚洲禁片免费| 成人av资源下载| 免费高清在线一区| 亚洲一区在线免费观看| 国产视频一区在线播放| 欧美一区二区美女| 在线精品国精品国产尤物884a| 激情六月婷婷久久| 日韩电影在线观看电影|