Kerala Assembly Election 2026 Insights : Predictions Tab
In the previous post, I covered the Overview tab and the baseline election explorer. This post is about the Predictions tab, which is the part I built on top of that historical layer. The goal is simple: give a quick, constituency-level estimate for 2026 while still showing enough context to avoid blind trust in the output.
Why I added a predictions tab
The first version of the app was mostly retrospective. It was useful to study what happened in 2016 and 2021, but it did not answer the question most people ask first: "What might happen next?"
So I added Predictions as a separate mode, not to replace analysis, but to make it easier to:
- scan all constituencies quickly
- identify likely close contests
- compare model output with ground-level political discussion
I treat it as an interpretation tool, not a final forecast engine.
What the predictions tab shows
The tab is designed for fast reading first, detail second.
At a high level, it shows:
- predicted winning front for each constituency (
LDF,UDF,NDA) - a confidence-style signal to indicate stronger vs weaker calls
- supporting context from past election patterns
This way, I do not just see "who is predicted to win". I also see how stable or shaky that call might be.

District-wise Predictions
This section is designed as a three column layout to show district-level metrics.
On initial load, it appears as a two column layout:
- a district map on the left
- a table on the right showing the predicted list of seats, grouped and ordered by district
Check the screenshot below for a clearer idea.

This already gives a clean and useful overview, and I really liked how this part turned out. It becomes even more useful when the third column comes into play.
To explore a district in more detail, you can select it either from the map or from the table. This opens a middle column with deeper insights, including:
- number of seats won by each front in 2021
- how the seats are expected to change compared to 2021
- categorisation of seats into likely, swing, and competitive groups, shown in separate tables

Constituency-wise Predictions
This is one of the most useful parts of the web app. The interaction pattern is similar to the previous section. The main difference is that it starts with a single column view and expands into two columns when a constituency is selected. On load, the page shows a table with 10 constituencies at a time. There is also a search bar at the top to quickly find a specific constituency.
The table includes:
- constituency name
- predicted front and party
- confidence level of the prediction

Once a constituency is selected, a second column opens with detailed analytics for that constituency.
It includes:
- 01A hero section showing the probable winner along with percentage chances. A pie chart is shown alongside to compare probabilities across different fronts
- 02Historical data from 11 elections, including a chart showing wins by each front to understand long term leaning
- 03Results from the last 5 elections, including vote margin percentages for each victory
This is the section I use the most. It is especially useful for quickly understanding a constituency in context.
For example, since the election was announced, when I was talking with friends and they mention their local constituency, I quickly search for it here and get a clear idea of how that constituency usually behaves and what the current prediction looks like.

Data and model pipeline
I trained this using Kerala Assembly election data from 1977 to 2021. The dataset was sourced from Kaggle and then cleaned and transformed. An important note here is that this cleaning and transformation was not very detailed, so there will be inconsistencies that can reflect in the website. This is a 2 day hobby project, so I was okay with some imperfections.
- 01One of the biggest challenges was handling constituency changes over time. There are many constituencies that are new, renamed, or restructured. I manually mapped these cases. If a constituency was renamed, I linked them directly. If a constituency was split or reorganized, I tried to map based on where most of the area went. This is clearly not perfect and may introduce inaccuracies.
- 02A similar process was followed for political parties. Since the app works at the front level historically, party alignment becomes tricky. Parties have changed fronts, merged, split, and even changed names over time. So there was manual mapping for each election to identify which parties belonged to which front. Most of the heavy lifting was done using logic and rules, but I also did some manual quality checks. That said, the QC is not very thorough, so there is definitely room for inconsistencies.
Training footprint
- 11 election cycles
- 140 constituencies
- approximately 1,540 cleaned rows after matching and preprocessing
Target
- predict front-level winner per constituency for 2026
- output classes:
LDF,UDF,NDA
For UI clarity, the predicted front is mapped to a representative leading party label. There is a JSON file with the current list of candidates, and based on the predicted front, the corresponding party is shown as the winning party in the interface.
Feature engineering
Some additional features were added to improve accuracy. I have not done a deep analysis to validate each feature, so there could be cases of unnecessary features or even leakage.
Some of the engineered features include:
- historical front win tendency in each constituency
- previous vote share margins
- anti-incumbency tendency signals
- constituency loyalty or repeat win behavior
- front-level vote share references from 2016 and 2021
Recency weighting
The 2016 and 2021 elections are given higher weight. This is intentional because recent trends usually matter more than older cycles. At the same time, I still include long term history to provide broader context.
How I read the output in practice
I mostly use this tab in two ways:
- Pre-election scan: quickly find constituencies where the model confidence is relatively lower and mark them as "watch closely" seats.
- Live interpretation: during debates or result-day coverage, compare current narrative with historical tendency and model expectation.
For example, if a seat like Thrissur or Nemom is being discussed as a guaranteed result, I can open that constituency and check whether the long-term pattern and feature profile support that confidence.
This has been very useful for avoiding overreaction to loud but low-signal claims.
Important limitations
This is still a small-data political model, so I keep expectations realistic.
- The dataset is not rich enough for very strong statistical certainty.
- Some historical records were dropped due to constituency name/boundary inconsistencies across decades.
- Candidate-level factors for 2026 are not included in the current feature set.
- Strong local candidate effects can override constituency history.
- Anti-incumbency is modeled as a pattern tendency, not a deterministic rule.
- NDA performance may be underrepresented in places where recent momentum is not captured by available historical features.
So this should be read as a structured probability aid, not a declaration of final winners.
Why I still find it useful
Even with all the above caveats, the Predictions tab adds a lot of value because it creates disciplined curiosity.
Instead of asking only "Who is winning?", I can ask:
- how strong is this call?
- what historical factors are pushing this output?
- where could this prediction fail on ground reality?
That shift in framing is exactly why this tab exists in my app.
Closing note
This section covers the prediction side of the app. There are two more parts of the web app that I have not written about yet. I would honestly recommend just clicking around and exploring them yourself to see how things work. Not because I got tired of documenting everything… okay maybe a little… but mainly because some things are just better experienced than explained. I might add more detailed write ups later if I feel like it.
Also, a big thank you to a few of my friends. They even suggested putting it on Reddit to get some traffic and joked about monetising it. One of them suggested adding a new tab focused on current election details. That idea stuck with me, and I ended up reworking parts of the app to include a new homepage called “Election 2026”. The goal there is to make it useful for quick fact checking, spotting trends, and understanding key details about a selected constituency.
Finally, if you notice any inconsistencies or mistakes, feel free to let me know or even raise a pull request and fix it yourself. The repo should be on GitHub… unless I forgot to make it public, which is also very possible.