Data Mining

Data Mining

Academic year 2014–2015

"The success of companies like Google, Facebook, Amazon, and Netflix, not to mention Wall Street firms and industries from manufacturing and retail to healthcare, is increasingly driven by better tools for extracting meaning from very large quantities of data. 'Data Scientist' is now the hottest job title in Silicon Valley."      – Tim O'Reilly


The course will develop algorithms and statistical techniques for data analysis and mining, with emphasis on massive data sets such as large network data. It will cover the main theoretical and practical aspects behind data mining.

The goal of the course is twofold. First, it will present the main theory behind the analysis of data. Second, it will be hands-on and at the end students will become familiar with various state-of-the-art tools and techniques for analyzing data. We will use Python for downloading data and implementing various algorithms using its rich libraries and Hadoop's MapReduce framework for mining of large-scale data.



You can find information about the project at the project web page.

The fifth homework is out; it is due on July 5.

The fourth homework is out; it is due on May 24.

The third homework is out; it is due on May 3.

The second homework is out; it is due on April 12.

The first homework has been updated. You can fidn the new version below, and you must have received an email with the updates.

The first homework is out; it is due on March 22.

Monday's classes will be at room A6.

The first lecture will be on Monday, February 23.

The first lecture will be in Room A1.



Aris Anagnostopoulos, Sapienza University of Rome.


When and where:

Monday 10.10–13.30, Room A6

Wednesday 10.10–11.45, Room A5


Office hours

You can use the office hours for any question regarding the class material, past or current homeworks, general questions on data mining, the meaning of life, pretty much anything. Send an email to the instructor for arrangement.



Chapters for which no book is mentioned refer to the "Mining of Massive Datasets" (see below).

Date Topic Reading
February 23 Introduction to data mining
Introduction to probability
Chapters 1.1, 1.3
Introduction to data mining
A crash course on discrete probability
Check the background probability chapters below
February 25 Introduction to probability (continue)
March 2 Introduction to probability (continue)
An overview of Python
Check the Python resources below
March 4 Overview of information retrieval, part 1 IIR book, chapters 1.0–1.1, 2.0–2.2
March 9 Overview of information retrieval, part 2 IIR book, chapters 1.2–1.3, 4.2, 6.2–6.3, 7.1.0
March 11 Similarity and distance measures Chapter 3.5, Wikipedia on LCS
March 16 Shingling and minwise hashing Chapters 3.0–3.3
March 18 Minwise hashing (cont.)
March 23 LSH for documents,
Introduction to clustering, K-means
Chapters 7.0, 7.1, 7.3–7.3.3
Chapter on k-means of the book of Christopher M. Bishop
March 25 k-means (cont.), Hierarchical clustering Chapter 7.2
March 30 Modeling, maximum likelihood,
Soft clustering, and expectation–maximization
April 1 Solutions to homework 1
April 8 Introduction to classification, Naive Bayes classification, SVMs, Decision trees IIR book, chapters 13.0–13.3
IIR book, Chapters 15.0–15.2.1
Chapter on decision trees of the book Understanding Machine Learing, by Shalev-Shwartz and Ben-David.
April 13 Mining frequent itemsets, part 1 Chapters 6.0–6.2, 6.3.1
April 15 Mining frequent itemsets, part 2 Chapter 6.4
April 20 Link analysis, PageRank, Personalized PageRank Chapters 5.0–5.1, 5.3, 5.4.4
April 22 Social networks and structural properties Slides on social networks
April 27 Streaming algorithms, part 1 Chapters 4.0–4.2, 4.5.5
April 29 Streaming algorithms, part 2 Chapters 4.3–4.5
May 4 Dimensionality reduction, SVD, Recommendation systems Chapters 7.1.3, 9.0–9.3, 11.3.0–11.3.3, 11.3.5
May 11 Introduction to MapReduce and Hadoop, and algorithms of data mining.
May 13 The Wisdom of the Crowds.
May 20 Epidemics and diffusion in social networks.



Check the "Examination format" section below for information about collaborating, being late, and so on.

Handing in: You must hand in the homeworks by the due date and time by an email to the instructor that will contain as attachment (not links!) a .zip or .tar.gz file with all your answers and subject

[Data Mining class] Homework #

where # is the homework number. After you submit, you will receive an acknowledgement email that your homework has been received and at what date and time. If you have not received an acknowledgement email within 1 day after you submit then contact the instructor.

The solutions for the theoretical exercises must contain your answers either typed up or hand written clearly and scanned.

The solutions for the programming assignments must contain the source code, instructions to run it, and the output generated (to the screen or to files).

