classgraphic

Interactive classification diagnostic plots

https://github.com/dionresearch/classgraphic

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.5%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Interactive classification diagnostic plots

Basic Info
  • Host: GitHub
  • Owner: dionresearch
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 1.28 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 5
  • Releases: 1
Created over 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License Citation Authors

README.md

classgraphic

made-with-python image Dev Binder

Interactive classification diagnostic plots for scikit-learn.

coin sorting machine

We classify things for the purpose of doing something to them. Any classification which does not assist manipulation is worse than useless. - Randolph S. Bourne, "Education and Living", The Century Co (April 1917)

Major features:

Plotly based tables for:

  • classimbalancetable
  • classification_table
  • confusionmatrixtable
  • describe (dataframe stats)
  • prediction_table
  • table

And the following charts:

  • class_imbalance
  • class_error
  • det
  • feature_importance
  • missing
  • precision_recall
  • roc
  • prediction_histogram
  • threshold

For clustering: - Delauney triangulations - Voronoi tessalations

Try it

Binder

By trying it on binder, you'll see all the details and interactivity. The quickstart below has static images, but if you run these commands in a jupyter notebook, ipython or IDE you will be able to interact with them.

Quickstart

```python from classgraphic.essential import *

loading the data

df = px.data.iris()

let's see what kind of data we have

describe(df, transpose=True).show() ![dataframe describe tale](https://github.com/dionresearch/classgraphic/raw/main/docs/source/describe.png) python

any missing?

missing(df) ![dataframe describe tale](https://github.com/dionresearch/classgraphic/raw/main/docs/source/missing.png) python

features

X = df.drop(columns=["species", "species_id"])

target

y = df["species"]

Let's check our classes we will be training on and predicting

classimbalancetable(y, condition="all") ![dataframe describe tale](https://github.com/dionresearch/classgraphic/raw/main/docs/source/imbalance_table.png) python

train / test split

Xtrain, Xtest, ytrain, ytest = traintestsplit( X, y, testsize=0.5, randomstate=random_state )

we want to see total count for each, default for bars is to be stacked, so that works

we could also pass to class_imbalance barmode="overlay" if we prefer

classimbalance(ytrain, y_test, condition="train,test") ![dataframe describe tale](https://github.com/dionresearch/classgraphic/raw/main/docs/source/class_imbalance.png) python

model

model = LogisticRegression(maxiter=maxiter, randomstate=randomstate) model.fit(Xtrain, ytrain)

predictions

yscore = model.predictproba(Xtest) ypred = model.predict(X_test)

confusionmatrixtable(model, ytest, ypred).show() classificationtable(model, ytest, ypred) ![dataframe describe tale](https://github.com/dionresearch/classgraphic/raw/main/docs/source/confusion.png) ![dataframe describe tale](https://github.com/dionresearch/classgraphic/raw/main/docs/source/classification_table.png) python featureimportance(model, y, transpose=True) ``` dataframe describe tale

This concludes the quickstart. There are many more visualizations and tables to explore.

See the notebooks and docs folders on github and the documentation web site for more information.

Requirements

  • Python 3.8 or later
  • numpy
  • pandas
  • plotly>=5.0
  • scikit-learn
  • nbformat

Install

If you use conda, create an environment named classgraphic, then activate it:

  • in Linux: source activate pilot

  • In Windows: conda activate pilot

If you use another environment management create and activate your environment using the normal steps.

Then execute:

sh python setup.py install

or for installing in development mode:

sh python -m pip install -e . --no-build-isolation

or alternatively

sh python setup.py develop

To install from github instead: shell pip install git+https://github.com/dionresearch/classgraphic

See also

  • stemgraphic python package for visualization of data and text
  • Hotelling one and two sample Hotelling T2 tests, T2 and f statistics and univariate and multivariate control charts and anomaly detection

Citation (CITATION.cff)

cff-version: 1.1.0
message: If you use this software, please cite it as below.
authors:
  - family-names: Dion
    given-names: Francois
title: ClassGraphic
abstract: "ClassGraphic implements interactive classification diagnostic plots"
version: 0.2.0
date-released: 2022-09-18

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 21
  • Total Committers: 1
  • Avg Commits per committer: 21.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 5
  • Committers: 1
  • Avg Commits per committer: 5.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
fdion f****n@d****m 21
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 6
  • Total pull requests: 4
  • Average time to close issues: 1 day
  • Average time to close pull requests: about 1 month
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fdion (6)
Pull Request Authors
  • fdion (4)
Top Labels
Issue Labels
CI (2) bug (1) enhancement (1)
Pull Request Labels
bug (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 289 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: classgraphic

Interactive classification diagnostic plots

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 289 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 16.6%
Average: 24.7%
Forks count: 30.5%
Dependent repos count: 30.6%
Stargazers count: 39.1%
Maintainers (1)
Last synced: 8 months ago

Dependencies

requirements.txt pypi
  • numpy *
  • pandas *
  • plotly >=5.0
  • scikit-learn *
.github/workflows/dev.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
  • peaceiris/actions-gh-pages v3 composite
binder/environment.yml pypi
environment.yml pypi
setup.py pypi