Zookal
Zookal

We’d love to hear any feedback or comment from you!

© 2011-2021 Zookal Pty Ltd

View question and answer

From our collection of questions and answers
Engineering · Computer Science
Question details

Predicting the Missing Humidity Values Given humidity data for the days spanning from startDate to endDate inclusive, predict the hourly humidity data for each of the timestamps in timestamps. Function Description Complete the function predictMissingHumidity in the editor below. The function must return an array af floating-point numbers where the value at each index i denotes the humidity at timestamps predictMissingl lumidity has the following parameters): startDate: string, The first day of humidity data in the format yyy-mm-dd. endDate: string, The last day of humidity data in the format yyy mm dd. knownTimestampsknownTimestamps/O..knownTimestamps/m-1 an array of strings of timestamps in the format yyy-mm-dd hh:00 humidity numidityfO humidityfm 1B: an array of tloating point numbers representing humidible occurring atknownTmestampsM timestampsltimestampsi0!.. .imestampsin : an array of strings of timestamps to predict for in the format yyvy mm dd hh:00. Constraints 2013 07 01 s startDate s endDate s 2075 07 07 .1sns 915 Input Format for Custom Testing .The predicted humidity at a timestamp is considered to be correct if the absolute difterence between the actual and predicted humidities is not greater than 0.25 . Ihe accuracy of the prediction is defined as: (Totali.moarafconserpredettn% The score for each test case is calculated as: accuracy x (test case weight) .The final score is the sum of all test case scores.Explanation 0 Given the m 79 hours of humidity data on 2013 01 01, the task is to predict n-5 hours of missing humidity data for the timestamps in timestamps. The table below depicts sample predictions for the given humidity data that contains a total of 3 correct predictions. The accuracy of these predictions is 5-0.60 and, because the test case weight is 5, the total score for this test case is 0.60 × 5-3. HUMIDITY Predicted Humidity Humidity Difference 0.54 0.35 0.14 0.04 0.02 Timestamp Humidity 0.64 0.55 0,44 0.44 0.52 Correct Prediction? 2013 01 01 07:00 Incorrect 2013-01-01 09:00 2013-01-01 14:00 2013-01-01 15:00 2013-01-01 22:00 0.2 Incorrect Correct Correct Correct 0.3 0.4 0.5Draft saved 09:46 pm Original Code Java 8 import java.io.*; 14 15 class Result 16 17 19 19 20 21 * Complete the predictMissingHumidity function below The function is expected to return a FLOAT_ARRAY *The function accepts following parameters: 1. STRING startDate 23 24 25 26 27 28 29 2. STRING endDate 3 STRING_ARRAY knownTimestamps FLOAT ARRAY humidity 5. STRING_ARRAY timestamps public static List<Float> predictMissingHumidity(String startDate, String endDate, List<string known Timestamps, List<Float humidity Liststringy timestamps) // Write your code here 30 31 32 3.4 35 36 public class Solution

Given humidity data for the days spanning from startDate to endDate inclusive, predict the hourly humidity data for each of the timestamps in timestamps.

Function Description:

Complete the function predictMissingHumidity in the editor below. The function must return an array of floating-point numbers where the value at each index i denotes the humity at timestamps[i].

predictMissingHumity has the following parameters(s):

startDate: string, the first day of humidity data in the format yyyy-mm-dd.

endDate: string, the last day of humidity data in the format yyyy-mm-dd.

knownTimestampsknownTimestamps[0]..knownTimestamps[m-1]: an array of strings of timestamps in the format yyyy-mm-dd hh:00

humidity[humidity[O],... humidity[m-1]]:: an array of floating point numbers representing humidity[i] occurring at at knownTimestamps[n-1],...timestampsltimestamps[n-1]]: an array of strings of timestamps to predict for in the format yyvy-mm-dd hh:00.

Constraints:

-2013-01-01 <= startdate <= enddate <= 2015-01-01

-1 <= m <= 3476

- 1<= n <= 915

Evaluation

-The predicted humidity at a timestamp is considered to be correct if the absolute difference between the actual and predicted humidity is not greater than .25.

-the accuracy of the prediction defined as (total number of correct prediction/n).

-The score for each test case is calculated as accuracy * (test case weight).

-the final score is the sum of all test scores

class Result {

/*

* Complete the 'predictMissingHumidity' function below.

*

* The function is expected to return a FLOAT_ARRAY.

* The function accepts following parameters:

* 1. STRING startDate

* 2. STRING endDate

* 3. STRING_ARRAY knownTimestamps

* 4. FLOAT_ARRAY humidity

* 5. STRING_ARRAY timestamps

*/

public static List<Float> predictMissingHumidity(String startDate, String endDate, List<String> knownTimestamps, List<Float> humidity, List<String> timestamps) {

// Write your code here

}

}

Answer
Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.

Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.