Skip to main content

```py_predpurchase```is a package for predicting online shopper purchasing intentions, containing functions to aid with data analysis processes including conducting data preprocessing as well as calculating classification metrics, cross validation scores and feature importances.The package features functions that focus mainly on analyzing the data and evaluating model performance.

Project description

py_predpurchase

codecov

py_predpurchase is a package for predicting online shopper purchasing intentions, whether an online shopper will make a purchase from their current browsing session or not. This package contains functions to aid with the data analysis processes including conducting data preprocessing as well as calculating classification metrics, cross validation scores and feature importances.

Full Documentation hosted on Read the Docs: https://py-predpurchase.readthedocs.io/en/latest/index.html

Installation

$ pip install py_predpurchase

Usage

py_predpurchase can be used to:

  • Apply preprocessing transformations to the data, including scaling, encoding, and passing through features as specified.
  • Calculate the cross validation results for a four common off-the-shelf models (Dummy, KNN, SVM and RandomForests)
  • Fit a given model, and extract feature importances, sorted in descending order, and returns them as a DataFrame.
  • Calculate the classification metrics for model predictions including precision, recall, accuracy and F1 scores.

Please refer to the 'Example usage' page on the Read the Docs package documentation for a step by step, demonstration of each function in this package.

Below is an example usage for one of our functions, calculate_classification_metrics

import numpy as np
from py_predpurchase.function_classification_metrics import calculate_classification_metrics

# dummy data
y_true = [1,0,1,1,1,0,0,1,0,1]
y_pred = [1,1,1,0,1,0,0,1,0,0]

# using the function
calculate_classification_metrics(y_true, y_pred)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

py_predpurchase was created by Nour Abdelfattah, Sana Shams, Calvin Choi, Sai Pusuluri. It is licensed under the terms of the MIT license.

Other packages

pandas: While Pandas is an extensive tool for data manipulation, py_predpurchase specializes in e-commerce analytics, offering tailored functionalities that go beyond general data handling. It includes advanced features for importing e-commerce datasets, detecting unique shopping-related variables etc.py_predpurchase is for refined insights that are specifically geared towards optimizing online shopping platforms and driving sales.

scikit-learn: Scikit-learn excels in model building, but py_predpurchase extends its offerings by providing advanced tools for interpreting model outcomes. Unlike scikit-learn's broader approach, our package includes specific methods for detailing the impact of each predictor on the purchasing decision, allowing for a deeper understanding of model dynamics and more accurate validation scores. py_predpurchase benefits from these specialized insights and improve your model's predictive performance in the context of online shopping.

Credits

py_predpurchase was created with cookiecutter and the py-pkgs-cookiecutter template.

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

py_predpurchase-0.1.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

py_predpurchase-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file py_predpurchase-0.1.3.tar.gz.

File metadata

  • Download URL: py_predpurchase-0.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for py_predpurchase-0.1.3.tar.gz
Algorithm Hash digest
SHA256 696ac632616871c476c98bc191fff867af14d5ddeae6313d0a2c78fcd235b61e
MD5 67343b377c807931726a55955d8e5348
BLAKE2b-256 897b520378f35224e92211fa22ff52e5c09654f7ff3b7d79d08c446e09b43e9d

See more details on using hashes here.

File details

Details for the file py_predpurchase-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for py_predpurchase-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff5df00dc410e7c951929b3b25d763e48757522fe930abeea3051b1ef21f7165
MD5 130a1b3da8d9a3c992d31a55e415e2b0
BLAKE2b-256 fc1ec7cbc444030ec25de34d863935e26e902cc7eb606d9761726d5c7260dde0

See more details on using hashes here.

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