Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 (m…

License

NotificationsYou must be signed in to change notification settings

ajayarunachalam/RegressorMetricGraphPlot

Repository files navigation

Description

PyPI:https://pypi.org/project/regressormetricgraphplot/

Python implementations for comparing different Regression Models and Plotting with their most common evaluation metrics.

The 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

Figure: Model evaluation plot with widely used metrics

Illustration Example

# Importing librariesfromsklearn.datasetsimportmake_regressionfromsklearn.model_selectionimporttrain_test_splitfromsklearn.linear_modelimportLinearRegressionfromregressormetricgraphplotimport*%matplotlibinline
#Let's load a simple dataset and make a train & test set :X,y=make_regression(n_samples=1000,n_features=10,n_informative=7,n_targets=1,random_state=0)X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.3,random_state=10)
# Train the regressor and predict on test set# Fitting training set to linear regression modellr=LinearRegression(n_jobs=-1)lr.fit(X_train,y_train)# Predictingy_pred=lr.predict(X_test)

We can now useR2AndRMSE to compute & output R-squared, and Root Mean Square Error.

# MetricsCompareModels.R2AndRMSE(y_test=y_test,y_pred=y_pred)

Make object of the classCompareModels

plot=CompareModels()

We can now useadd &show method to add the built model & plot the graph at ease with all the evaluated metrics.

plot.add(model_name='Linear Regression',y_test=y_test,y_pred=y_pred)plot.show(figsize=(10,5))

Table of Contents

Installation

$ pip install regressormetricgraphplot     OR$ git clone https://github.com/ajayarunachalam/RegressorMetricGraphPlot$ cd RegressorMetricGraphPlot$ python setup.py install

Notebook

!pip install regressormetricgraphplot & import as 'from regressormetricgraphplot import *'     OR!git clone https://github.com/ajayarunachalam/RegressorMetricGraphPlot.gitcd RegressorMetricGraphPlot/Just replace the line 'from CompareModels import *' with 'from regressormetricgraphplot import CompareModels'

Follow the rest as demonstrated in the demo example [here] -- (https://github.com/ajayarunachalam/RegressorMetricGraphPlot/blob/main/regressormetricgraphplot/demo.ipynb)

Installation with Anaconda

If you installed your Python with Anacoda you can run the following commands to get started:

# Clone the repositorygit clone https://github.com/ajayarunachalam/RegressorMetricGraphPlot.gitcd RegressorMetricGraphPlot# Create new conda environment with Python 3.6conda create --new your-env-name python=3.6# Activate the environmentconda activate your-env-name# Install conda dependenciesconda install --yes --file conda_requirements.txt# Instal pip dependenciespip install requirements.txt

Examples

Navigate to the demo example in a form of iPython notebooks: --here

Demo

 * demo.ipynb

Contact

If there's some implementation you would like to see here or add in some examples feel free to do so. You can reach me atemail

About

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 (m…

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp