Set Covering Machine is a binary classification algorithm
Project description
Set Covering Machine
The Set Covering Machine is a learning algorithm for binary classification. The classifier is a solution of the set cover problem minimizing the empirical risk.
This implementation follow the idea presented in the original paper:
So the sets are balls generated from the training set and the set cover problem is solved using greedy algorithm (Chvátal, 1979), accordingly to the paper. Sets can be combined in conjunction or disjunction and this can be specified using the parameter machine_type.
How to install
You can install the package using pip:
pip install scmpy
Example
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_circles
from scmpy import SCM
# make some artificial data
X, y = make_circles(n_samples=200, noise=0.2, factor=0.5, random_state=666)
# split data in train and test
X_train, X_test, y_train, y_test = \
train_test_split(X, y, test_size=.3, random_state=7)
scm = SCM(machine_type="disjunction")
# fit the model
scm.fit(X_train, y_train)
# now the model is fitted, we can predict values
# print accuracy
print(scm.score(X_test, y_test))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file scmpy-0.1.2.tar.gz
.
File metadata
- Download URL: scmpy-0.1.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3319735ae165be289994bf37d6ff2f8e8e9e2d1949b6edf0cad7e94e01d810e8 |
|
MD5 | 15987ded7e781cc11480711d996e8af0 |
|
BLAKE2b-256 | 27ea1246bc2bf99b693121de632837b012f2760ca1efd7c564d20c76e5ca3cec |