Skip to content

Commit

Permalink
Added tutorial_data to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
LimbeckKat committed Dec 11, 2024
1 parent 31e50e1 commit 1eb304d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 115 deletions.
1 change: 1 addition & 0 deletions magnipy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
from .utils.datasets import *
from .magnipy import Magnipy
from .diversipy import Diversipy
from .utils.tutorial_data import *
3 changes: 0 additions & 3 deletions notebooks/tutorial_data.py → magnipy/utils/tutorial_data.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
"""File for creating example datasets for user tutorials."""

from importlib import reload
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.datasets import make_swiss_roll, make_blobs
from sklearn.preprocessing import MinMaxScaler
from magnipy.utils.datasets import (
sample_points_gaussian,
sample_points_gaussian_2,
sample_points_square,
hawkes_process,
)
from magnipy.utils.plots import plot_points
from magnipy import Magnipy
import bisect
from matplotlib.animation import FuncAnimation
from magnipy.diversipy import Diversipy
Expand Down
116 changes: 57 additions & 59 deletions notebooks/diversipy_tutorial.ipynb

Large diffs are not rendered by default.

45 changes: 17 additions & 28 deletions notebooks/magnipy_tutorial.ipynb

Large diffs are not rendered by default.

37 changes: 12 additions & 25 deletions notebooks/mode_dropping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# Import statements\n",
"from matplotlib.animation import FuncAnimation\n",
"from magnipy.magnipy import Magnipy\n",
"from magnipy.diversipy import Diversipy\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"from tutorial_data import *"
"from magnipy.utils.tutorial_data import *"
]
},
{
Expand All @@ -49,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -104,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -155,7 +153,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -196,7 +194,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -213,14 +211,14 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/emily.simons/repos/magnipy/notebooks/tutorial_data.py:473: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n",
"/home/kat/magnipy/magnipy/magnipy/utils/tutorial_data.py:489: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n",
" fig.show()\n"
]
},
Expand Down Expand Up @@ -285,7 +283,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -337,7 +335,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -372,7 +370,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -389,7 +387,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -463,17 +461,6 @@
"source": [
"Figure from [Metric Space Magnitude for Evaluating the Diversity of Latent Representations](https://arxiv.org/abs/2311.16054). See also for further discussion."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# To reproduce all animations uncomment the following:\n",
"\n",
"# create_all_animations()"
]
}
],
"metadata": {
Expand Down

0 comments on commit 1eb304d

Please sign in to comment.