{"id":18561600,"url":"https://github.com/ajayarunachalam/regressormetricgraphplot","last_synced_at":"2025-04-10T03:30:58.328Z","repository":{"id":57460908,"uuid":"302756041","full_name":"ajayarunachalam/RegressorMetricGraphPlot","owner":"ajayarunachalam","description":"Python package to simplify plotting of common evaluation metrics for regression models. Metrics included are pearson correlation coefficient (r), coefficient of determination (r-squared), mean squared error (mse), root mean squared error(rmse), root mean squared relative error (rmsre), mean absolute error (mae), mean absolute percentage error (mape), etc.","archived":false,"fork":false,"pushed_at":"2021-11-16T13:10:25.000Z","size":316,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T15:47:22.179Z","etag":null,"topics":["coefficient-of-determination","correlation-coefficient","evaluation-metrics","graph","mae","metrics","metrics-visualization","mse","plot","python","regression","regression-testing","rmse","rmse-score","rmsre"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajayarunachalam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-09T21:22:03.000Z","updated_at":"2023-10-10T10:27:32.000Z","dependencies_parsed_at":"2022-09-09T02:30:34.077Z","dependency_job_id":null,"html_url":"https://github.com/ajayarunachalam/RegressorMetricGraphPlot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajayarunachalam%2FRegressorMetricGraphPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajayarunachalam%2FRegressorMetricGraphPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajayarunachalam%2FRegressorMetricGraphPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajayarunachalam%2FRegressorMetricGraphPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajayarunachalam","download_url":"https://codeload.github.com/ajayarunachalam/RegressorMetricGraphPlot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248150765,"owners_count":21055979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coefficient-of-determination","correlation-coefficient","evaluation-metrics","graph","mae","metrics","metrics-visualization","mse","plot","python","regression","regression-testing","rmse","rmse-score","rmsre"],"created_at":"2024-11-06T22:07:22.718Z","updated_at":"2025-04-10T03:30:57.713Z","avatar_url":"https://github.com/ajayarunachalam.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Common Evaluation metrics graph plot for Regression Problem\n\n## Description\n\nPyPI: https://pypi.org/project/regressormetricgraphplot/\n\nPython implementations for comparing different Regression Models and Plotting with their most common evaluation metrics.\n\nThe purpose of this package is to help users plot the graph at ease with different widely used metrics for regression model evaluation for comparing them at a glance \n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/ajayarunachalam/RegressorMetricGraphPlot/blob/main/regressormetricgraphplot/example_plot.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    Figure: Model evaluation plot with widely used metrics \n\u003c/p\u003e\n\n## Illustration Example\n\n```python\n# Importing libraries \nfrom sklearn.datasets import make_regression\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\nfrom regressormetricgraphplot import *\n%matplotlib inline\n```\n\n```python\n#Let's load a simple dataset and make a train \u0026 test set :\nX, y = make_regression(n_samples=1000, n_features=10, n_informative=7, n_targets=1, random_state=0)\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=10)\n```\n\n```python\n# Train the regressor and predict on test set \n# Fitting training set to linear regression model\nlr = LinearRegression(n_jobs=-1)\nlr.fit(X_train, y_train)\n# Predicting\ny_pred = lr.predict(X_test)\n```\n\nWe can now use ``R2AndRMSE`` to compute \u0026 output R-squared, and Root Mean Square Error.\n\n```python\n# Metrics\nCompareModels.R2AndRMSE(y_test=y_test, y_pred=y_pred)\n```\n\nMake object of the class ``CompareModels``\n\n```python\nplot = CompareModels()\n```\n\nWe can now use ``add`` \u0026  ``show`` method to add the built model \u0026 plot the graph at ease with all the evaluated metrics.\n\n```python\nplot.add(model_name='Linear Regression', y_test=y_test, y_pred=y_pred)\nplot.show(figsize=(10, 5))\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/ajayarunachalam/RegressorMetricGraphPlot/blob/main/regressormetricgraphplot/LR_Metric_PLOT.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n## Table of Contents\n- [Compare Regression Model Metrics Plot](#regressormetricgraphplot)\n  * [Installation](#installation)\n  * [Examples](#examples)\n    + [Demo](#Usage))\n  * [Contact](#contact)\n\n## Installation \n    $ pip install regressormetricgraphplot\n\n         OR\n\n    $ git clone https://github.com/ajayarunachalam/RegressorMetricGraphPlot\n    $ cd RegressorMetricGraphPlot\n    $ python setup.py install\n\n## Notebook\n    !pip install regressormetricgraphplot \u0026 import as 'from regressormetricgraphplot import *'\n\n         OR\n\n    !git clone https://github.com/ajayarunachalam/RegressorMetricGraphPlot.git\n    cd RegressorMetricGraphPlot/\n\n    Just replace the line 'from CompareModels import *' with 'from regressormetricgraphplot import CompareModels' \nFollow the rest as demonstrated in the demo example [here] -- (https://github.com/ajayarunachalam/RegressorMetricGraphPlot/blob/main/regressormetricgraphplot/demo.ipynb) \n\n## Installation with Anaconda\n\nIf you installed your Python with Anacoda you can run the following commands to get started:\n```bash\n\n# Clone the repository \ngit clone https://github.com/ajayarunachalam/RegressorMetricGraphPlot.git\ncd RegressorMetricGraphPlot\n# Create new conda environment with Python 3.6\nconda create --new your-env-name python=3.6\n# Activate the environment\nconda activate your-env-name\n# Install conda dependencies\nconda install --yes --file conda_requirements.txt\n# Instal pip dependencies\npip install requirements.txt\n```\n\n\n\n## Examples\nNavigate to the demo example in a form of iPython notebooks: -- [here](https://github.com/ajayarunachalam/RegressorMetricGraphPlot/blob/main/regressormetricgraphplot/demo.ipynb)\n\n\n### Demo\n     * demo.ipynb \n\n## Contact\nIf there's some implementation you would like to see here or add in some examples feel free to do so. You can reach me at [email](mailto:ajay.arunachalam08@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajayarunachalam%2Fregressormetricgraphplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajayarunachalam%2Fregressormetricgraphplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajayarunachalam%2Fregressormetricgraphplot/lists"}