Skip to main content

No project description provided

Project description

Quick-Show

Contributor Covenant Python Version Pypi Version Code convention

Quick-Show helps you draw plots quickly and easily.
It is an abstraction using popular libraries such as Scikit-Learn and MatPlotLib, thus it is very light and convenient.

Note: Quick-Show is sub-modules of other packages to manage quickshow more lightly and use more widly. This is a project under development. With the end of the project, We plan to provide documents in major version 1 and sphinx. It is NOT recommended to use prior to major version 1.



Installation

$ pip install quickshow

Tutorial

  1. Main-tutorials: https://github.com/DSDanielPark/quick-show/blob/main/tutorial/tutorial.ipynb
  2. Sub-tutorial-folder: Tutorials for each function can be found in this folder. The tutorial is synchronized with the Python file name provided by QuickShow.

Features

1 Related to dimensionality reduction

2D or 3D t-SNE and PCA plots using specific columns of a refined dataframe. Create a scatter plot very quickly and easily by inputting a clean dataframe and column names that do not have missing data.

  1. vis_tsne2d: Simple visuallization of 2-dimensional t-distributed stochastic neighbor embedding
  2. vis_tsne3d: Simple visuallization of 3-dimensional t-distributed stochastic neighbor embedding
  3. vis_pca: Simple visuallization of Principal Component Analysis (PCA)

2 Related to classification model evaluation.

Later these functions are encapsulated into classes.

  1. vis_cm: Visuallization heatmap of confusion_matrix and return classification report dataframe.
  2. get_total_cr_df: When the confusion matrix dataframe created by the vis_cm function is saved as csv, the directory of the folder where these csv files exist is received as input and the confusion matrices of all csv files are merged into a single data frame.
  3. vis_multi_plot: It takes the return dataframe of get_total_cr_df as input and draws a nice plot. However, if you want to use this function, please note that the suffix of the multiple csv files input to get_total_cr_df must be exp and an integer, such as exp3, and the integers must be contiguous.

3 Related to clustering.

  1. vis_cluster_plot: Produces a plot to see how spread out the actual label values ​​are within the clusters.

4 Utils

  1. find_all_files: If you enter the top folder path as an auxiliary function, it returns a list of files including keywords while recursively searching subfolders. This is implemented with the glob package.
  2. rcparam: It simply shows some rcparams method in matploblib. Check by calling qs.rcparam?



Examples

Feature 1

See example dataframe...
import pandas as pd
df = pd.DataFrame([3,2,3,2,3,3,1,1])
df['val'] = [np.array([np.random.randint(0,10000),np.random.randint(0,10000),np.random.randint(0,10000)]) for x in df[0]]
df.columns = ['labels', 'values']
print(df)
labels values
0 3 [8231 3320 6894]
1 2 [3485 7 7374]
... ... ...
6 1 [5218 9846 2488]
7 1 [6661 5105 136]
from quickshow import vis_tsne2d, vis_tsne3d, vis_pca

return_df = vis_tsne2d(df, 'values', 'labels', True, './save/fig1.png')
return_df = vis_tsne3d(df, 'values', 'labels', True, './save/fig2.png')
return_df = vis_pca(df, 'values', 'labels', 2, True, './save/fig3.png')
return_df = vis_pca(df, 'values', 'labels', 3, True, './save/fig4.png')
See output figure...

  • All function returns the dataframe which used to plot. Thus, use the returned dataframe object to customize your plot. Or use matplotlib's rcparam methods.
  • If the label column does not exist, simply enter None as an argument.
  • For more details, please check doc string.

Feature 2

See example dataframe...
import pandas as pd
label_list, num_rows = ['cat', 'dog', 'horse', 'dorphin'], 300
df = pd.DataFrame([label_list[np.random.randint(4)] for _ in range(num_rows)], columns=['real'])
df['predicted'] = [label_list[np.random.randint(4)] for _ in range(num_rows)]  
print(df)
real predicted
0 cat cat
1 horse cat
... ... ...
7 horse dog
299 dorphin horse
from quickshow import vis_cm

df_cr, cm = vis_cm(df, 'real', 'predicted', 'vis_cm.csv', 'vis_cm.png')
See output...
print(df_cr)
cat dog dorphin horse accuracy macro avg weighted avg
precision 0.304878 0.344828 0.285714 0.276316 0.3 0.302934 0.304337
recall 0.328947 0.246914 0.328767 0.3 0.3 0.301157 0.3
f1-score 0.316456 0.28777 0.305732 0.287671 0.3 0.299407 0.299385
support 76 81 73 70 0.3 300 300

confusion matirx will be shown as below.

  • This function return pandas.DataFrame obejct of classification report and confusion metix as shown below.


Use Case

[1] Korean-news-topic-classification-using-KO-BERT: all plots were created through Quick-Show.

References

[1] Scikit-Learn https://scikit-learn.org
[2] Matplotlib https://matplotlib.org/

Contacts

Project Owner(P.O): Daniel Park, South Korea e-mail parkminwoo1991@gmail.com
Maintainers: Daniel Park, South Korea e-mail parkminwoo1991@gmail.com

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

quickshow-0.1.5.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

quickshow-0.1.5-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

quickshow-0.1.5-py2.py3-none-any.whl (1.1 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file quickshow-0.1.5.tar.gz.

File metadata

  • Download URL: quickshow-0.1.5.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for quickshow-0.1.5.tar.gz
Algorithm Hash digest
SHA256 1ff57abb41afabdcc462b104f4891fde9bcf4529e7a5c354f37e1feb5859aad9
MD5 66bbda3c2e65c783b2ac8b34bbcd20b4
BLAKE2b-256 966534f19543f93a49878f7ba3f6eda257175f663902b9cd5720a174a9c2a6a8

See more details on using hashes here.

File details

Details for the file quickshow-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: quickshow-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for quickshow-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 897d47796d5ff582fcd3b7dcfb7d2b95cb2d6d26552ad5b041292d7e40bbeb4f
MD5 5c09e4d934dc515563e0bdc318ed9db1
BLAKE2b-256 58f4a99a6081ba26a97cae7e16e62751a0b6e10d2d4af739c5faf69c8f1d9f1a

See more details on using hashes here.

File details

Details for the file quickshow-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: quickshow-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for quickshow-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 971866ddb7b6ceebc063138f7667791e35b771b399ce2267403d146af6fc6d43
MD5 9404e4b13bc9a398c2cacd7c1a28a927
BLAKE2b-256 9ccd13f1c6da6a50b0d2c85190f8b7055f271d4bdc2a04ba87d85f1ab1b2527d

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