|
1 |
| -===== |
2 |
| -cobra |
3 |
| -===== |
4 |
| - |
5 |
| -**cobra** is a Python package to build predictive models using logistic regression with a focus on performance and interpretation. It consists of several modules for data preprocessing, feature selection and model evaluation. The underlying methodology was developed at Python Predictions in the course of hundreds of business-related prediction challenges. It has been tweaked, tested and optimized over the years based on feedback from clients, our team, and academic researchers. |
6 |
| - |
7 |
| - |
8 |
| -Main Features |
9 |
| -============= |
10 |
| - |
11 |
| -- Prepare a given pandas DataFrame for predictive modelling: |
12 |
| - |
13 |
| - - partition into train/selection/validation sets |
14 |
| - - create bins from continuous variables |
15 |
| - - regroup categorical variables based on statistical significance |
16 |
| - - replace missing values and |
17 |
| - - add columns with incidence rate per category/bin |
18 |
| - |
19 |
| -- Perform univariate feature selection based on AUC |
20 |
| -- Compute correlation matrix of predictors |
21 |
| -- Find the suitable variables using forward feature selection |
22 |
| -- Evaluate model performance and visualize the results |
23 |
| - |
24 |
| -Getting started |
25 |
| -=============== |
26 |
| - |
27 |
| -These instructions will get you a copy of the project up and running on your local machine for usage, development and testing purposes. |
28 |
| - |
29 |
| -Requirements |
30 |
| ------------- |
31 |
| - |
32 |
| -This package requires the usual Python packages for data science: |
33 |
| - |
34 |
| -- numpy (>=1.19.4) |
35 |
| -- pandas (>=1.1.5) |
36 |
| -- scipy (>=1.5.4) |
37 |
| -- scikit-learn (>=0.23.1) |
38 |
| -- matplotlib (>=3.3.3) |
39 |
| -- seaborn (>=0.11.0) |
40 |
| - |
41 |
| - |
42 |
| -These packages, along with their versions are listed in ``requirements.txt`` and can be installed using ``pip``: :: |
43 |
| - |
44 |
| - |
45 |
| - pip install -r requirements.txt |
46 |
| - |
47 |
| - |
48 |
| -**Note**: if you want to install cobra with e.g. pip, you don't have to install all of these requirements as these are automatically installed with cobra itself. |
49 |
| - |
50 |
| -Installation |
51 |
| ------------- |
52 |
| - |
53 |
| -The easiest way to install cobra is using ``pip`` :: |
54 |
| - |
55 |
| - pip install -U pythonpredictions-cobra |
56 |
| - |
57 |
| -Contributing to cobra |
58 |
| -===================== |
59 |
| - |
60 |
| -We'd love you to contribute to the development of cobra! There are many ways in which you can contribute, the most common of which is to contribute to the source code or documentation of the project. However, there are many other ways you can contribute (report issues, improve code coverage by adding unit tests, ...). |
61 |
| -We use GitHub issue to track all bugs and feature requests. Feel free to open an issue in case you found a bug or in case you wish to see a new feature added. |
62 |
| - |
63 |
| -How to contribute code |
64 |
| ----------------------- |
65 |
| - |
66 |
| -The preferred way to contribute to cobra is to fork the main repository on GitHub, then submit a "pull request" (PR). The first step is to get a local development copy by installing cobra from source through the following steps: |
67 |
| - |
68 |
| -- Fork the `project repository <https://github.com/PythonPredictions/cobra>`_. For more details on how to fork a repository see `this guide <https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo>`__ |
69 |
| -- Clone your fork of cobra's repo. |
70 |
| -- Open a shell and navigate to the folder where this repo was cloned in. |
71 |
| -- Once you are in the folder, execute ``pip install --editable .``. |
72 |
| -- Create a *feature branch* to do your development. |
73 |
| -- Once your are finished developing, you can create a *pull request* from your fork (see `this guide <https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork>`__ for detailed instructions). |
74 |
| - |
75 |
| -**Notes** |
76 |
| - |
77 |
| -- Make sure to follow the *PEP 8* styleguide if you make any changes to cobra. You should also write or modify unit test for your changes. |
78 |
| -- To avoid duplicating work, it is highly recommended that you search through the issue tracker and/or the PR list. If in doubt, you can always reach out to us through email ( [email protected]) |
79 |
| - |
80 |
| -Help and Support |
81 |
| -================ |
82 |
| - |
83 |
| -Documentation |
84 |
| -------------- |
85 |
| - |
86 |
| -- HTML documentation of the `individual modules <https://pythonpredictions.github.io/cobra.io/docstring/modules.html>`_ |
87 |
| -- A step-by-step `tutorial <https://pythonpredictions.github.io/cobra.io/tutorial.html>`_ |
| 1 | + |
| 2 | + |
| 3 | +.. image:: https://img.shields.io/pypi/v/pythonpredictions-cobra.svg |
| 4 | + :target: https://pypi.org/project/pythonpredictions-cobra/ |
| 5 | +.. image:: https://img.shields.io/pypi/dm/pythonpredictions-cobra.svg |
| 6 | + :target: https://pypistats.org/packages/pythonpredictions-cobra |
| 7 | +.. image:: https://github.com/PythonPredictions/cobra/actions/workflows/development_CI.yaml/badge.svg?branch=develop |
| 8 | + :target: https://github.com/PythonPredictions/cobra/actions/workflows/development_CI.yaml |
| 9 | + |
| 10 | +------------------------------------------------------------------------------------------------------------------------------------ |
| 11 | + |
| 12 | +===== |
| 13 | +cobra |
| 14 | +===== |
| 15 | +.. image:: material\logo.png |
| 16 | + :width: 300 |
| 17 | + |
| 18 | +**cobra** is a Python package to build predictive models using linear/logistic regression with a focus on performance and interpretation. It consists of several modules for data preprocessing, feature selection and model evaluation. The underlying methodology was developed at Python Predictions in the course of hundreds of business-related prediction challenges. It has been tweaked, tested and optimized over the years based on feedback from clients, our team, and academic researchers. |
| 19 | + |
| 20 | +Main Features |
| 21 | +============= |
| 22 | + |
| 23 | +- Prepare a given pandas DataFrame for predictive modelling: |
| 24 | + |
| 25 | + - partition into train/selection/validation sets |
| 26 | + - create bins from continuous variables |
| 27 | + - regroup categorical variables based on statistical significance |
| 28 | + - replace missing values and |
| 29 | + - add columns with incidence rate per category/bin |
| 30 | + |
| 31 | +- Perform univariate feature selection based on AUC |
| 32 | +- Compute correlation matrix of predictors |
| 33 | +- Find the suitable variables using forward feature selection |
| 34 | +- Evaluate model performance and visualize the results |
| 35 | + |
| 36 | +Getting started |
| 37 | +=============== |
| 38 | + |
| 39 | +These instructions will get you a copy of the project up and running on your local machine for usage, development and testing purposes. |
| 40 | + |
| 41 | +Requirements |
| 42 | +------------ |
| 43 | + |
| 44 | +This package requires the usual Python packages for data science: |
| 45 | + |
| 46 | +- numpy (>=1.19.4) |
| 47 | +- pandas (>=1.1.5) |
| 48 | +- scipy (>=1.5.4) |
| 49 | +- scikit-learn (>=0.23.1) |
| 50 | +- matplotlib (>=3.3.3) |
| 51 | +- seaborn (>=0.11.0) |
| 52 | + |
| 53 | + |
| 54 | +These packages, along with their versions are listed in ``requirements.txt`` and can be installed using ``pip``: :: |
| 55 | + |
| 56 | + |
| 57 | + pip install -r requirements.txt |
| 58 | + |
| 59 | + |
| 60 | +**Note**: if you want to install cobra with e.g. pip, you don't have to install all of these requirements as these are automatically installed with cobra itself. |
| 61 | + |
| 62 | +Installation |
| 63 | +------------ |
| 64 | + |
| 65 | +The easiest way to install cobra is using ``pip``: :: |
| 66 | + |
| 67 | + pip install -U pythonpredictions-cobra |
| 68 | + |
| 69 | +Contributing to cobra |
| 70 | +===================== |
| 71 | + |
| 72 | +We'd love you to contribute to the development of cobra! There are many ways in which you can contribute, the most common of which is to contribute to the source code or documentation of the project. However, there are many other ways you can contribute (report issues, improve code coverage by adding unit tests, ...). |
| 73 | +We use GitHub issue to track all bugs and feature requests. Feel free to open an issue in case you found a bug or in case you wish to see a new feature added. |
| 74 | + |
| 75 | +For more details, check our `wiki <https://github.com/PythonPredictions/cobra/wiki/Contributing-guidelines-&-workflows>`_. |
| 76 | + |
| 77 | +Help and Support |
| 78 | +================ |
| 79 | + |
| 80 | +Documentation |
| 81 | +------------- |
| 82 | + |
| 83 | +- HTML documentation of the `individual modules <https://pythonpredictions.github.io/cobra.io/docstring/modules.html>`_ |
| 84 | +- A step-by-step `tutorial <https://pythonpredictions.github.io/cobra.io/tutorial.html>`_ |
| 85 | + |
| 86 | +Outreach |
| 87 | +------------- |
| 88 | + |
| 89 | +- Check out the Data Science Leuven Meetup `talk <https://www.youtube.com/watch?v=w7ceZZqMEaA&feature=youtu.be>`_ by one of the core developers (second presentation) |
0 commit comments