def andrews_curves(<EOL>data, class_column, samples=<NUM_LIT:200>, alpha=None, width=<NUM_LIT>, height=<NUM_LIT>, **kwds<EOL>):
if kwds:<EOL><INDENT>warnings.warn(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(list(kwds.keys()))<EOL>)<EOL><DEDENT>t = np.linspace(-np.pi, np.pi, samples)<EOL>vals = data.drop(class_column, axis=<NUM_LIT:1>).values.T<EOL>curves = np.outer(vals[<NUM_LIT:0>], np.ones_like(t))<EOL>for i in range(<NUM_LIT:1>, len(vals)):<EOL><INDENT>ft = ((i + <NUM_LIT:1>) // <NUM_LIT:2>) * t<EOL>if i % <NUM_LIT:2> == <NUM_LIT:1>:<EOL><INDENT>curves += np.outer(vals[i], np.sin(ft))<EOL><DEDENT>else:<EOL><INDENT>curves += np.outer(vals[i], np.cos(ft))<EOL><DEDENT><DEDENT>df = pd.DataFrame(<EOL>{<EOL>"<STR_LIT:t>": np.tile(t, curves.shape[<NUM_LIT:0>]),<EOL>"<STR_LIT>": np.repeat(np.arange(curves.shape[<NUM_LIT:0>]), curves.shape[<NUM_LIT:1>]),<EOL>"<STR_LIT:U+0020>": curves.ravel(),<EOL>class_column: np.repeat(data[class_column], samples),<EOL>}<EOL>)<EOL>chart = alt.Chart(df).properties(width=width, height=height).mark_line()<EOL>chart = chart.encode(<EOL>x=alt.X(field="<STR_LIT:t>", type="<STR_LIT>"),<EOL>y=alt.Y(field="<STR_LIT:U+0020>", type="<STR_LIT>"),<EOL>color=alt.Color(field=class_column, type=infer_vegalite_type(df[class_column])),<EOL>detail=alt.Detail(field='<STR_LIT>', type="<STR_LIT>")<EOL>)<EOL>if alpha is None and df[class_column].nunique() > <NUM_LIT:20>:<EOL><INDENT>alpha = <NUM_LIT:0.5><EOL><DEDENT>if alpha is not None:<EOL><INDENT>assert <NUM_LIT:0> <= alpha <= <NUM_LIT:1><EOL>return chart.encode(opacity=alt.value(alpha))<EOL><DEDENT>return chart<EOL>
Generates an Andrews curves visualization for visualising clusters of
multivariate data.

Andrews curves have the functional form:

f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t) +
       x_4 sin(2t) + x_5 cos(2t) + ...

Where x coefficients correspond to the values of each dimension and t is
linearly spaced between -pi and +pi. Each row of frame then corresponds to
a single curve.

Parameters:
-----------
data : DataFrame
    Data to be plotted, preferably normalized to (0.0, 1.0)
class_column : string
    Name of the column containing class names
samples : integer
    Number of points to plot in each curve
alpha: float, optional
    The transparency of the lines
width : int, optional
    the width of the plot in pixels
height : int, optional
    the height of the plot in pixels
**kwds: keywords
    Additional options

Returns:
--------
chart: alt.Chart object