Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ junit/
*.mo
*.pot

# Django stuff:
# Django stuff
*.log
local_settings.py

# Flask stuff:
# Flask stuff
instance/
.webassets-cache

# Scrapy stuff:
# Scrapy stuff
.scrapy

# Sphinx documentation
Expand Down
60 changes: 22 additions & 38 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

.. image:: https://github.com/PythonPredictions/cobra/raw/master/material/logo.png
:width: 350


.. image:: https://img.shields.io/pypi/v/pythonpredictions-cobra.svg
:target: https://pypi.org/project/pythonpredictions-cobra/
Expand All @@ -9,12 +12,9 @@

------------------------------------------------------------------------------------------------------------------------------------

.. image:: C:/Users/hendrik.dewinter/PycharmProjects/cobra/material/logo.png
:width: 300

**Cobra** is a Python package to build predictive models using linear or 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.
**Cobra** is a Python package to build predictive models using linear or 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 <https://www.pythonpredictions.com>`_ 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.

Main Features
Main features
=============

- Prepare a given pandas DataFrame for predictive modelling:
Expand All @@ -23,7 +23,7 @@ Main Features
- create bins from continuous variables
- regroup categorical variables based on statistical significance
- replace missing values
- add columns with average of target values (linear regression) or incidence rate per category/bin (logistic regression)
- add columns where categories/bins are replaced with average of target values (linear regression) or with incidence rate (logistic regression)

- Perform univariate feature selection based on RMSE (linear regression) or AUC (logistic regression)
- Compute correlation matrix of predictors
Expand All @@ -38,56 +38,40 @@ These instructions will get you a copy of the project up and running on your loc
Requirements
------------

This package requires the usual Python packages for data science:

- numpy (>=1.19.4)
- pandas (>=1.1.5)
- scipy (>=1.5.4)
- scikit-learn (>=0.23.1)
- matplotlib (>=3.3.3)
- seaborn (>=0.11.0)


These packages, along with their versions are listed in ``requirements.txt`` and can be installed using ``pip``: ::

This package requires only the usual Python libraries for data science, being numpy, pandas, scipy, scikit-learn, matplotlib, seaborn, and tqdm. These packages, along with their versions are listed in ``requirements.txt`` and can be installed using ``pip``: ::

pip install -r requirements.txt


**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.
**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.

Installation
------------

The easiest way to install cobra is using ``pip``: ::
The easiest way to install Cobra is using ``pip``: ::

pip install -U pythonpredictions-cobra

Contributing to cobra
=====================

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, ...).
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.

For more details, check our `wiki <https://github.com/PythonPredictions/cobra/wiki/Contributing-guidelines-&-workflows>`_.
Documentation and extra material
=====================

Help and Support
================
- A `blog post <https://www.pythonpredictions.com/news/the-little-trick-we-apply-to-obtain-explainability-by-design/>`_ on the overall methodology.

Documentation
-------------
- A `research article <https://doi.org/10.1016/j.dss.2016.11.007>`_ by Geert Verstraeten (co-founder Python Predictions) discussing the preprocessing approach we use in Cobra.

HTML documentation of the `individual modules <https://pythonpredictions.github.io/cobra.io/docstring/modules.html>`_
- HTML documentation of the `individual modules <https://pythonpredictions.github.io/cobra.io/docstring/modules.html>`_.

**Logistic Regression**
- A step-by-step `tutorial <https://pythonpredictions.github.io/cobra/tutorials/tutorial_Cobra_logistic_regression.ipynb>`_ for **logistic regression**.

- A step-by-step tutorial `<https://pythonpredictions.github.io/cobra/docs/Cobra_Tutorial_LogisticRegression.ipynb>`_
- A step-by-step `tutorial <https://pythonpredictions.github.io/cobra/tutorials/tutorial_Cobra_linear_regression.ipynb>`_ for **linear regression**.

**Linear Regression**
- 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). His `slides <https://github.com/PythonPredictions/Cobra-DS-meetup-Leuven/blob/main/DS_Leuven_meetup_20210209_cobra.pdf>`_ and `related material <https://github.com/PythonPredictions/Cobra-DS-meetup-Leuven>`_ are also available.

- A step-by-step tutorial `<https://pythonpredictions.github.io/cobra/docs/Cobra_Tutorial_LinearRegression.ipynb>`_
Contributing to Cobra
=====================

Outreach
-------------
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, ...).
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.

- 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)
For more details, check our `wiki <https://github.com/PythonPredictions/cobra/wiki/Contributing-guidelines-&-workflows>`_.
1 change: 1 addition & 0 deletions cobra/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .version import __version__
Loading