IMDb Data Mining & Predictive Analytics

What separates a blockbuster from a festival favorite, and what goes with winning an award? A complete data mining workflow on 21,909 IMDb titles, from clustering to association rules that become an interpretable classifier.

K-Means vs DBSCAN, live. Click for new data.
clusteranother clusternoise, for DBSCAN
0.75R² predicting audience engagement
4.36lift of the strongest award rule
81%of award winners found by the rule classifier
89.78%of K-Means "elite" titles are DBSCAN noise
7title segments discovered with K-Means
01 / The data

21,909 titles, prepared with care.

The dataset combines release dates, runtime, votes, reviews, awards, credits, title types, genres and countries for 21,909 titles, split into 16,431 for training and 5,478 for testing. Every preparation step was fitted on the training data only and then applied to the test data:

  • Missing values. Runtime placeholders became missing values imputed with the training median; missing award counts were estimated with IterativeImputer.
  • Categories. Ordinal encoding for ratings, one-hot for title types, indicators for the ten most frequent genres and countries.
  • Redundancy and skew. Pearson, Spearman and Cramér's V guided which attributes to drop; skewed counts went through log1p and standardization.
  • Outliers. Local Outlier Factor (20 neighbors, 5% contamination) removed 822 training rows, leaving 15,609 titles.
02 / Clustering

Three algorithms, three stories.

I clustered the same 11 numerical features with three methods and read every group through its original metadata: genres, title types, countries and representative titles.

MethodHow it was tunedWhat it found
K-Meansinertia and silhouette for k = 2 to 50, plus domain reading7 segments: mainstream hits, award-oriented titles, vintage cinema, shorts, television, low visibility
DBSCANk-distance curve, ε = 1.5, min 12 samples3 clusters + noise, with 1,884 titles labeled noise
Hierarchicalsingle, complete, average and Ward linkage compared on dendrograms5 Ward groups: acclaimed, popular, vintage, television, low engagement
The seven K-Means segments of IMDb titles projected onto two principal components, with the centroids marked
The seven K-Means segments on the first two principal components, centroids marked.
The most telling comparison. Of the 988 titles in the two small K-Means groups I called the "Hollywood Elite" and the "Festival Darlings", 89.78% are noise for DBSCAN. Exceptional titles form a meaningful group for a centroid-based method and are anomalies for a density-based one: the algorithm's assumptions decide the story. The demo at the top shows the same effect on toy data.
03 / Classification

Predicting the rating tier.

Ratings were grouped into three tiers, Poor (up to 6.0), Average (6.0 to 7.0) and Good (above 7.0), and predicted from 41 features. Every model was tuned with cross-validation and evaluated on the 5,478 test titles:

Test accuracybaselinetuned
K-Nearest Neighbors49 neighbors, Manhattan
55.04%
59.36%
Decision Tree
50.15%
55.66%
Gaussian Naive Bayes
54.31%

The middle tier, Average, was the hardest to separate for every model, which confusion matrices, per-class metrics and ROC curves make visible. The decision tree adds a readable view of what matters: title type, release year, genre and popularity.

04 / Association rules

From patterns to predictions.

Each title became a transaction of 61 Boolean items, from discretized numbers to genres, plus the target: at least one award win. FP-Growth with 3% minimum support produced 75 rules whose consequent is an award. One of the strongest:

Movie + Drama + very high vote count  ⇒  at least one award
confidence 57.1% · lift 4.36 · support 3.11%

Among titles matching this combination, 57.1% have won an award, against about 13.1% overall. I then turned the rules into a custom rule-based classifier: a title is predicted as a winner when a qualifying rule matches it, and a confidence threshold controls how selective the rules are.

Minimum rule confidencePrecisionRecallF1
25%: broad screening17.95%81.11%0.29
50%: selective40.36%39.53%0.40

Award-winner class on the test set. The screening setting finds 554 of the 683 winners; the selective one more than doubles precision.

pattern_mining.ipynb · RuleBasedClassifierV2
class RuleBasedClassifierV2:    """    Version 2 of the classifier: a confidence threshold    makes the model more selective.    """    def __init__(self, rules, confidence_threshold=0.0):        self.rules = rules.copy()        self.rules['antecedents'] = self.rules['antecedents'].apply(lambda x: frozenset(x))        self.confidence_threshold = confidence_threshold    def predict(self, X_trans):        """ Predicts on a transactional DataFrame. """        predictions = []        for i, row in X_trans.iterrows():            transaction_items = set(row[row].index)            prediction = False            for _, rule in self.rules.iterrows():                # a rule fires only if it matches the title and its confidence is high enough                if rule['antecedents'].issubset(transaction_items) and rule['confidence'] >= self.confidence_threshold:                    prediction = True                    break            predictions.append(prediction)        return pd.Series(predictions, index=X_trans.index)
From the notebook, with the comments translated into English and the printing removed.
05 / Regression

Predicting audience engagement.

The last task predicts the number of user reviews (log-transformed and standardized) from one predictor, the vote count, and then from six: votes, critic reviews, regions, award nominations, credits and award wins.

RegressorR², 1 predictorR², 6 predictorsMAERMSE
Linear Regression0.64020.72310.38830.5247
Decision Tree0.68930.74370.36360.5049
K-Nearest Neighbors0.68460.74790.36280.5007
Actual versus predicted engagement for linear regression, decision tree and k-nearest neighbors with six predictors
Actual versus predicted engagement with six predictors: R² 0.7231, 0.7437 and 0.7479.

Five stages, one workflow.

The report and the nine notebooks document every step, from data understanding to the rule-based classifier and the regression comparison.

Next project · 03 / 05Secure Data Container in Java