We will not post the solutions online, but we will present them in class.

  • Homework 1 (updated 12/3/2015, due: 22/3/2014, 23.59)
  • Homework 2 (due: 12/4/2015, 23.59)
  • Homework 3 (due: 3/5/2014, 23.59)
  • Homework 4 (due: 24/5/2014, 23.59)
  • Homework 5 (due: 5/7/2014, 23.59)


    Before the exam you have to implement a project, to which you will also be tested. You can find more information at the project web page.


    Textbook and references

    The main textbook is the "Mining of Massive Datasets," by A. Rajaraman, J. Leskovec, and J. D. Ullman. The printed version has been updated and you can download the latest version (currently 2.1) from the book's web site.

    In addition, we will cover material from various sources, which we will post online as the course proceeds.


    Python resources

    The main programming language that we will use in the course is Python. There are currently two main versions of Python, version 2.7 and version 3.4, which are slightly incompatible, but it is easy to translate programs from one version to the other. Even though version 3.4 is newer and better designed, version 2.7 is still more widely used and most available libraries are written for it. Therefore, in the class we will use Python 2.7.

    To learn the language you can find a lot of material online. You can start from Python's documentation site:

    If you would like to buy some books, you can check the

    We will use several libraries in the class. The Anaconda distribution has packaged all of them together and you can download it for free.

    If you have problems with Python installation you can obtain an ubuntu virtual machine with Python preinstalled. Contact the instructor for more information.


    Hadoop and MapReduce resources

    For MapReduce and Hadoop you can find a lot of material online, whereas, if you prefer a book, we recommend:

    • "Hadoop: The Definitive Guide, 3rd edition," by Tom White. It covers various aspects of Hadoop, including a lot of material that we will not need for the course. A good resource to learn the more advance material.
    • "Hadoop in Action," by Chuck Lam. Better organized and with more introductory material. It covers though fewer aspects of the more advance material.


    • You can find information about how to install hadoop on your machine here.
    • With this introductory tutorial you can start learning how to use Hadoop.
    • For more details for the various classes, the consult Hadoop's Javadoc documentation.


    Notes, slides, and other material

    Book chapters and notes:

    24/2/2015: Background reading on combinatorics, basic probability, random variables, and basic probability distributions.




    Examination format

    The evaluation will consist of a series of homeworks, a final project, and a final exam. In addition, we will take into account participation during class.

    • Every two weeks you will have to work on a set of homeworks, which will include both theoretical and programming exercises. The theoretical exercises will ask you questions that will cover or extend the material that we have done in the class. The programming exercises will ask you to implement some of the algorithms that we have covered in class or to extend the ideas, using either Python, or Hadoop. For instance, we may ask you to download and cluster some twitter posts. To be able to program the solutions you will need to study by yourself programming and programming libraries beyond what we will have covered in the class.

    Late policy: Every homework must be returned by the due date. Homeworks that are late will lose 10% of the grade if they are up to 1 day (24h) late, 20% if they are 2 days late, 30% if they are 3 days late, and they will receive no credit if they are late for more than 3 days. However, you have a bonus of 3 late days, which you can distribute as you wish among all the homeworks. The homeworks will be discussed and graded at the end, during the final exam.

    • Towards the end of the course you will have to select a project and program a solution. You may propose a topic that you would like to work on. More details will follow.
    • The final exam will include answering questions about the class material, similar to the theoretical homework questions. It will also include examination of your homework solutions and of the final project, for which you should be able to provide details and prove that you have understood and remember your solutions and your programs.

    Collaboration policy (read carefully!): You can discuss with other students of the course about the homeworks. However, you must understand well your solutions and the final writeup must be yours and written in isolation. In addition, even though you may discuss about how you could implement an algorithm, what type of libraries to use, and so on, the final code must be yours. You may also consult the internet for information, as long as it does not reveal the solution. If a question asks you to design and implement an algorithm for a problem, it's fine if you find information about how to resolve a problem with character encoding, for example, but it is not fine if you search for the code or the algorithm for the problem you are being asked. For the final project, you can talk with other students of the course about questions on the programming language, libraries, some API issue, and so on, but both the solutions and the programming must be yours. If we find out that you have violated the policy and you have copied in any way you will automatically fail. If you have any doubts about whether something is allowed or not, ask the instructor.

    We expect students to do all the homeworks and have a regular exam (see above). Students who for whatever reason (work, medical reasons, grandmother who died, laziness, etc.) do not do all the homeworks, will have a much longer final exam, in which they must demonstrate that they have knowledge of all the class material and that they are able to implement correctly algorithms such as those asked for the homeworks. In other words, we will ask them during the exam to come up with and implement algorithms similar to those asked at the homeworks.