代做COMPSCI5089 INTRODUCTION TO DATA SCIENCE AND SYSTEMS 2019代写Python语言

INTRODUCTION TO DATA SCIENCE AND SYSTEMS (M)

COMPSCI 5089

Thursday 19 December 2019

1. Linear algebra, probability, visualisation and optimisation

Your data science team has been asked to analyse a subsystem for a car manufacturer. After some experimentation it is clear that the system you are considering can be described by the following set of coupled equations:

-14 + xα + zγ =       -yβ

2xα -yzβ + 8   =   -xγ + xα (1)

-zγ =   -5 -yβ

where x = 1;y = 2; z = 3 are scalar inputs to the system and the output of the system is de- noted by c = f ([x;y; z]T ; [α ; β ; γ]T ) = [14; -8; -5]T . b = [α ; β ; γ]T is a vector containing  the parameters of the system.

(a) Convert the set of coupled equations in Eq. (1) into the matrix form. Ab = c.                  [3]

(b) You are now asked to nd the parameters, b, of the system using a numerical optimization method without the availability of standard solvers and matrix inversion.

(i)  Define an optimization problem that would allow you to solve a problem of the type Ab = c with respect to b with the constraint that you cannot use matrix inversion but have access to partial derivatives of A, b and c with respect to b.         [2]

(ii)  State a form. of the update equations for standard gradient descent which will allow you to solve the optimization problem outlined in the previous question and explain under which conditions your gradient descent optimization algorithm is guaranteed to converge.                                                                                                                        [4]

Figure 1: A scatter plot illustrating two datasets. The two different datasets can clearly be identified as two distinct clusters (as validated by the manager)

(c) Your manager has provided you with two datasets obtained on two different days each containing several observation of x and y.

(i)  Your manager has illustrated the observations in Figure 1.  Criticise this graph, and redraw a sketch that corrects the issues you have identified.                                      [3]

(ii)  Your manager asks you to summarise each of the datasets using a separate Normal  distribution for each dataset. Explain how you would parameterise the Normal distribu- tions needed to model the (x,y) values from the two individual datasets, including a  description of the array shape of any parameters that the distribution would have.   [3]

(iii)  Explain how eigendecomposition could be used on the parameters estimated in the previous question to identify the major axis of variation. Draw a simple sketch to show: the data points; the estimated normal distributions; the relevant eigenvectors (for each dataset separately).         [5]

2. Text processing in data science

(a) (i)  Consider two documents with term frequency vectors as follows: D1 = [4, 2, 0] and D2 = [2, 0, 4]. Calculate the cosine similarity between these two documents. Give the formula for cosine similarity and show your workings. Note: the final result may be in the form of a formula.                 [3]

(ii)  Name and describe an application where cosine could be used.  Justify why cosine should be used for this application, explain the key geometric properties of cosine similarity and why it is important for the application.                                                [2]

(iii)  Your are given the following list of documents in python: docs  =   (‘The  sky is  green’,  ‘The  sun  is  yellow’,  ‘We  can  see  the  shining sun,  the  bright  sun  in  the  sky’).  Write python code to compute the TF-IDF cosine similarity matrix of the docs list using the appropriate Sci-Kit Learn libraries.                         [3]

(iv)  Define the concept of lemmatization. Compare and contrast it with stemming.         [2]

(b) (i)  Explain the k-means clustering algorithm using pseudo-code or precise word descrip-tions. Name and describe three key clustering properties of k-means.                      [3]

(ii)  You work at a large social media company with an advertising network. Describe a task where k-means could be applied and describe how it would be implemented. Provide details including specifying appropriate textual features and their representation, the similarity function, and how to address issues of scale on large datasets.                  [3]

(iii)  The default k-means algorithm runs on the task from part 2.b.(ii) for a very large data   collection. The clustering is too slow and takes too long to complete.  The product   requirements dictate that the number of clusters and features are fixed. Discuss why it   is slow and suggest a modification to the k-means algorithm that will speed it up.   [2]  (iv)  How many clusters would you guess the data illustrated in Figure 2 has? Describe the   method you would use to determine a correct value of k. Does it matter if the value is  determined over a single run vs many runs of the algorithm? Explain why or why not.    [2]

Figure 2: Example cluster data

3. Database systems

(a) Consider a relation Employee(ID, Name, Age) where the primary key (ID) is a 64-bit integer, Age is an 8-bit integer, and that we need 51 bytes for the Name attribute. Assume that the relation has 1000 tuples, stored in a le on disk organised in 512-byte blocks each having a 24-byte header. Note that the database system adopts xed-length records – i.e., each le record corresponds to one tuple of the relation and vice versa.

(i)  Compute the blocking factor and the number of blocks required to store this relation?      [2]

(ii)  Consider the following SQL query:

SELECT  Name  FROM  Employee  WHERE   ID   >=   101  AND   ID  <= 115

Estimate the expected query processing cost in terms of number of block accesses, when the relation le is organised as (a) a heap file, (b) a sequential file, ordered by primary key, and (c) a hash le using external hashing with the primary key as the hash key eld, 256 buckets each containing one block, and no overflow buckets.             [5]

(b) Consider two relations Employee E and Department D such that:

Relation E has nE = 100 blocks and rE = 1000 records

Relation D has nD = 50 blocks and rD = 10 records.

Assume that relation Employee (E) has an attribute SSN (Social Security Number) as its primary key, and that relation Department (D) has a unique attribute Mgr SSN (Manager’s SSN) being a foreign key referencing relation E’s SSN attribute. Note: Mgr SSN is unique and hence there is a single manager per department. Further assume that the memory of the database system can accommodate nB = 12 blocks for processing and the blocking factor for the join-results block is b frRS = 10 records per block.  Last, assume we execute the following equi-join query:

SELECT  *  FROM  E,  D  WHERE   D .Mgr SSN  =  E .SSN

(i)  Assume that the query is processed using the nested-loop join algorithm.  Estimate the total expected cost (in number of block accesses) for the various strategies and conclude which strategy is the most efficient. Show your work.     [6]

(ii)  Assume that there is a Level 2 Secondary Index over the Department relation for the unique attribute Mgr SSN, i.e., level xD = 2, and a Level 2 Primary Index over the Employee relation for the primary key SSN, i.e., level xE = 2. Propose two index-based nested-loop join strategies and explain which one is the best using these indexes.   [7]



热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图