免费一级欧美片在线观看网站_国产一区再线_欧美日本一区二区高清播放视频_国产99久久精品一区二区300

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  郵箱:99515681@qq.com   WX:codinghelp













 

標(biāo)簽:

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

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

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

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

    免费一级欧美片在线观看网站_国产一区再线_欧美日本一区二区高清播放视频_国产99久久精品一区二区300
    亚洲欧美区自拍先锋| 亚洲欧美日韩一区| 国产精品一区二区视频| 亚洲精品在线观看视频| 美女视频黄 久久| 欧美电影免费观看高清完整版在线 | 亚洲六月丁香色婷婷综合久久| 99久久久精品免费观看国产蜜| 国产精品久99| 一本高清dvd不卡在线观看| 一区二区成人在线观看| 欧美在线视频全部完| 午夜日韩在线电影| 日韩欧美国产综合一区| 国产在线国偷精品产拍免费yy| 久久综合色一综合色88| caoporn国产一区二区| 一区二区三区不卡在线观看| 51精品久久久久久久蜜臀| 精品一二线国产| 国产精品久久久久aaaa樱花| 在线免费观看日韩欧美| 奇米精品一区二区三区在线观看| 久久久久久亚洲综合影院红桃 | 精品成人私密视频| 丁香激情综合国产| 一区二区三区四区不卡在线| 欧美欧美欧美欧美首页| 国产一区二区三区美女| 国产精品―色哟哟| 在线看国产一区二区| 秋霞电影网一区二区| 日韩一卡二卡三卡四卡| 国产精品亚洲第一区在线暖暖韩国 | 欧美日韩综合在线免费观看| 麻豆高清免费国产一区| 中文字幕av在线一区二区三区| 在线一区二区三区做爰视频网站| 日本最新不卡在线| 国产亚洲美州欧州综合国| 99精品视频免费在线观看| 婷婷丁香久久五月婷婷| 久久精品视频免费| 欧美亚洲综合另类| 极品销魂美女一区二区三区| 亚洲欧洲成人精品av97| 制服丝袜日韩国产| 成人动漫av在线| 婷婷激情综合网| 国产精品久久久久久久久图文区 | 欧美顶级少妇做爰| 成人性生交大合| 日韩精品成人一区二区在线| 国产日韩精品一区二区三区在线| 日本精品一区二区三区高清| 精品一区二区免费视频| 亚洲免费资源在线播放| 精品国产在天天线2019| 色婷婷综合激情| 激情偷乱视频一区二区三区| 一区二区三区四区蜜桃| 久久久天堂av| 欧美日韩一区在线观看| 国产成人精品影视| 婷婷国产在线综合| 亚洲伦理在线精品| 久久久蜜桃精品| 欧美巨大另类极品videosbest| 成人不卡免费av| 韩国精品主播一区二区在线观看| 亚洲激情中文1区| 国产色产综合产在线视频| 91精品国产aⅴ一区二区| 一本色道久久综合亚洲aⅴ蜜桃 | 国产一区免费电影| 午夜视频在线观看一区二区三区| 中国色在线观看另类| 欧美成人伊人久久综合网| 91福利视频网站| 成人免费视频app| 伦理电影国产精品| 亚洲激情图片一区| 国产精品久久一卡二卡| 久久影院午夜论| 91精品国产高清一区二区三区| 色婷婷一区二区三区四区| 粉嫩av亚洲一区二区图片| 蜜桃一区二区三区四区| 亚洲午夜电影在线观看| 综合自拍亚洲综合图不卡区| 久久久另类综合| 欧美成人在线直播| 欧美福利一区二区| 在线免费观看成人短视频| av亚洲精华国产精华精华| 国产精品一区二区果冻传媒| 久久99久久99| 免费的国产精品| 日本欧美久久久久免费播放网| 一级女性全黄久久生活片免费| 国产精品不卡视频| 久久女同互慰一区二区三区| 日韩精品一区二区三区蜜臀| 6080国产精品一区二区| 欧美色图片你懂的| 在线免费一区三区| 色哟哟一区二区在线观看| 不卡视频一二三| 成人免费毛片高清视频| 国产91精品在线观看| 国产精品一级二级三级| 国产精品中文有码| 国产福利一区二区三区视频在线| 国产在线精品不卡| 国产成人av资源| 成人一级视频在线观看| 成人午夜精品在线| 白白色亚洲国产精品| 99re视频精品| 99久久伊人网影院| 91日韩精品一区| 日本精品一区二区三区四区的功能| 色www精品视频在线观看| 色综合中文字幕国产 | 成人avav在线| 99精品视频免费在线观看| 色哟哟精品一区| 欧美三级日韩三级| 777奇米四色成人影色区| 日韩免费性生活视频播放| 精品国产乱码久久久久久久久 | 蜜桃av噜噜一区| 韩国中文字幕2020精品| 国产精品一级在线| 91一区二区三区在线观看| 欧洲一区在线电影| 欧美福利一区二区| 久久伊人中文字幕| 国产精品乱码一区二区三区软件| 一区在线观看视频| 亚洲国产一区二区在线播放| 日韩精品一区第一页| 韩国成人在线视频| 成人免费的视频| 欧洲精品视频在线观看| 69av一区二区三区| 久久先锋影音av| 1000精品久久久久久久久| 一区二区三区四区国产精品| 男女激情视频一区| 国产精品一区二区黑丝| 一本到不卡精品视频在线观看| 欧美伦理影视网| 久久精品网站免费观看| 伊人夜夜躁av伊人久久| 日韩精品一卡二卡三卡四卡无卡| 国产精品中文有码| 一本在线高清不卡dvd| 欧美一区二区三区在线观看 | 欧美精品一区二区三区高清aⅴ | 久久久综合激的五月天| 亚洲精品免费在线观看| 欧美bbbbb| 白白色亚洲国产精品| 欧美精品第1页| 久久精品人人做人人综合| 亚洲一区二区三区四区在线观看| 麻豆久久久久久久| 成人黄色av电影| 9191久久久久久久久久久| 国产午夜精品久久| 亚洲国产aⅴ天堂久久| 国产一区二区福利| 欧美综合色免费| 欧美精品一区二区三| 一区二区三区在线免费| 精品在线你懂的| 色狠狠色狠狠综合| 久久综合久久综合久久| 亚洲一区二区三区小说| 国产精品一二一区| 欧美日韩精品综合在线| 日本一二三不卡| 首页欧美精品中文字幕| 成人免费观看av| 日韩欧美亚洲一区二区| 亚洲精品欧美激情| 国产一区二区三区四区五区入口| 色老头久久综合| 久久久久国产精品麻豆ai换脸| 亚洲电影一区二区| 成人性生交大片免费| 欧美变态tickle挠乳网站| 亚洲卡通欧美制服中文| 国产精品资源网| 91精品国产高清一区二区三区蜜臀| 亚洲欧洲中文日韩久久av乱码| 韩国在线一区二区| 91麻豆精品国产91久久久更新时间| 国产精品成人免费在线|