Official repository to create high quality andrews function data and high quality plots
https://towardsdatascience.com/simple-introduction-to-andrews-curves-with-python-e20d0620ed6b
pip install andrewscurves
from andrewscurves import *
andrewscurves(data, class_column, samples)
plotly_andrews_curves(data, class_columns, samples)
seaborn_andrews_curves(data, class_columns, samples)
mpl_andrews_curves(data, class_columns, samples)
hvplot_andrews_curves(data, class_columns, samples)
- data : pandas.DataFrame -- input a pandas dataframe
- class_column : str -- target or class column of your pandas dataframe
- samples : int -- integer representing number representative samples to generate
Returns: andrewscurves()
- df : pandas.DataFrame -- output a pandas dataframe with andrews function spacing and covariates along with feature columns
Returns: plotly_andrews_curves(), seaborn_andrews_curves(), mpl_andrews_curves(), hvplot_andrews_curves()
- fig : flexible -- output plot object plotly, seaborn, matplotlib, or hvplot format
from andrewscurves import andrewscurves
import pandas as pd
csv_url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'
col_names = ['Sepal_Length','Sepal_Width','Petal_Length','Petal_Width','Class']
iris = pd.read_csv(csv_url, names = col_names)
ac_df = andrewscurves(iris, 'Class', 1000)
from andrewscurves import plotly_andrews_curves
plotly_andrews_curves(iris, 'Class',100)
from andrewscurves import seaborn_andrews_curves
seaborn_andrews_curves(iris, 'Class',50)
from andrewscurves import mpl_andrews_curves
import matplotlib.pyplot as plt
plt.figure(figsize=(15,8)) ##set figsize with plt like a typical mpl plot
mpl_andrews_curves(iris, 'Class',100)
from andrewscurves import hvplot_andrews_curves
hvplot_andrews_curves(iris, 'Class',100)