Skip to main content

Downloads PyPI version License: MIT

Pywedge

Docs | GitHub

Pywedge_Demo_Heroko Web App

Pywedge-Make_Charts Heroku Web App - Demo

badge

What is Pywedge?

Pywedge is a pip installable Python package that intends to,

  1. Make multiple interactive charts in a single line of code, to enable the user to quickly read through the charts and can make informed choices in pre-processing steps

  2. Interactively preprocess the data by taking the user’s preferred choice of pre-processing techniques,

  3. Make a baseline model summary, which can return ten various baseline models & predict the standout test data from selected baseline model.

  4. Interactively select hyperparameters in a widget style tab, track the hyperparameters using MLFlow & predict on standout data.

Pywedge intends to help the user by quickly making charts, preprocessing the data and to rightly point out the best performing baseline model for the given dataset so that the user can spend quality time tuning such a model algorithm.

Installation

pip install pywedge

For JupyterLab, please run the following commands in anaconda prompt to enable required JupyterLab extensions to display interactive chart widget,

conda install -c conda-forge nodejs

jupyter labextension install @jupyter-widgets/jupyterlab-manager

jupyter labextension install jupyterlab-plotly@4.14.1

jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.14.1

Mlflow is not a hard requirement in Pywedge, this is mainly to keep the pywedge light weight for the benefit of trying pywedge in web apps like Heroku. So mlflow has to be separately installed to track the hyperparameters,

pip install mlflow

Pywedge Features

Cleans the raw data frame to fed into ML models. Following data pre_processing will be carried out,

  1. Makes 8 different types of interactive charts with interactive axis selection widgets
  2. Interactive pre-processing & 10 different baseline models
    • Missing values imputation for numeric & categorical columns
    • Standardization
    • Feature importance
    • Class oversampling using SMOTE
    • Computes 10 different baseline models
  3. Interactive Hyperparameter tuning & tracking hyperparameters using integreted MLFlow
    • Classification / Regression Hyperparameters tuning

      • Available baseline estimators for interactive hyperparameter tuning as of now, more baseline estimators will be added soon for interactive hyperparameter tunings
      Classification Regression
      Logistic Regression Linear Regression
      Decision Tree Classifier Decision Tree Regressor
      Random Forest Classifier Random Forest Regressor
      AdaBoost Classifier AdaBoost Regressor
      ExtraTrees Classifier ExtraTrees Regressor
      KNN Classifier KNN Regressor

Make_Charts()

Makes 8 different types of interactive Charts with interactive axis selection widgets in a single line of code for the given dataset.

Different types of Charts viz,

  1. Scatter Plot
  2. Pie Chart
  3. Bar Plot
  4. Violin Plot
  5. Box Plot
  6. Distribution Plot
  7. Histogram
  8. Correlation Plot

Arguments:

  1. Dataframe
  2. c = any redundant column to be removed (like ID column etc., at present supports a single column removal, subsequent version will provision multiple column removal requirements)
  3. y = target column name as a string

Returns:

Charts widget

Pywedge-Make_Charts Demo YouTube link below,

Please read about Pywedge-Make_Charts module in this article published in Analytics India Magazine.

baseline_model()

The baseline_model class starts with interactive pre-processing steps, baseline_model

Instantiate the baseline class & call the classification_summary method from baseline_model class,

blm = pw.baseline_model(train, test, c, y, type)
blm.classification_summary()

Args:

  1. train = train dataframe
  2. test = test dataframe
  3. c = any redundant column to be removed (like ID column etc., at present supports a single column removal, subsequent version will provision multiple column removal requirements)
  4. y = target column name as a string
  5. type = Classification(Default) / Regression
  • For classification - classification_summary()
  • For Regression - Regression_summary()

User Inputs:

  1. Categorical columns conversion options
    • Using Pandas Catcodes
    • Using Pandas Get Dummies
  2. Standardization Options,
    • Standard scalar
    • Minmax scalar
    • Robust Scalar
    • No Standardization
  3. For Classification, Class balance using SMOTE options
    • Yes
    • No
  4. Test Size for Train-test split
    • test size in float

Returns:

  1. Baseline models tab - Various baseline model metrics
  2. Predict Baseline model tab - User can select the preferred available baseline choices to predict

baseline_output

Pywedge_HP()

  • Introducing interactive hyperparameter tuning classes, Pywedge_HP, which has following two methods,
    • HP_Tune_Classification
    • HP_Tune_Regression

Instantiate the Pywedge_HP class & call the HP_Tune_CLassification method from Pywedge_HP class,

pph = pw.Pywedge_HP(train, test, c, y)
pph.HP_Tune_Classification()

Args:

  1. train = train dataframe
  2. test = test dataframe
  3. c = any redundant column to be removed (like ID column etc., at present supports a single column removal, subsequent version will provision multiple column removal requirements)
  4. y = target column name as a string
  • For classification - HP_Tune_Classification()
  • For Regression - HP_Tune_Regression()

HP_Tune

As seen in the above GIF, user can interactively enter hyperparameter values, without worrying about tracking the same, as the integreted MLFlow automatically takes care of tracking hyperparameter values.

Regression Hyperparameter tuning is in the same lines of above steps.

>> Pywedge Documentation

The following additions to pywedge is planned,

  • A separate method to produce good charts
  • To handle NLP column
  • To handle time series dataset
  • To handle stock prices specific analysis

Requires Python 64 bit

THIS IS IN BETA VERSION

Metadata

Release files for pywedge 0.5.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywedge 0.5.1.8
File Size Uploaded
pywedge-0.5.1.8.tar.gz 29.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pywedge 0.5.1.8
File Interpreter ABI Platform
pywedge-0.5.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 54.1 kB

Release files / pywedge-0.5.1.8.tar.gz

Download URL pywedge-0.5.1.8.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4a56c2fd1d08c90373f3dec987d662ac199d4bd41a60eb9ba25eb41c3ba56c0a
BLAKE2b-256 checksum
How to use checksums
c5577d228c571cba514828e2f4fbaed5ef06d322b465bbb5222e9e2950a43966
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.6

Release files / pywedge-0.5.1.8-py3-none-any.whl

Download URL pywedge-0.5.1.8-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
785e61026916c4bea74d302599b200b019dd2e7799abb3238519e4afadc4cb97
BLAKE2b-256 checksum
How to use checksums
dcf42d457a2fdb39b48ea78f7de6306a8d45d8c7650c8c8e2cad2dd935bad2d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.5.1.8 This release

2 release files

0.5

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page