Package: plotsandgraphs
Plots and graphsVisualizations of Machine Learning Metrics quick and simple. Save your time.Every Machine Learning project requires the evaluation of the algorithm's performance. Many metrics are task specific (classification, regression, ...) but are used again and again and have to be plotted again and again.Plotsandgraphsmakes it easier for you to visualize these metrics by providing a library with tidy and clear graphs for the most common metrics. It serves as a wrapper for the popularmatplotlibpackage to create figures. This also allows users to apply custom changes, if necessary.Plotsandgraphsis model- and framework-agnostic. This means thatplotsandgraphsonly needs the algorithm's results to perform analysis and visualization and not the actual model itself. In the case of a binary classifier only thetrue labelsas well as thepredicted probabilitiesare required as input. Instead of spending time in visualizing results for each metric,plotsandgraphscan calculate and visualize all classification metrics with a single line of code.Plotsandgraphsprovides analysis and visualization for the following problem types:binary classificationmulti-class classification (coming soon)regression (coming soon)Furthermore, this library presents other useful visualizations, such ascomparing distributions.Overview of graphs and plotsbinary classifierAccuracyCalibration CurveClassification ReportConfusion MatrixROC curve (AUROC)y_score histogrammulti-class classifierregressioncomparing distributionsraincloud plotGalleryCalibration CurveClassification ReportConfusion MatrixROC Curve (AUROC) with bootstrappingPrecision-Recall Curvey_score histogramHistogram (y_scores)ROC curves (AUROC) with bootstrappingOther resourcesWhy create everything from scratch, if some things already exist? Here are some helpful resources that can improve your visualization skills.Python Graph Gallery- A great collection of graphs. First look at their gallery, then check out their 'BEST' collection for inspiration.Scientific Visualization Book- Definitely check out the first part for essential tips for good graphs. And then deep dive further to improve your visualization game.CHARTIO- A must read on how to choose colors and color palettes.InstallInstall the package via pip.pipinstallplotsandgraphsAlternatively install the package from git directly.gitclonehttps://github.com/joshuawe/plots_and_graphscdplots_and_graphs
pipinstall-e.UsageGet all classification metrics withONEline of code. Here, for a binary classifier:importplotsandgraphsaspandg# ...pandg.pipeline.binary_classifier(y_true,y_score)Or with some more configs:configs={'roc':{'n_bootstraps':10000},'pr':{'figsize':(8,10)}}pandg.pipeline.binary_classifier(y_true,y_score,save_fig_path='results/metrics',file_type='png',plot_kwargs=configs)For multiclass classification:# with multiclass data y_true (one-hot encoded) and y_scorepandg.pipeline.multiclass_classifier(y_true,y_score)RequirementsShow all requirementsContributorsDALL-E 3created the project logo on 17th October 2023. Prompt used:Illustration of a stylized graph with colorful lines and bars, representing data visualization, suitable for a project logo named 'plots and graphs'.TheScientific colour mapsin theplotsandgraphs/cmapsfolder(Crameri 2018)are used in this library to prevent visual distortion of the data and exclusion of readers with colour-vision deficiencies(Crameri et al., 2020).ReferenceOf course we are happy to be mentioned in any way, if our repository has helped you.
You can also share this repository with your friends and collegues to make their lives easier. Cheers!