Skip to main content

Moving Targets

Moving Targets is novel hybrid technique which can be used to inject external constraints and domain knowledge into any machine learning model. The algorithm is based on an iterative schemes that alternates between two steps: a learner step, which is in charge of training the machine learning model, and a master step, which refines the model predictions by projecting them into the feasible space, so that the model can be learnt again on these adjusted targets. Since the model is general-purpose, it can address any type of learner and constraints, given that these constraints lead to a solvable constrained optimization problem (see the original paper for details).

How To Use

You can install the Moving Targets' library via pip by pasting this command in your terminal:

pip install moving-targets

The library contains various classes and utility functions, but the core of the algorithm can be found in the MACS class, which needs both a Learner and a Master instance in order to be instantiated — additional parameters such as the initial step or a list of Metric objects may be optionally passed as well. Once the MACS object has been built, it can be used as a classical machine learning model along with its methods fit(), predict(), and evaluate().

A predefined set of learners, metrics, and callbacks can be found in the respective modules. Instead, as regards the master, you will need to extend one of the template ones in order to formulate your constrained optimization problem, even though the master formulation is facilitated by a set of predefined loss functions and backend objects that wrap some of the most famous constraint optimization solvers — e.g., Cplex, Gurobi, CvxPy, etc.

More specific tutorials to learn how to use Moving Targets can be found in the examples module.

How To Cite

If you use Moving Targets in your works, please cite the following article:

@article{Detassis2020,
  title={Teaching the Old Dog New Tricks: Supervised Learning with Constraints},
  author={Detassis, Fabrizio and Lombardi, Michele and Milano, Michela},
  journal={arXiv preprint arXiv:2002.10766},
  year={2020}
}

Contacts

Metadata

Release files for moving-targets 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moving-targets 0.4.2
File Size Uploaded
moving_targets-0.4.2.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for moving-targets 0.4.2
File Interpreter ABI Platform
moving_targets-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / moving_targets-0.4.2.tar.gz

Download URL moving_targets-0.4.2.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3cf150d6ec24aa4d755e20fc90dd2c99db0985342a096cb675f2981c17b68633
BLAKE2b-256 checksum
How to use checksums
627d4840b89ff4fa79e5612e4cf79e11cb9d170ed2d297e2f2050addaae63fe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release files / moving_targets-0.4.2-py3-none-any.whl

Download URL moving_targets-0.4.2-py3-none-any.whl
Size 66.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a03b5add6e8bd8db676beb130eeffc51837ee082031ab8eb3bd5ac88d0829a9f
BLAKE2b-256 checksum
How to use checksums
487d8b728599af8d8f9eab3f44b78c022ba631bce5d1277c46be5dba12f668be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page