<commit_before># Machine learning visualization

[![](https://img.shields.io/travis/olgabot/cupcake.svg)](https://travis-ci.org/olgabot/cupcake)[![](https://img.shields.io/pypi/v/cupcake.svg)](https://pypi.python.org/pypi/cupcake)

Painlessly visualize results of machine learning analyses

* Free software: BSD license

## Features

* TODO

### `smushplot`

For all your dimensionality reduction needs! Given any high-dimensional dataset,
perform dimensionality reduction and plot the result.

#### Colors

Specifying colors for plotting can be kind of confusing, so here is a table of all the possible inputs and outputs with examples.

| #  | `color` | `palette` | `hue`  | `hue_order` | *Output* |
| -- | ------- | --------- | ------ | ----------- | -------- |
| 1. | `None`  | `None`    | `None` | `None`      | One color, auto-assigned (from `ax.color_cycle()`) |
| 2. | `None`  | `None`    | `None` | `list` object | Cannot interpret, raises `ValueError` |
| 3. | `None`  | `None`    | `Series` object | `None`      | Color by group mapping specified in `hue` with **auto-assigned** colors |
| 4. | `None`  | `None`    | `Series` object | `list` object | Color by group mapping specified in `hue` with **auto-assigned** colors, ordered by `hue_order` |
| 5. | `None`  | [valid matplotlib palette name](http://matplotlib.org/examples/color/colormaps_reference.html) e.g."PRGn" or [seaborn palette name](https://stanford.edu/~mwaskom/software/seaborn/tutorial/color_palettes.html) or list of colors | `None` | `None`      | Every sample a different color, auto-assigned by the row order of the input data |
| 6. | `None`  | [valid matplotlib palette name](http://matplotlib.org/examples/color/colormaps_reference.html) e.g."PRGn" or [seaborn palette name](https://stanford.edu/~mwaskom/software/seaborn/tutorial/color_palettes.html) or list of colors | `None` | `list` object | If `len(hue_order)=len(data.index)`, then every sample a different color, in the order specified by `hue_order`. Otherwise raises `ValueError` |
| 7. | `None`  | [valid matplotlib palette name](http://matplotlib.org/examples/color/colormaps_reference.html) e.g."PRGn" or [seaborn palette name](https://stanford.edu/~mwaskom/software/seaborn/tutorial/color_palettes.html) or list of colors | sample id (row name) to group mapping object (`pandas.Series` or `dict`) | None | Group by colors with this palette, groups in alphanumeric order |
| 8. | `None`  | [valid matplotlib palette name](http://matplotlib.org/examples/color/colormaps_reference.html) e.g."PRGn" or [seaborn palette name](https://stanford.edu/~mwaskom/software/seaborn/tutorial/color_palettes.html) or list of colors | sample id (row name) to group mapping object (`pandas.Series` or `dict`) | `list` object | Group by colors with this palette, in order specified by `hue_order` |



<commit_msg>Removed table from readme to move into docs<commit_after># Machine learning visualization

[![](https://img.shields.io/travis/olgabot/cupcake.svg)](https://travis-ci.org/olgabot/cupcake)[![](https://img.shields.io/pypi/v/cupcake.svg)](https://pypi.python.org/pypi/cupcake)

Painlessly visualize results of machine learning analyses

* Free software: BSD license

## Features

* TODO

### `smushplot`

For all your dimensionality reduction needs! Given any high-dimensional dataset,
perform dimensionality reduction and plot the result.
{'fraction_non_alphanumeric': 0.15266272189349112, 'fraction_numerical': 0.002366863905325444, 'mean_word_length': 4.266355140186916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '996577', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1074, 'n_words': 307}