seaborn-analyzer: data visualization of regression, classification and distribution
Project description
seaborn-analyzer
A data analysis and visualization tool using Seaborn library.
Usage
An example of using CustomPairPlot class
from seaborn_analyzer import CustomPairPlot
import seaborn as sns
titanic = sns.load_dataset("titanic")
cp = CustomPairPlot()
cp.pairanalyzer(titanic, hue='survived')
If you want to know usage of other classes, see API Reference and Examples
Requirements
seaborn-analyzer 0.1.2 requires
Python >=3.6
Numpy >=1.20.3
Pandas >=1.2.4
Matplotlib >=3.3.4
Scipy >=1.6.3
Scikit-learn >=0.24.2
Installing seaborn-analyzer
Use pip to install the binary wheels on PyPI
$ pip install seaborn-analyzer
Support
Bugs may be reported at https://github.com/c60evaporator/seaborn-analyzer/issues
API Reference
The following classes and methods are included in seaborn-analyzer
CustomPairPlot class
Method name |
Summary |
API Documentation |
Example |
---|---|---|---|
pairanalyzer |
Plotting pair plot including scatter plot and correlation coefficient matrix simultaneously |
hist class
Method name |
Summary |
API Documentation |
Example |
---|---|---|---|
plot_normality |
Plotting normality test and QQ plot |
||
fit_dist |
Fitting distributions and calculating fitting scores |
classplot class
Method name |
Summary |
API Documentation |
Example |
---|---|---|---|
class_separator_plot |
Plotting class separation lines of any scikit-learn classification models |
||
class_proba_plot |
Plotting class prediction probability of any scikit-learn classification models |
regplot class
Method name |
Summary |
API Documentation |
Example |
---|---|---|---|
linear_plot |
Plotting linear regression line and calculating Pearson correlation coefficient |
||
regression_pred_true |
Plotting prediction value vs. true value scatter plots |
||
regression_plot_1d |
Plotting 1d regression lines of any scikit-learn regression models |
||
regression_heat_plot |
Plotting 2 to 4d regression heat maps of any scikit-learn regression models |
Examples
CustomPairPlot.pairanalyzer
from seaborn_analyzer import CustomPairPlot
import seaborn as sns
titanic = sns.load_dataset("titanic")
cp = CustomPairPlot()
cp.pairanalyzer(titanic, hue='survived')
hist.plot_normality
from seaborn_analyzer import hist
from sklearn.datasets import load_boston
import pandas as pd
df = pd.DataFrame(load_boston().data, columns= load_boston().feature_names)
hist.plot_normality(df, x='LSTAT', norm_hist=False, rounddigit=5)
hist.fit_dist
from seaborn_analyzer import hist
from sklearn.datasets import load_boston
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
df = pd.DataFrame(load_boston().data, columns= load_boston().feature_names)
all_params, all_scores = hist.fit_dist(df, x='LSTAT', dist=['norm', 'gamma', 'lognorm', 'uniform'])
df_scores = pd.DataFrame(all_scores).T
df_scores
classplot.class_separator_plot
import seaborn as sns
from sklearn.svm import SVC
from seaborn_analyzer import classplot
iris = sns.load_dataset("iris")
model = SVC()
classplot.class_separator_plot(model, ['petal_width', 'petal_length'], 'species', iris)
classplot.class_proba_plot
import seaborn as sns
from sklearn.svm import SVC
from seaborn_analyzer import classplot
iris = sns.load_dataset("iris")
model = SVC()
classplot.class_proba_plot(model, ['petal_width', 'petal_length'], 'species', iris,
proba_type='imshow')
regplot.linear_plot
from seaborn_analyzer import regplot
import seaborn as sns
iris = sns.load_dataset("iris")
regplot.linear_plot(x='petal_length', y='sepal_length', data=iris)
regplot.regression_pred_true
import pandas as pd
from seaborn_analyzer import regplot
import seaborn as sns
from sklearn.linear_model import LinearRegression
df_temp = pd.read_csv(f'./sample_data/temp_pressure.csv')
regplot.regression_pred_true(LinearRegression(), x=['altitude', 'latitude'], y='temperature', data=df_temp)
regplot.regression_plot_1d
from seaborn_analyzer import regplot
import seaborn as sns
from sklearn.svm import SVR
iris = sns.load_dataset("iris")
regplot.regression_plot_1d(SVR(), x='petal_length', y='sepal_length', data=iris)
regplot.regression_heat_plot
import pandas as pd
from sklearn.linear_model import LinearRegression
from seaborn_analyzer import regplot
df_temp = pd.read_csv(f'./sample_data/temp_pressure.csv')
regplot.regression_heat_plot(LinearRegression(), x=['altitude', 'latitude'], y='temperature', data=df_temp)
Contact
If you have any questions or comments about seaborn-analyzer, please feel free to contact me via eMail: c60evaporator@gmail.com or Twitter: https://twitter.com/c60evaporator This project is hosted at https://github.com/c60evaporator/seaborn-analyzer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for seaborn_analyzer-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af546008ef5056104e25ec84858abf32b9d5acd068365ad65ee30aaa3ac4c4f3 |
|
MD5 | 1fbef47156a45fcd0eb7b1399e056237 |
|
BLAKE2b-256 | ba172dad8557971fb4b48db05862585b51e21a2a1112d67340840e7de1105ac7 |