Multiple instance learning via embedded instance selection
Project description
Multiple instance learning via embedded instance selection
This python package is an implementation of MILES: Multiple-instance learning via embedded instance selection from IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 28, NO. 12, DECEMBER 2006.
The paper describes a method to encode bag-space features into a space defined by the most-likely-cause-estimator of the bag and training feature space.
The most likely cause estimator is defined as
An example encoding
Look at embedding_test.py
for an example embedding of dummy data.
Dummy data is created from 5 normal distributions, and each instance is generated by one of the following two-dimensional probability distributions:
N1([5,5]^T, I), -> The normal distribution with mean [5,5] and 1 unit standard deviation N2([5,-5]^T, I), N3([-5,5]^T, I), N4([-5,-5]^T, I), N5([0,0]^T, I)
Bags are created from a variable number of instances per bag, and this example uses 8. A bag is labeled positive if it contains instances from at least two different distributions among N1, N2, and N3. Otherwise the bag is negative. This image displays the raw 2-dimensional data
A single bag is of shape (N_INSTANCES, FEATURE_SPACE)
where n is the number of instances in a bag, and p is the feature space of the instances.
All positive bags are of shape (N_POSITIVE_BAGS, N_INSTANCES, FEATURE_SPACE)
where N_POSITIVE_BAGS
is the number of positive bags. Negative bags are of shape (N_NEGATIVE_BAGS, N_INSTANCES, FEATURE_SPACE)
. The total set of training instances is of shape (N_POSITIVE_BAGS + N_NEGATIVE_BAGS, N_INSTANCES, FEATURE_SPACE)
.
A single bag is embedded into a vector of shape ((N_POSITIVE_BAGS + N_NEGATIVE_BAGS) * N_INSTANCES)
, which is the total number of instances from all positive and negative bags.
In this example let When projecting the training instances onto the vectors
# Feature vectors close to mean of `true` positive distributions
x1 = np.array([4.3, 5.2])
x2 = np.array([5.4, -3.9])
x3 = np.array([-6.0, 4.8])
the result is a (3,40) matrix which is visualized below.
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
Built Distribution
File details
Details for the file pyMILES-0.0.2.tar.gz
.
File metadata
- Download URL: pyMILES-0.0.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc3cd43e0763b2df1323d0d36e971f93c0fc98bdbd3323607c96f0f30737976 |
|
MD5 | c0b339f4f54796471210f5fe179b8a79 |
|
BLAKE2b-256 | d9979ead1f9e8074febe8e00d64a01e7caf7fc826446a99d76aedc2aee24008f |
File details
Details for the file pyMILES-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyMILES-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e01967c75531d1b225a1e75bcd161303c834723f9dddb969740f16ba5a47612 |
|
MD5 | d5b8cd9c9d72648874b61d858e04f1c8 |
|
BLAKE2b-256 | 5e997336d3e8620cc7dc1efa60b1269dbecec2a0c73ccbf63f9ec2cb6de88147 |