爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频

COMP 330代做、Python設計程序代寫

時間: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













 

標簽:

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

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

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频
    <strike id="bfrlb"></strike><form id="bfrlb"><form id="bfrlb"><nobr id="bfrlb"></nobr></form></form>

        <sub id="bfrlb"><listing id="bfrlb"><menuitem id="bfrlb"></menuitem></listing></sub>

          <form id="bfrlb"></form>

            <form id="bfrlb"></form>

              <address id="bfrlb"></address>

              <address id="bfrlb"></address>
              欧美激情精品久久久久久免费印度| 午夜激情久久久| 欧美a级在线| 在线视频国产日韩| 国产精品一区二区久久久| 西西人体一区二区| 欧美日韩免费观看一区二区三区| 欧美在线在线| 亚洲日本成人女熟在线观看| 亚洲欧美日本精品| 久久免费精品日本久久中文字幕| 日韩午夜在线视频| 日韩一级在线观看| 最新国产成人av网站网址麻豆| 国产一区二区三区观看| 黄色av成人| 久久精品国产在热久久| 久久精品国产69国产精品亚洲| 你懂的网址国产 欧美| 好吊色欧美一区二区三区视频| 国产一区免费视频| 亚洲欧美视频一区| 久久久久久久综合色一本| 欧美一区三区三区高中清蜜桃| 久久成年人视频| 影音欧美亚洲| 久久天天躁夜夜躁狠狠躁2022| 欧美亚洲成人精品| 欧美日韩在线不卡一区| 久久久999精品视频| 快播亚洲色图| 影视先锋久久| 欧美日韩精品伦理作品在线免费观看| 欧美顶级大胆免费视频| 久久久久久伊人| 国产农村妇女毛片精品久久莱园子| 久久综合久久综合九色| 国产日韩欧美另类| 亚洲精品专区| 99国产精品国产精品久久| 国产一区二三区| 亚洲免费在线视频一区 二区| 国产精品日韩在线播放| 久久久蜜桃精品| 久久一区二区三区国产精品| 国产精品一区在线观看| 在线视频免费在线观看一区二区| 国产欧美日韩精品丝袜高跟鞋| 亚洲欧美激情诱惑| 韩国在线一区| 在线视频日本亚洲性| 欧美激情综合五月色丁香小说| 欧美母乳在线| 黑人极品videos精品欧美裸| 农村妇女精品| 欧美少妇一区二区| 蜜臀av在线播放一区二区三区| 欧美日韩1区| 狠狠色香婷婷久久亚洲精品| 亚洲人成亚洲人成在线观看图片| 欧美黄色网络| 一区二区三区毛片| 欧美激情综合亚洲一二区| 国产视频一区免费看| 亚洲网址在线| 亚洲一区美女视频在线观看免费| 国产九九视频一区二区三区| 一区二区免费看| 亚洲一区二区三区精品视频| 欧美性淫爽ww久久久久无| 亚洲一区亚洲| 欧美视频在线免费看| 国产一区二区三区高清在线观看| 欧美极品色图| 久久超碰97人人做人人爱| 99视频精品免费观看| 在线 亚洲欧美在线综合一区| 亚洲一区二区三区视频| 欧美一区二区三区视频免费| 国产精品卡一卡二卡三| 99视频超级精品| 久久夜色精品国产噜噜av| 国产精品毛片va一区二区三区| 亚洲国产日韩欧美在线动漫| 欧美精品国产一区| 亚洲狼人精品一区二区三区| 国产精品揄拍一区二区| 国产精品久久久久久久电影| 中文精品视频一区二区在线观看| 亚洲国产精品第一区二区三区| 欧美精品久久久久久久| 国产一区二区按摩在线观看| 欧美日韩国产精品专区| 久久久久国产一区二区| 亚洲一级在线观看| 美女网站在线免费欧美精品| 亚洲一区二区视频在线观看| 亚洲欧洲一区二区三区久久| 国产综合激情| 国产精品盗摄久久久| 国产麻豆精品久久一二三| 欧美日韩精品久久| 亚洲国产欧美一区二区三区久久| 伊人久久亚洲影院| 亚洲免费网站| 久久噜噜噜精品国产亚洲综合| 久久综合九色综合欧美就去吻| 99香蕉国产精品偷在线观看| 亚洲免费在线视频| 国产一区二区三区视频在线观看| 久久久噜噜噜久久中文字免| 亚洲综合丁香| 亚洲欧美色一区| 亚洲成在线观看| 国产精品色婷婷久久58| 欧美性色视频在线| 欧美激情一区二区三区成人| 亚洲影院在线观看| 国内揄拍国内精品少妇国语| 久久精品91久久香蕉加勒比| 欧美激情乱人伦| 欧美精品在欧美一区二区少妇| 狼狼综合久久久久综合网| 欧美激情2020午夜免费观看| 欧美+日本+国产+在线a∨观看| 久热综合在线亚洲精品| 国产免费观看久久黄| 国产日韩亚洲| 久热精品视频在线免费观看| 欧美激情网站在线观看| 久久在线视频在线| 一本久久a久久免费精品不卡| 国产精品久久久久久久久久尿| 久久精品91久久香蕉加勒比| 国产精品久久亚洲7777| 亚洲国产欧美一区二区三区丁香婷| 一区二区三区日韩欧美精品| 一区二区高清| 欧美日韩视频在线观看一区二区三区| 美女图片一区二区| 国内精品嫩模av私拍在线观看| 欧美日韩激情小视频| 国内精品久久久久久久影视麻豆| 亚洲第一精品电影| 欧美激情精品久久久久久久变态| 久久久国产精品一区二区中文| 欧美精品观看| 午夜精品视频| 亚洲蜜桃精久久久久久久| 欧美成va人片在线观看| 欧美亚洲一区| 久久久xxx| 久久天天躁狠狠躁夜夜爽蜜月| 国产精品免费一区二区三区在线观看| 欧美日韩亚洲天堂| 美日韩丰满少妇在线观看| 欧美亚男人的天堂| 鲁大师影院一区二区三区| 亚洲黄色片网站| 欧美精品在线一区二区三区| 国产人久久人人人人爽| 亚洲免费观看高清完整版在线观看| 国产日产欧产精品推荐色| 国内视频精品| 一本久道久久综合中文字幕| 欧美日韩中文字幕综合视频| 亚洲精品色图| 亚洲精品中文字幕女同| 在线亚洲+欧美+日本专区| 99亚洲伊人久久精品影院红桃| 国产视频一区免费看| 亚洲精品视频免费| 欧美精品在线观看一区二区| 国产亚洲欧洲997久久综合| 在线观看国产成人av片| 狠狠色狠狠色综合日日五| 亚洲综合日本| 午夜精品久久久久久久久| 国产日韩av在线播放| 亚洲视频免费| 国产精品人成在线观看免费| 伊人成人在线视频| 国产综合网站| 日韩午夜电影在线观看| 亚洲国产一区二区视频| 悠悠资源网亚洲青| 永久免费毛片在线播放不卡| 久久精品一区二区三区不卡牛牛| 日韩亚洲视频在线| 麻豆91精品91久久久的内涵| 久久精品国产清高在天天线| 激情欧美一区二区三区在线观看| 欧美aa在线视频| 国产亚洲福利一区| 国产欧美一区二区三区国产幕精品| 老鸭窝亚洲一区二区三区| 午夜精品偷拍| 亚洲欧洲日产国产网站| 在线亚洲+欧美+日本专区| 狼人社综合社区|