代写QBUS2820留学生、代做Python编程、代写Python、代做Predictive Analytics 代写Web开发|代做R语言程序
QBUS2820 Predictive Analytics
Semester 2, 2018
Assignment 2
Key information
Required submissions: Written report (word or pdf format, through Turnitin submission)
and Jupyter Notebook (through Ed). Group leader needs to submit the Written report and
Jupyter Notebook.
Due date: Saturday 3
rd November 2018, 2pm (report and Jupyter notebook submission).
The late penalty for the assignment is 10% of the assigned mark per day, starting after 2pm
on the due date. The closing date Saturday 10th November 2018, 2pm is the last date on
which an assessment will be accepted for marking.
Weight: 30 out of 100 marks in your final grade.
Groups: You can complete the assignment in groups of up to three students. There are no
exceptions: if there are more than three you need to split the group.
Length: The main text of your report (including Task 1 and Task 2) should have a
maximum of 20 pages. Especially for Task 2, you should write a complete report. You may
refer to Assignment 1-Task 2 as reference for the structure of the report.
If you wish to include additional material, you can do so by creating an appendix. There is
no page limit for the appendix. Keep in mind that making good use of your audience’s time
is an essential business skill. Every sentence, table and figure has to count. Extraneous
and/or wrong material will reduce your mark no matter the quality of the assignment.
Anonymous marking: As the anonymous marking policy of the University, please only
include your student ID and group ID in the submitted report, and do NOT include your
name. The file name of your report should follow the following format. Replace "123" with
your group SID. Example: Group123Qbus2820Assignment2S22018.
Presentation of the assignment is part of the assignment. Markers might assign up to 10%
of the mark for clarity of writing and presentation. Numbers with decimals should be
reported to the third decimal point.
Key rules:
Carefully read the requirements for each part of the assignment.
Please follow any further instructions announced on Canvas, particularly for submissions.
You must use Python for the assignment.
Reproducibility is fundamental in data analysis, so that you will be required to submit a
Jupyter Notebook that generates your results. Unfortunately, Turnitin does not accept multiple files, so that you will do this through Ed instead. Not submitting your code will
lead to a loss of 50% of the assignment marks.
Failure to read information and follow instructions may lead to a loss of marks.
Furthermore, note that it is your responsibility to be informed of the University of Sydney
and Business School rules and guidelines, and follow them.
Referencing: Harvard Referencing System. (You may find the details at:
http://libguides.library.usyd.edu.au/c.php?g=508212&p=3476130)
Task 1 (35 Marks)
Part A: Logistic Regression (15 Marks)
Use Logistic Regression to predict diagnosis of breast cancer patients on the Breast Cancer
Wisconsin (Diagnostic) Dataset “wdbc.data”. See Section “About the datasets” as detailed
data description.
(a) Write Python code to load the data. For the target feature Diagnosis, change its literal M
(malignant) to 1 and B (benign) to 0.
Then define and train a logistic regression model with intercept by using scikit-learn’s
LogisticRegression model, using default parameter values.
Based on the estimated parameters from your model, calculate the probability of sample ID
8510426 (20th sample) having a benign diagnosis.
(b) Based on slides 26 to 31 of Lecture 9, write your own python code to implement the
gradient ascend algorithm for the logistic regression with intercept:
You may use the following defined logistic function.
def logistic_function(reg_input):
return np.exp(reg_input) / (1 + np.exp(reg_input))
Using the given data, write python code to use initial values ?? = [0,0, … ,0]
, to run the
gradient ascend algorithm to maximize the the log-likelihood function of logistic regression
with respect to the parameters.
Find the optimal learning rate and resulting estimated ??? . Then re-do task (a): probability
of sample ID 8510426 (20th sample) having a benign diagnosis. Compare the results and
explain the major reasons why you may have different answers with scikit-learn.
Now change the initial values to ?? = [1,1, … ,1]
, and re-do the above tasks and report
your results and findings.About the dataset:
https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic)
https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancerwisconsin/wdbc.names
Part B: Youtube Comment Spam Classification (20 Marks)
Some questions in Task 2 need you to do some self-learning, e.g., exploring how to build
features for the text data using bag of words. You should discuss with your group members
on how to deal with the problem and do necessary self-learning which is an important ability
to have for your future study and career.
Your goal is to build a Random Forest (RF) classifier that classifies whether a youtube
comment is spam or not.
Use the ytube_spam dataset. We have already split the data into train and test sets:
"ytube_spam_trainset.csv" and "ytube_spam_testset.csv".
General instructions:
1. "CLASS" in the data is the target variable ??.
2. 3-fold cross validation if needed.
3. Make sure set your random number generator seed to 0 for this question:
"np.random.seed(0)".
(a) Self-study and use the following Python package:
from sklearn.feature_extraction.text import TfidfVectorizer
Build a bag of words representation of the data with:
Max 1000 features
Remove the top 1% of frequently occurring words
A word must occur at least twice to be included as a feature
Remove common English words
b) Build a random forest classifier and use cross validation to optimise the parameters of the
random forest. You need to at least optimise the number of trees in the random forest and can
explore and optimise other parameters as well.
Use the following Python packages:
from sklearn import ensemble
from sklearn.model_selection import GridSearchCVWith your CV selected optimal parameters' values, re-train the RF on the full training set and
produce your best performing model.
Test your best performing model on the test set, and you must achieve an average score ("avg
/ total") of at least 0.96 for precision, recall and f1-score of "sklearn classification_report".
Report "sklearn classification_report" output.
(c) Based on your cross validation results from GridSearchCV, plot the "mean_test_score"
and "mean_train_score" vs number of trees on the same Figure.
If you optimised other parameters, then fix these parameters to their optimal values.
(d) Report your random forest settings that achieve the best classification.
(e) Produce a histogram of the depths of the trees of your best performing model.
(f) Report the top 10 most important text features of your best performing model.
Task 2 (25 Marks)
1. Problem description
Rossmann is a German drug store chain that operates over 3000 stores in 7 European
countries. In this assignment, you will use “Rossman_Sales.csv” data to forecast six weeks
of daily sales following the last period in the dataset.
Your objective inthis assignment isto developunivariate forecastingmodels, e.g. only
using the historical sales, to address this problem.
We focus on the sales forecasting of store 1. You can download the dataset
“Rossman_Sales.csv” from Canvas.
2. Report andrequirements
a. The purpose of the report is to discuss the business context, exploratory data
analysis, methodology, model diagnostics, model validation and present
forecasts and conclusions for six weeks of daily sales following the last
period in thedataset.
b. Your group must identify at least 1 simple benchmark model and at least 2 different
forecastingmethodsormodelsthat can be used to forecastsales.
c. The report should also include an analysis of a monthly sales (with the limitation
that the sample size is small at this frequency).
3. Further analysis for bonus marks
The group can earn up to 2 bonus marks (in the final mark for the unit) by developing a
system to automatically generate forecasts for all stores. In order to obtain the bonusmarks, you should present interesting results based on thistool (use the appendix and refer
to it the main text of the report). The ability to summarise information and be concise is
essential here.

热门主题

课程名

int2067/int5051 bsb151 babs2202 mis2002s phya21 18-213 cege0012 mgt253 fc021 mdia1002 math39512 math38032 mech5125 cisc102 07 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 efim20036 mn-3503 comp9414 math21112 fins5568 comp4337 bcpm000028 info6030 inft6800 bcpm0054 comp(2041|9044) 110.807 bma0092 cs365 math20212 ce335 math2010 ec3450 comm1170 cenv6141 ftec5580 ecmt1010 csci-ua.0480-003 econ12-200 ectb60h3f cs247—assignment ib3960 tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 econ7230 msinm014/msing014/msing014b math2014 math350-real eec180 stat141b econ2101 fit2004 comp643 bu1002 cm2030 mn7182sr ectb60h3s ib2d30 ohss7000 fit3175 econ20120/econ30320 acct7104 compsci 369 math226 127.241 info1110 37007 math137a mgt4701 comm1180 fc300 ectb60h3 llp120 bio99 econ7030 csse2310/csse7231 comm1190 125.330 110.309 csc3100 bu1007 comp 636 qbus3600 compx222 stat437 kit317 hw1 ag942 fit3139 115.213 ipa61006 econ214 envm7512 6010acc fit4005 fins5542 slsp5360m 119729 cs148 hld-4267-r comp4002/gam cava1001 or4023 cosc2758/cosc2938 cse140 fu010055 csci410 finc3017 comp9417 fsc60504 24309 bsys702 mgec61 cive9831m pubh5010 5bus1037 info90004 p6769 bsan3209 plana4310 caes1000 econ0060 ap/adms4540 ast101h5f plan6392 625.609.81 csmai21 fnce6012 misy262 ifb106tc csci910 502it comp603/ense600 4035 csca08 8iar101 bsd131 msci242l csci 4261 elec51020 blaw1002 ec3044 acct40115 csi2108–cryptographic 158225 7014mhr econ60822 ecn302 philo225-24a acst2001 fit9132 comp1117b ad654 comp3221 st332 cs170 econ0033 engr228-digital law-10027u fit5057 ve311 sle210 n1608 msim3101 badp2003 mth002 6012acc 072243a 3809ict amath 483 ifn556 cven4051 2024 comp9024 158.739-2024 comp 3023 ecs122a com63004 bms5021 comp1028 genc3004 phil2617
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图