Data Mining

Academic year 2015–2016

"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, Spark, Storm, Giraph, and Jubatus 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 January 27.

The fourth homework is out; it is due on December 20.

The third homework is out; it is due on November 29.

The second homework is out; it is due on November 15.

The class times have changed; check the days below.

The first homework is out; it is due on October 25.



Aris Anagnostopoulos, Sapienza University of Rome.

Ioannis Chatzigiannakis, Sapienza University of Rome.

Evimaria Terzi, Boston University.


When and where:

Wednesday 08.30–11.45, Room A4

Thursday 17.30–19.00, Room A4


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 instructors for arrangement.



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

Date Topic Reading
September 30 Introduction to data mining Chapters 1.1, 1.3
Introduction to data mining
October 1 Introduction to probability A crash course on discrete probability
Check the background probability chapters below
October 7 Introduction to python Getting-Started Notebook and Intro-to-Python notebook
October 8 Distance functions Slides
October 14 Text preprocessing and inverted indexes IIR book, chapters 1.0–1.1, 1.3, 2.0–2.2
October 15 Introduction to MapReduce and Hadoop. Chapters 2.0–2.3.1
Jeff Dean's talk on Google's distributed systems
Check the "Hadoop resources" below
October 21 Clustering (partitional and hierarchical) Partitional and hierarchical
October 22 Clustering aggregation and python clustering tools Slides and Clustering notebook
October 28 Dimensionality reduction -- how to maintain he information of your data in lower dimensions Slides
October 29 Dimensionality-reduction in practice Notebook 1 and Notebook 2
November 4 Modeling, the k-means objective, modeling, soft clustering, expectation–maximization Chapter on k-means of the book of Christopher M. Bishop, notes on generative models
November 5 Mining frequent itemsets Chapters 6.0–6.2, 6.4.0–6.4.2
November 11 Classification techniques Introduction,Naive Bayes and Decision Trees
November 12 Statistical methods for classification Introduction,Linear Regression and Logistic Regression
November 17 Graph Clustering and Partitioning Slides
November 18 Spectral methods Notebook
November 25 Near-duplicate detection, shingling, minwise hashing Chapters 3.0–3.3
November 26 Locality-sensitive hashing (LSH) for documents Chapter 3.4
Dec 2 Voting systems slides
Dec 3 Influence maximization slides
December 9 Introduction to recommender systems (Guest lecture by Fabio Petroni) Slides on recommender systems
December 10 Introduction to streaming algorithms - part 1 Chapters 4.0–4.5
December 16 Introduction to streaming algorithms - part 2
Introduction to PageRank
Slides on PageRank



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 This email address is being protected from spambots. You need JavaScript enabled to view it. 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.



You can find more information at the project web page.


Textbook and references

The main textbook is the "Mining of Massive Datasets," by J. Leskovec, A. Rajaraman, 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:

1/10/2015: Background reading on combinatorics, basic probability, random variables, and basic probability distributions.



Other references:

5/3/2015: A good introductory source for a lot of the information-retrieval issues that we discussed is the book "Introduction to Information Retrieval," by Manning, Raghavan, and Schütze.



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.