代做COMPSCI5089 Intro to Data Sci & Systems 2024代做Python编程

Intro to Data Sci & Systems M

COMPSCI5089

Friday 20 December 2024

1. This question is concerned with the Linear Algebra part of the course.

Note: When answering this question, you are recommended to use either Numpy pseudo- code or Latex syntax (at your preference) for typing mathematical answers into Moodle. Incorrect syntax will not be penalised as long as it is clear and unambiguous. For example, the identity matrix could be written as: [[1,0],[0,1]] or

|   1  0    |

|   0  1    |

and the matrix inverse as Aˆ-1 or inv(A).

Consider that you are working for a shipment company and studying the movements of parcels between 5 sites: A, B, C, D and E. The transitions between those sites every day are expressed in the following graph:

(a) (i)  What is the adjacency matrix for this graph? Provide the corresponding matrix (Note:

ensure that the edge weights are correctly encoded).        [3]

(ii)  Assume that at t = 0 you have the following distribution A = 100,B = 10, C = 20,D =

0, E = 0, what would be the distribution at t = 1? [2]

(iii)  How would you calculate the package distribution two days ago (xt =-2)? Detail the approach you would use, but you do not have to calculate the actual values. [2]

(iv)  How would you transform. this adjacency matrix to make the graph undirected (ie, ensure that paths between any two nodes go both ways)?  [2]

(b) What is a steady state of A? Explain two ways to calculate the steady state for this process. [3]

(c) Consider the 2 × 3 matrix A with the following SVD decomposition A = UΣVT

where

(i)  What are the singular values of A?      [3]

(ii)  How can you calculate the pseudo-inverse of A, A+ from this decomposition. Explain all steps.

(Hint: We have (AB)+ = B+A+ and if A is invertible, then A+ = A-1.)         [5]

2. This question is concerned with the optimisation part of the course.

Hint: For the following questions, you can use ((1  0)   (0  1))  ˆ-1 to represent ify your typings.

You are given the following linear least squares optimisation problem:

Minimise the cost function:

f(x) = Axb2

where:

x R2 is the vector of unknowns,

A R2×2 is a matrix of known values,

b R2 is a vector of known values.

Given:

(a) Solve the least squares problem using the normal equations method to find the optimal solution x .

Hint: The normal equations are derived from the gradient of the least squares function, set to zero: A ⊤Ax = A ⊤b. And [5]

(b) Solve the least squares problem using gradient descent, starting from an initial guess xo = and using a step size α = 0.5. Perform. two iterations.

Hint: The gradient of the least squares cost function is given by ▽f(x) = 2A⊤ (Axb). You can use \delta to represent ▽ .  [5]

(c) Discuss the merits of stochastic gradient descent (SGD) for solving least squares problems, especially in the context of large datasets.   [4]

(d) Now, consider the same least squares problem, but with the additional constraint that x1 +x2 = 1. Solve this constrained optimisation problem using the Lagrange multiplier method.

Hint: You don’t need to substitute the values of x, but describe overall the steps with formulas.   [6]

3. This question is concerned with the probabilities part of the course.

Note: When answering this question, you are recommended to use either Numpy pseudo- code or Latex syntax (at your preference) for typing mathematical answers into Moodle. Incorrect syntax will not be penalised as long as it is clear and unambiguous. For example, the identity matrix could be written as: [[1,0],[0,1]] or

|   1  0    |

|   0  1    |

and the matrix inverse as Aˆ-1 or inv(A).

Let us assume that for a user study you have recorded the gaze of users when navigating a webpage (ie, you have recored what part of the webpage they were looking at). As a result, you have obtained a database D of 100 gaze locations for 100 users. Each record provides you with the x and y coordinates of the user’s gaze location in the page. We will assume that the coordinates are normalized between 0 and 1, such that (0, 0) indicate the top left corner of the page and (1, 1) the bottom right corner.

(a) As a first attempt at the problem, you decide to assume that the distribution of users’ gazes is normally distributed. Explain:

(i)  how this distribution would be parametrised, stating the dimensionality of each param-eter;     [2]

(ii)  and how you would estimate those parameters from D?       [3]

(b) After initial experiments, your model appears to perform very poorly:

(i)  In what case would this assumption of a normal distribution be obviously wrong? How would you identify that from the data in D?      [2]

(ii)  Propose an alternative model you could use and explain and how it would be parametrised (stating all dimensions).      [3]

(iii)  How would you estimate those parameters?         [3]

(c) Let us assume that out of the 100 users you recorded, 25 did actually buy something on the site, and that in addition to the users’ gaze, you have also recorded which users decided to buy something and which did not.

Using this data, how would you estimate how likely is a user to buy something given that they have gazed at a location g0? Explain all steps of your approach in details.         [7]

4. This question is concerned with the databases part of the course.

(a) You are given the following two relations:

Course (C):

Schema: Course(Id,  Description,  Credits)

Attributes:

*  Id: A 4-byte integer (primary key)

*  Description: A 256-byte string

*  Credits: A 1-byte integer

Total Records (rC): 32

Transcript (T):

Schema: Transcript(StudentId,  CourseId,  Mark)

Attributes:

*  StudentId: A 4-byte integer (foreign key)

*  CourseId: A 4-byte integer (foreign key to Course(Id))

*  Mark: A 8-byte double precision floating number

* Primary Key: Combination of StudentId and CourseId

Total Records (rT ): 51,200

Assume: The size of a disk block is 4096 bytes. CourseId in T references Id in C.

(i)  Calculate number of blocks for storing each relation (C and T).

Hint: To simplify your typing, you can use cel(x) and floor(x) to represent the floor and ceiling functions used to round numbers to the nearest integer.        [6]

(ii)  Estimate the selection cardinality of joining the relations C and T on the attribute CourseId. Assume that the courses in C are uniformly enrolled by all the students and appears in the Transcript.   (T) records.         [2]

(iii)  Explain how the selectivity helps in the query process.           [2]

(b) You are a data engineer at a company that develops personalised music streaming services. The platform needs to recommend songs to users based on their listening history and  preferences. Each song is represented by a high-dimensional feature vector that includes  acoustic attributes, artist information, and embedded representations from machine learning models.

(i)  Which types of database would you choose to store and query the song data? Justify your choice.        [6]

(ii)  Describe how you would store and index the song data to allow efficient retrieval and recommendation.       [4]




热门主题

课程名

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
站长地图