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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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