Hokusai - sketching streams in real time

Assignment Help Computer Engineering
Reference no: EM13924120

1. Objective

In this project, you will implement and experiment with several algorithms to approxi- mate historical item counts in a space-efficient manner.

Note that it will take you quite some time to complete this project even if you are familiar with Java programming and have good programming experience. Therefore, we earnestly recommend that you start working on this project as early as possible.

2. Background

This project will be based on the paper "Hokusai - Sketching Streams in Real Time".

You are required to implement the two algorithms in the paper - the time aggregation and the item aggregation. Both the Count-Min sketch (denoted as cm-sketch in the rest of this specification) [CM04] and the two algorithms have been introduced in the Data Stream Mining lecture slides; nevertheless, you are exepcted to read the corresponding sections of the paper [MSA12] for further details. Note that the paper has several typos and inconsistencies, and you need to fix them. See also Section 4.

Finally, in addition to the implementation, you will also need to submit a report on corrections to the paper and ideas for possible improvement.

3. Task I: Implementation

Your first task is to write a Java class named Proj1, which receives six command line arguments:
• DATAFILE: the file that contains the data stream items. Its format will be described shortly.
• QUERYFILE: the file that contains the queries. Its format will be described shortly.
• METHOD: it is a string of either time or item.
• WIDTH: it is the width of each cm-sketch.
• DEPTH: it is the depth of each cm-sketch.
• SEED: it is an integer that initiates the random generator in Java (i.e., java.util.Random).

Your program should use time or item aggregation as specified in the METHOD to process the data stream in the DATAFILE, and then computes the estimates for each query specified in the QUERYFILE; the cm-sketches constructed in your algorithms should use the parameter WIDTH, DEPTH, and SEED.

Query File Format. The QUERYFILE consists of one or more lines. Each line consists of three fields separated by a white space character.

The three fields are:

• a string specifying the query item (denoted as Q)
• an integer specifying the start timestamp (denoted as t1)
• an integer specifying the end timestamp (denoted as t2)
Hence each query asks for (t2 - t1 + 1) estimates of the total count of Q at timestamp i, for t1 ≤ i ≤ t2.

Output Format. If there are m queries in the QUERYFILE, you need to output m lines, where each line is the estimated numbers for each corresponding query. The estimated numbers should be separated by a comma (i.e., ,); if the estimated number is a floating number, you should round it down to an integer and display it as the estimated total count.

Hash Functions and Random Seed. We will source the hash functions used in the cm-sketches from the following universal hashing function family:

h(x) = ((a • x + b) mod p) mod w where a ∈ [1, p - 1] and b ∈ [0, p - 1] are random integers (deterministically derived from the given random seed)1, p is a large prime number, and w is the width of the cm-sketch. To make sure we can reliably test your program, you have to use the SEED given from the command line to initiate your random hash functions. The logic in the following code should be used:

// p = 2147483647

Random r = new Random(SEED); for (int i = 0; i < depth; ++i)
{
a[i] = 1 + r.nextInt(p-1);
b[i] = r.nextInt(p);
}
For example, if given the seed 1234, the first two hash functions should be:
h1(x) = ((1388524629 • x + 557894633) mod p) mod w h2(x) = ((2043025134 • x + 509900220) mod p) mod w

You perhaps need to beware certain care is needed as Java does not support unsigned data types.

To convert a string into an integer, we use String::hashCode() method.

4. Task II: Report

You need to write a report with the following components:

• Present the correct version of Algorithms 2 and 3 in [MSA12]. You should follow the style and typesetting of the algorithms as much as possible, while addressing the following goals:

- For Algorithm 2: fix the error(s) in the algorithm, and also make sure there is no useless computation in the pseudo-code level.

- For Algorithm 3: fix the algorithm so that it starts with timestamp 0 (rather than 1). Your corrected version should work as that shown in the lecture slides, i.e., it has two full-width cm-sketches, followed by two half-width, four quarter-width sketches, and so on and so forth.2

• Describe the estimation algorithm for sketched obtained via time aggregation.

• Describe at least one way to improve the methods to deliver a possible more accurate solution to the problem. You should clearly describe (1) the problem(s) of the current solution(s), and (2) your proposed method.

Automarking Your Implementation. Auto-marking will be used to mark your implementation on a linux machine. Specifically, we will

(1) Untar the proj1.tar and run javac *.java to compile your .java files.

(2) Run your program with some valid parameters and record your output and compare it with sample output.

(3) Repeat Step b) several times, each with a different set of parameters.

Therefore, you need to make sure:

• Your java program can be correctly compiled. Make sure you do not put some of your java source files at a sub-directory.

• Your java program can be run by java Proj1 DATAFILE QUERYFILE METHOD WIDTH DEPTH SEED. Make sure you do not use package for your code.

• Your java program output results in a format exactly identical to that described in Section 3.3. Make sure you do not output does not contain other messages (e.g., debugging information).

Be warned that you will recieve 0 mark if your program cannot be compiled or run correctly in our testing environment (e.g., program exit due to some Exception).

Reference no: EM13924120

Questions Cloud

Advantage of proprietary software : One advantage of proprietary software versus off-the-shelf software is that _____
Describe the method available to take advantage of forecast : To perform well over the next three to six months. As an active portfolio manager, describe the various methods available to take advantage of this forecast.
Precise terms between the issuer and the bondholder : Which of the following is a legal contract that outlines the precise terms between the issuer and the bondholder?
Compute average return differential with and without sign : Given the monthly returns that follow, how well did the passive portfolio track the S&P 500 benchmark? Find the R2, alpha, and beta of the portfolio. Compute the average return differential with and without sign.
Hokusai - sketching streams in real time : You will implement and experiment with several algorithms to approximate historical item counts in a space-efficient manner.
Compare performance of foreman fund and the copeland fund : Stewart utilizes return-based-style analysis to compare the performance of the Foreman Fund and the Copeland Fund for the past year.
What are the details in the article : What are the details in the article? Please summarize the facts. What are your thoughts on the subject matter? Do you think this is a good use of taxpayer's money?
Tools to develop communication skills? : How may these tools help you develop communication skills?
Does russian aggression in ukraine since 2013 : Does Russian aggression in Ukraine since 2013 constitute the first incident of a "new Cold War" whereby Russia will seek to reacquire the former Soviet Republics, such as Lithuania, Estonia, and Latvia, amongst others

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd