All Relevant Feature Selection Generator Library (ARFS-Gen)
This repository contains a python library to generate synthetic (toy) data for use in research papers when evaluating all relevant feature selection e.g. used in fri.
It allows creating datasets with a specified number of strongly and weakly relevant features as well as random noise features.
In the newest revision it also includes methods which generate data with privileged information.
It works by utilizing existing methods from numpy and scikit-learn.
Install
The library is available on PyPi.
Install via pip:
pip install arfs_gen
or clone this repository and use:
pip install .
Usage
In the following we generate a simple regression data set with a mix of strongly and weakly relevant features:
# Import relevant method
from arfs_gen import genRegressionData
# Import model
from sklearn.svm import LinearSVR
# Specify parameters
n = 100
# Features
strRel = 2
strWeak = 2
# Overall number of features (Rest will be filled by random features)
d = 10
# Generate the data
X, y = genRegressionData(
n_samples=n,
n_features=d,
n_redundant=strWeak,
n_strel=strRel,
n_repeated=0,
noise=0,
)
# Fit a model
linsvr = LinearSVR()
linsvr.fit(X, y)
Development
For dependency management we use the newly released poetry tool.
If you have poetry installed, use
$ poetry install
inside the project folder to create a new venv and to install all dependencies.
To enter the newly created venv use
$ poetry env
to open a new shell inside.
Or alternatively run commands inside the venv with poetry run ....
Test
Test it by running poetry run pytest.
Release files for arfs_gen 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arfs_gen-1.2.1.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arfs_gen-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / arfs_gen-1.2.1.tar.gz
| Download URL | arfs_gen-1.2.1.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9904cd933f829b9b929f160919cec1410ca5c31b2c234a93c210ed6958b663a
|
|
BLAKE2b-256 checksum How to use checksums |
9c996f7373bd3736a9920a07f30d44f54eae5142d6d56aa27fd77fe826a71dbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1018-azure
|
Release files / arfs_gen-1.2.1-py3-none-any.whl
| Download URL | arfs_gen-1.2.1-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7cf151e970407e795ee6502b0dc97a7b31fbfd026bb77693dd8345fbbb84f54
|
|
BLAKE2b-256 checksum How to use checksums |
96ccd54171261c17d25afea328a2eaf9d1fbf7819c9b3cf8f666ba4bacdebdb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1018-azure
|