Skip to main content

No project description provided

Project description

fsam

fsam is a Python module to perform feature selection in additive models. It is assumed that the smooth components to be estimated are defined through a reduced-rank basis (B−splines) and fitted via a penalized splines approach (P−splines). Our variable selection approach is based on selecting the best subset of features of a given size, taking into account that each of the features can enter in the model as linear, non-linear, or both. This cardinality-constrained problem is stated as a mixed-integer quadratic programming (MIQP) model. We develop a framework to compute tight bounds for the regression coefficients to the case of additive models. A heuristic approach based on the large neighborhood search metaheuristic and that exploits the exact formulation of the problem is developed, thus yielding a matheuristic. Moreover, a method to build a warm-start solution is also developed by combining additive models and group lasso.

Solving the optimization problems is done using GUROBI optimization software.

Project structure

The current version of the project is structured as follows:

  • fsam: the main directory of the project, which consist of:
    • fsam_fit: contains the feature selection algorithm.
    • penalized_group_lasso: contains our warm-start approach.
    • sop: contains the methodology for estimating the smoothing parameters.
  • data: a folder containing CSV files used in the real data numerical experiments.
  • examples: a directory containing multiple numerical experiments.
  • img: contains some images.
  • tests: a folder including tests for the main methods of the project.

Package dependencies

fsam mainly depends on the following packages:

GUROBI requires a license to be used. For research or educational purposes, a free yearly and renewable academic license is offered by the company.

Installation

  1. To clone the repository on your own device, use
git clone https://github.com/ManuelNavarroGarcia/fsam.git
cd fsam
  1. To install the dependencies, there are two options according to your installation preferences:
  • Create and activate a virtual environment with conda (recommended)
conda env create -f env.yml
conda activate fsam
  • Install the setuptools dependencies via pip
pip install -r requirements.txt
pip install -e .[dev]
  1. If neccessary, add version requirements to existing dependencies or add new ones on setup.py. Then, update requirements.txt file using
pip-compile --extra dev > requirements.txt

and update the environment with pip-sync. Afterwards, the command

pip install -e .[dev]

needs to be executed.

Testing

The repository contains a folder with unit tests to guarantee the main methods meets their design and behave as intended. To launch the test suite, it is enough to enter pytest. If only one test file wants to be run, the syntax is given by

pytest tests/test_<file_name>.py

Contributing

Contributions to the repository are welcomed! Regardless of whether it is a small fix on the documentation or a notable feature to be included, I encourage you to develop your ideas and make this project greater. Even suggestions about the code structure are highly appreciated. Furthermore, users participating on these submissions will figure as contributors on this main page of the repository.

There are many ways you can contribute on this repository:

  • Discussions. To ask questions you are wondering about or share ideas, you can enter an existing discussion or open a new one.

  • Issues. If you detect a bug or you want to propose an enhancement of the current version of the code, a issue with reproducible code and/or a detailed description is highly appreciated.

  • Pull Requests. If you feel I am missing an important feature, either in the code or in the documentation, I encourage you to start a pull request developing this idea. Nevertheless, before starting any major new feature work, I suggest you to open an issue or start a discussion describing what you are planning to do. Recall that, before starting a pull request, all unit test must pass on your local repository.

Contact Information and Citation

If you have encountered any problem or doubt while using fsam, please feel free to let me know by sending me an email:

Acknowledgements

Throughout the developing of this project I have received strong support from various individuals. I would like to thank my PhD supervisors, Professor Vanesa Guerrero and Professor María Durbán, whose insightful comments and invaluable expertise has given way to many of the current functionalities of the repository.

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

fsam-0.1.1.tar.gz (266.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fsam-0.1.1-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

Details for the file fsam-0.1.1.tar.gz.

File metadata

  • Download URL: fsam-0.1.1.tar.gz
  • Upload date:
  • Size: 266.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for fsam-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a795e6bd480c25905654af6f713285fdef6f18d699920337806029c92536805c
MD5 ffc2ba03ee2a0bd80309a108b48696b2
BLAKE2b-256 017dab16e9b2823276b7a8e6f3f68026b912f36770cdd37c1e5d7bad5a0b44d5

See more details on using hashes here.

File details

Details for the file fsam-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fsam-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for fsam-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76b660404a612087734b7684de73e9569cef24e0dc6e85653785a832de4e6913
MD5 e51c27d66d09063cc56d4bc27968a287
BLAKE2b-256 6726201cf338bd75aab2c0538fe20ed93d6c0888071391727b345b0bdf0a3e30

See more details on using hashes here.

Supported by

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