Skip to main content

Package to build predictive models using logistic regression

Project description

https://img.shields.io/pypi/v/pythonpredictions-cobra.svg https://img.shields.io/pypi/dm/pythonpredictions-cobra.svg https://github.com/PythonPredictions/cobra/actions/workflows/development_CI.yaml/badge.svg?branch=develop

cobra

materiallogo.png

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.

Main Features

  • Prepare a given pandas DataFrame for predictive modelling:

    • partition into train/selection/validation sets

    • create bins from continuous variables

    • regroup categorical variables based on statistical significance

    • replace missing values and

    • add columns with incidence rate per category/bin

  • Perform univariate feature selection based on AUC

  • Compute correlation matrix of predictors

  • Find the suitable variables using forward feature selection

  • Evaluate model performance and visualize the results

Getting started

These instructions will get you a copy of the project up and running on your local machine for usage, development and testing purposes.

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:

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.

Installation

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.

Help and Support

Documentation

Outreach

  • Check out the Data Science Leuven Meetup talk by one of the core developers (second presentation)

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

pythonpredictions-cobra-1.0.2.tar.gz (31.6 kB view details)

Uploaded Source

Built Distribution

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

pythonpredictions_cobra-1.0.2-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file pythonpredictions-cobra-1.0.2.tar.gz.

File metadata

  • Download URL: pythonpredictions-cobra-1.0.2.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for pythonpredictions-cobra-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3af4ba24ffa871d1d1dc07a493f668b17fed09741a3f89519ba2bf172cc8fe42
MD5 25c041aa2c0f154216313563941ff221
BLAKE2b-256 f951d90d68272c93aca24788ec577ccb84b83fd3a23c3b7c8a9d32e6627e4562

See more details on using hashes here.

File details

Details for the file pythonpredictions_cobra-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pythonpredictions_cobra-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for pythonpredictions_cobra-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb3b4e044d970df7aee32be6458c057d08850f1c56116bf19ade9c6d9cfd8b63
MD5 edf85312e72b732a6beac8f81fc8c06a
BLAKE2b-256 2322da0b0da8771227f56d6c38bd6969784bff1d6354d2ef5c6d16420537767b

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