SEO Data Science Methods That Lie Without a Sanity Check

clock Nov 01,2026
pen By SEO ANALYSER
SEO analytics sanity check-3

SEO guide

Clustering, regression and anomaly detection can all run on Search Console data. Here is what each answers, what the data limits, and where each method misleads.

Short answer

Clustering, regression and anomaly detection each answer one question, and each has a documented limit

Query clustering groups searches by similarity, regression estimates how page attributes move with position or CTR, and anomaly detection flags days that depart from a series' normal pattern. All three run on Search Console data, which is truncated to the top rows and reports position as an average. Results from these methods are best treated as prioritisation signals to be checked against a cause, not as findings.

Data

What the Search Console data limits before any model runs

The Search Analytics API exposes at most 50,000 rows per day per search type, sorted by clicks, and accepts a rowLimit from 1 to 25,000 per request, which defaults to 1,000 if it is left unset. Google states that the API does not guarantee all rows, only the top ones, and that its system may drop some data when grouping by page or query in order to calculate results in a reasonable time. Any model trained on a pull is therefore fitted to the highest-click rows, which means that conclusions about the long tail of queries rest on whatever the pull happened to include. Requests that omit dataState return only finalised data, so fresh partial days have to be requested explicitly, and the reporting lag is covered in the guide to SEO audit vs SEO reporting.

Position is reported as the topmost position occupied by a link to the property, averaged across queries, and Google states that the calculation method may change. An average of 4.0 can therefore hide a spread of positions, which matters most when position is used as a model input or an outcome.

Known inflation sits inside the series

Search Console impressions carry a documented logging error that ran from 13 May 2025 to 27 April 2026, which is covered in the guide to forecast SEO traffic. A decomposition tends to absorb such a level shift into the trend-cycle and not flag it as an anomaly, so a model built on clicks, which were not affected, is the safer starting point.

Methods

Three methods compared

MethodQuestion answeredDocumented propertyMain limit
Query clusteringWhich queries share a topicK-means needs the number of clusters; DBSCAN labels sparse points as noise; Ward linkage in agglomerative clustering works only with Euclidean distanceText similarity is not the same as search intent
RegressionWhich page attributes move with position or CTRAssumes a roughly linear relationship and errors unrelated to the predictorsPredictors are observed, not controlled, so results are associations
Anomaly detectionWhich days or pages changed unusuallyIsolation Forest flags points isolated by fewer random splits; contamination sets the thresholdThe threshold is an estimate, and a flag is not a cause
Clustering, regression and anomaly detection compared by the question each answers and its main limit

Clustering

Query clustering needs a representation before an algorithm

Queries must be turned into numeric vectors first. Term frequency weighted by inverse document frequency down-weights very common words, and character n-grams are more robust to misspellings and word variants, whereas a plain bag of words discards word order. The choice of representation decides what counts as similar, so it shapes the clusters more than the algorithm does.

K-means assumes convex, isotropic clusters, needs the number of clusters in advance and can settle in a local minimum. DBSCAN finds dense regions of any shape and marks the rest as noise, but its neighbourhood radius is described as crucial to choose appropriately. Agglomerative clustering builds a hierarchy bottom-up and allows non-Euclidean distances with single, average or complete linkage. Whichever is used, a sample of clusters should be read by hand before they drive a content plan, because similar wording can hide different intent.

Regression

Regression on ranking factors describes associations

A regression of average position or CTR on page attributes such as word count, internal links or load time estimates how each attribute moves with the outcome while the others are held constant. The model assumes a reasonable linear approximation and errors unrelated to the predictors, and the forecasting literature notes that most business data is observational, so predictor values are observed rather than controlled.

An attribute correlated with an omitted factor, such as brand demand, breaks that assumption and shifts its coefficient. Coefficients are therefore a way to rank candidates for a test, and a change made to a sample of pages with a comparison group is the evidence that an attribute matters.

Illustration of regression coefficients as associations rather than ranking factors
A coefficient is not a ranking factor

A regression on site data estimates association within that site. It cannot reveal how Google weights signals.

Anomalies

Flagging unusual days in a Search Console series

  1. 01

    Pull a daily series

    Request clicks and impressions by date with finalised data, leaving out the most recent days that are still being processed.

  2. 02

    Decompose the series

    STL splits a series into trend-cycle, seasonal and remainder components, and its robust option keeps occasional unusual points in the remainder instead of distorting the trend.

  3. 03

    Score the remainder

    Apply Isolation Forest or a simple threshold to the remainder. Inspect the score distribution before fixing the contamination value, since that value decides how many days are flagged.

  4. 04

    Check the flagged dates against Google's log, in both directions

    Google lists known logging errors that explain dips and bumps in Search Console charts, and a flagged day on that list is a reporting issue rather than a performance one. The reverse does not hold. The log covers the last 3 to 16 months only, and the impressions error described above ran for almost a year, so a date absent from the log is unconfirmed, not clean.

  5. 05

    Diagnose what remains

    Flags that survive the check go to the sequence in the guide to organic traffic decline diagnosis.

SEO Analyser

Spot changes before building a model

SEO Analyser's Traffic Analytics module merges GA4 and Search Console data in one dashboard with period-over-period comparison, which shows where a series moved before any model is fitted. Free for 7 days.

Start free trial

Frequently asked questions

Data science for SEO FAQs

How many rows can the Search Console API return?

The Search Analytics API exposes a maximum of 50,000 rows per day per search type, sorted by clicks. A single request accepts a rowLimit of up to 25,000 and defaults to 1,000 when the parameter is omitted, so larger pulls page through startRow. The documentation warns that it does not guarantee all rows, only the top ones, and Google states that its system may drop some data when grouping by page or query in order to calculate results in a reasonable time.

Does K-means need the number of clusters in advance?

Yes. The scikit-learn documentation states that K-means requires the number of clusters to be specified and points to silhouette analysis as one way to select it.

Why is a bag-of-words representation limited for queries?

It ignores word order, so queries with the same words in a different order map to identical vectors. Bigrams recover some local order but not full structure.

What does the contamination parameter do in outlier detection?

It sets the threshold applied to the raw anomaly score, so the value chosen decides how many points are flagged. Because it is an estimate of the expected outlier share, the score distribution should be inspected rather than relying on the labels alone.

How can reporting errors be separated from real anomalies?

Google's data anomalies page logs known Search Console issues from the past 3 to 16 months. Checking flagged dates against it prevents a logging error from being diagnosed as a performance problem.

Summary

Use the methods to prioritise, then verify. Cluster with a deliberate representation, treat regression output as association, flag anomalies against Google's own log, and confirm any result with a change and a comparison. The wider case for decisions grounded in site data is made in the guide to data-driven SEO.

References

Sources and further reading