Skip to main content

Structured Ensemble Learning

Project description

Meta-Network

Travis Codecov GitHub

Meta-Network is an approach to ensemble learning where base learners are not constrained to the same task but rather take on distinct roles in the ensemble. Commonly, ensembles of classifiers do not have a distinction in each base learner's role. While each base learner may be diversified through bootstrapping or use of different parameters/models, their objectives are universally the same: classify its input to the best of its ability. Stacking and meta-classifiers introduce a sense of roles but each layer retains the same objective. Meta-Networks, however, remove this universal objective. By training the ensemble as a whole unit through backpropagation, each base learner may learn different objectives that orchestrate together to produce the ultimate objective, resulting in greater capacity for higher performance and solutions for complex problems.

This package hosts the basic meta-network model as well as additional implementations of the principle.

More details regarding Meta-Networks can be found in the documentation here.

Installation

Once you have a suitable python environment setup, metanetwork can be easily installed using pip:

pip install metanetwork

metanetwork is tested and supported on Python 3.4 up to Python 3.8. Usage on other versions of Python is not guaranteed to work as intended.

Usage

Meta-Networks are quite simple to use, although they do need some encouragement by creating the meta-network structure first. They generally follow sklearn API style.

from metanetwork import MetaNetwork, NeuralNetwork

# Create ensemble with a first layer of 3 estimators and a final layer of 1 estimator
estimators = [NeuralNetwork(), NeuralNetwork(), NeuralNetwork(), NeuralNetwork()]
for e in estimators[:-1]:
	e.n_classes_ = 2 	# Each estimator in the first layer produces 2 outputs
e[-1].n_classes_ =  4 		# The final estimator produces the 4 class outputs
network = [estimators[:-1], estimators[-1:]]

# Create and train the metanetwork
mn = MetaNetwork(network).fit(train_X, train_Y)

# Predict some data
p = mn.predict(test_X)

For full details on usage, see the documentation.

Changelog

See the changelog for a history of notable changes to metanetwork.

Development

Code Climate maintainability

metanetwork is in heavy development. Don't look, it's embarrassing!

Help and Support

Documentation

Documentation for metanetwork can be found here.

Issues and Questions

Issues and Questions should be posed to the issue tracker here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metanetwork-0.1.0.tar.gz (27.0 kB view hashes)

Uploaded Source

Built Distribution

metanetwork-0.1.0-py3-none-any.whl (35.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page