Universe of Ideas
Artificial Intelligence

Not Every Model Needs to Know Everything: Introducing MPML for Python

Because even machine learning models work better when they stop trying to be experts in everything.

STM

Dr. Sean T. Miller

4 Dec 2026 · 4 min read

Not Every Model Needs to Know Everything: Introducing MPML for Python

There's something rather amusing about building a machine learning ensemble. We gather several algorithms, feed them the same features, ask them the same question and hope that, somehow, they will provide meaningfully different insights.

It's like assembling a panel of experts, giving everyone the same job description and wondering why the meeting could have been an email.

But what if each model could specialise in a different aspect of the problem?

That's the idea behind MPML (Multi-Perspective Machine Learning), a Python package I've developed for perspective-based ensemble learning and model interpretability.

One Dataset, Multiple Perspectives

Real-world problems are rarely one-dimensional.

Consider heart disease prediction. A dataset might contain demographic information, lifestyle habits and clinical measurements. Rather than requiring every classifier to consider every feature, MPML allows different models to specialise in different aspects of the problem.

Illustrative example of a multi-perspective ensemble for heart disease prediction.

Each perspective can have its own:

  • Machine learning algorithm.
  • Subset of features.
  • Voting weight.

Features can even be shared across perspectives. There's no need to start a custody battle over a DataFrame column.

The objective is to encourage meaningful diversity among classifiers by exploiting the different characteristics of a problem.

Each perspective can have its own:

  • Machine learning algorithm.
  • Subset of features.
  • Voting weight.

Features can even be shared across perspectives. There's no need to start a custody battle over a DataFrame column. The objective is to encourage meaningful diversity among classifiers by exploiting the different characteristics of a problem.

Six Ways to Make Your Models Agree (Sort Of)

StrategyWhat it does
Majority VotingLets the models vote. Democracy for algorithms.
Weighted CombinationGives selected models greater influence. Not quite democracy.
BlendingUses a holdout dataset to train a meta-model.
StackingTrains a meta-model using cross-validated predictions.
BaggingBuilds bootstrap-based ensembles for each perspective.
BoostingBuilds AdaBoost-based ensembles for each perspective.


The beauty is that you can experiment with these strategies while maintaining the same familiar fit() and predict() interface.

No need to rewrite half your code because you've suddenly developed an interest in stacking.

Getting Started

MPML is built around the familiar Python machine learning ecosystem: scikit-learn, pandas and NumPy.

Installation is straightforward:

Code
pip install mpml_lib

Or, if you're using uv:

Code
uv add mpml_lib

Once installed, defining perspectives and training an ensemble follows a familiar workflow.

Code
perspectives = Perspectives(X_train)

# Define the first perspective
perspectives.add(
    DecisionTreeClassifier(),
    ["age", "sex"],
    weight=1
)

# Define the second perspective
perspectives.add(
    RandomForestClassifier(),
    ["cholesterol", "blood_pressure"],
    weight=2
)

# Create and train the ensemble
ensemble = MPML(
    perspectives=perspectives,
    combination_method="stacking",
    meta_model=LogisticRegression()
)

ensemble.fit(X_train, y_train)
predictions = ensemble.predict(X_test)

That's it. Two classifiers examining different aspects of the same problem, with a meta-model learning how to combine their predictions.

Because "The Model Said So" Is Not an Explanation

Making accurate predictions is great. Understanding what influenced those predictions is considerably better.

MPML includes an interpretability framework that allows developers to investigate the impact of individual features and entire perspectives.

It supports three feature-impact analysis methods:

  • Ablation: Replace a feature with a baseline value and examine the resulting score change.
  • Background ablation: Replace a feature with sampled values from the training dataset to estimate its average impact.
  • Retraining: Remove a feature, retrain the affected model and compare the results.

You can also examine the impact of an entire perspective, either for an individual prediction or across an evaluation dataset.

Code
ensemble.set_evaluation_data(X_test, y_test)

impact = ensemble.get_global_impact(
    model_name="model2"
)

This allows us to ask not only which feature influenced a prediction? but also which perspective influenced it?

Of course, these scores measure changes in model outputs, not causality. We haven't given Python the power of divine revelation just yet.

From Research Paper to Python Package

MPML isn't simply another wrapper around scikit-learn. It is the practical implementation of a research journey that began with cybersecurity and multi-faceted learning problems and later extended into interpretable heart disease prediction.

The underlying approach is documented in two research publications:

The package brings these ideas into an accessible framework for developers, researchers and students interested in ensemble classification, feature engineering and model interpretability.

Give Your Models Some Perspective

Sometimes, improving a machine learning system isn't about adding more features, finding a more complicated algorithm or purchasing a GPU that costs more than your car.

Sometimes, it's about recognising that different aspects of a problem deserve different approaches.

Not every model needs to know everything. It just needs to know its part well.

MPML is available under the MIT licence. Install it, experiment with it and see what a different perspective can do for your machine learning projects.

Tags: Python, MPML, Machine Learning, Ensemble Learning, Explainable AI, Feature Engineering, Scikit-learn, Open Source.

Discussion · 0

Comments are closed for this article.