Question
Write using relational algebra . Function: findOutliers Input(s): (double) A 1xN vector of energy usages for each building (char) A 1xN character vector of single
Write using relational algebra .
Function: findOutliers Input(s): (double) A 1xN vector of energy usages for each building (char) A 1xN character vector of single digit building codes Output(s): (char) A character vector of the building codes that are outliers in energy usage sorted based on Z-scores Skills Covered: Masking . Vector Operations Function Description: You are prototyping a new system to keep track of the energy usages of buildings across campus. You have a character vector of single letter building codes that represent different buildings on campus. You also have double vector representing the corresponding energy usage of that building. The first building code in the character vector corresponds with the first energy usage number in the double vector and so on. You want to pay particular attention to the buildings that have energy usages that are outliers. One way of determining outliers is using a statistical concept called a Z-score. Given data, the Z score for a particular data point can by found by : . Z = (X-mu) / sigma Where X is an individual data point, mu is the mean of the data, and sigma is the standard deviation of the data.
Where X is an individual data point, mu is the mean of the data, and sigma is the standard deviation of the data. For out purposes, A data point with a Z-score value greater than 2 or less than -2 is considered to be an outlier. Given this knowledge, output a character vector of all of the single digit building codes that were outliers. These characters should be sorted such that the first building code representes the building with the smallest Z score of the outliers, and the last character should represent the building with the largest Z score of the outliers. Note(s): The standard deviation of a dataset can be found using the std function. Examples: 1 50 7 3 8 85 1 27 2 4 45] energyUsages1 = [8 3 10 2 1 20 3 9 2 8 buildingCodes1 = 'abcdefghijklmnopqrstu' outliers1 = findoutliers (energyUsages1, buildingCodes1) outliers1 = 'p' - 10000.4417790767 energyUsages 2 = [-10001.0127680343 -9998.78474208449 -9999.84372462466 - 10000.4002573122 buildingCodes2 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()' outliers2 = findoutliers (energyUsages2, buildingCodes2) outliers 2 -
Q89;
2.5 List The ID Of The User With The Most Total Hours Across All Products (Highest Sum Of Hours). 2.7 Remove All Products That Have No Users Permitted To Use It. Users UserlD Password Type Referred 123 ABC X 234 DEF Y 123 345 GHI Z 123 456 Z 234 567 JKL Y 234 678 MNO 567 789 DEF 345 ABC Permissions UserID ProductID Hours 123 11 80 123 22 90 234 33
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started