0% complete

Project 1 - Coders of Delhi · Lesson 1 of 1

Project 1 - Coders of Delhi

Clean a community dataset and build transparent “people you may know” and “pages you may like” recommendations.

Lesson

1. Introduction

A recommendation project is a practical way to learn data cleaning, graph relationships, and ranking without beginning with a black-box model. A connection suggestion can be derived from shared contacts; a page suggestion can be derived from shared interests.

2. Core concepts

First define what a row represents and normalize identifiers. A user graph is naturally represented by adjacency sets; mutual connections can be counted by set intersection. Candidate generation must exclude the user, existing connections, and invalid records. Rank ties should be handled deterministically.

3. Topics covered in this module

  • CodeBook-style records, schema inspection, missing values, and duplicate profiles
  • Users, pages, edges, identifiers, and adjacency representations
  • Mutual-connection scoring and candidate exclusion
  • Shared-page scoring, ranking, tie-breaking, and recommendation limitations

4. Syntax and how to read it

mutual = friends[user_a] & friends[user_b]
candidates = friends[person].union(*(friends[name] for name in friends[person]))
candidates -= friends[person] | {person}

Set intersection finds shared contacts. Candidate generation includes second-degree neighbors and then removes existing friends and the person being evaluated.

5. Practical workflow

Validate IDs and links, normalize the graph, create candidate sets, score candidates using a transparent rule, and inspect recommendations manually. Evaluate usefulness with a held-out or user-reviewed sample rather than assuming shared counts equal relevance.

6. Common mistakes

  • Leaking private relationship data or exposing recommendations to unauthorized users.
  • Confusing a transparent heuristic score with user preference or causal evidence.

7. Best practices

  • Keep candidate eligibility and privacy rules separate from ranking.
  • Inspect false positives and measure usefulness with consent and clear evaluation criteria.

8. Practice task

A person already follows a suggested page. What should happen before the ranking is shown?

9. One possible solution

Exclude already-followed pages from candidates, deduplicate IDs, apply access/privacy rules, then rank the remaining eligible pages.

10. Summary

Clean a community dataset and build transparent “people you may know” and “pages you may like” recommendations. Keep candidate eligibility and privacy rules separate from ranking. Inspect false positives and measure usefulness with consent and clear evaluation criteria.

11. What comes next

The next module, Project 2 - Coders of Bangalore, builds on this foundation and applies it to a new part of the analytics workflow.

Visual guide

A reliable Project 1 - Coders of Delhi workflow

  1. Step 01 Frame

    Define the question, input scope, and intended output.

  2. Step 02 Work

    Apply the method and validate assumptions as you go.

  3. Step 03 Check

    Compare results with known cases and communicate limitations.

Code examples

Count mutual contacts
PYTHON
first = {'A', 'B', 'C'}
second = {'B', 'C', 'D'}
print(len(first & second))
Expected output
2
Rank page suggestions by shared interest
PYTHON
shared_pages = {'news', 'science'}
other_pages = {'science', 'music'}
score = len(shared_pages & other_pages)
print(score)
Expected output
1

Key points

  • Clean a community dataset and build transparent “people you may know” and “pages you may like” recommendations.
  • Keep candidate eligibility and privacy rules separate from ranking.
  • Inspect false positives and measure usefulness with consent and clear evaluation criteria.

Check your understanding

Practice

Which approach best supports a trustworthy result when working on Project 1 - Coders of Delhi?

Your learning progress

Finish this lesson