diff --git a/flexibleSubsetSelection/objective.py b/flexibleSubsetSelection/objective.py
index 5f20609..7adf9f3 100644
--- a/flexibleSubsetSelection/objective.py
+++ b/flexibleSubsetSelection/objective.py
@@ -33,7 +33,6 @@ def preserveMetric(subset: np.ndarray, metric: Callable,
# If the metric results are scalars, use the absolute difference
if np.isscalar(datasetMetric):
- print(datasetMetric, subsetMetric)
return np.abs(datasetMetric - subsetMetric)
# Otherwise, use np.linalg.norm for array-like metric results
diff --git a/jupyter/Fig1-designProcess.ipynb b/jupyter/Fig1-designProcess.ipynb
index 56ab48e..9435f4b 100644
--- a/jupyter/Fig1-designProcess.ipynb
+++ b/jupyter/Fig1-designProcess.ipynb
@@ -13,7 +13,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -69,12 +69,8 @@
"### Convex Hull Objective\n",
"\n",
"Applying this objective allows us to select the smallest subset that covers the convex hull of the original dataset.\n",
- "$$\n",
- " \\min_{S \\in \\mathbb{S}}\\space \\|S\\|\n",
- "$$\n",
- "$$\n",
- " \\text{s.t.} \\space \\text{Hull}(S) = 0\n",
- "$$"
+ "$$\\min_{S \\in \\mathbb{S}} \\space \\|S\\|$$\n",
+ "$$\\text{s.t.} \\space \\text{Hull}(S) = 0$$"
]
},
{
@@ -395,22 +391,8 @@
}
],
"metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
"language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.12.4"
+ "name": "python"
}
},
"nbformat": 4,
diff --git a/jupyter/Fig2&3-objectives.ipynb b/jupyter/Fig2&3-objectives.ipynb
index 79c245c..84daedf 100644
--- a/jupyter/Fig2&3-objectives.ipynb
+++ b/jupyter/Fig2&3-objectives.ipynb
@@ -13,7 +13,7 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -48,7 +48,7 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -70,19 +70,9 @@
},
{
"cell_type": "code",
- "execution_count": 29,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Solved for subset of size 10x10 in 0.03s with 11.15 loss.\n",
- "Solved for subset of size 10x10 in 0.03s with 2.08 loss.\n",
- "Solved for subset of size 10x10 in 0.13s with 0.7 loss.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Precalculate dataset means\n",
"firstDataset.preprocess(mean=fss.metric.mean)\n",
@@ -126,19 +116,9 @@
},
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Solved for subset of size 10x10 in 0.03s with 95.87 loss.\n",
- "Solved for subset of size 10x10 in 0.02s with 55.02 loss.\n",
- "Solved for subset of size 10x10 in 0.11s with 23.9 loss.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Precalculate dataset ranges\n",
"firstDataset.preprocess(range = fss.metric.range)\n",
@@ -177,19 +157,9 @@
},
{
"cell_type": "code",
- "execution_count": 31,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Solved for subset of size 10x10 in 0.03s with 43.41 loss.\n",
- "Solved for subset of size 10x10 in 0.03s with 5.62 loss.\n",
- "Solved for subset of size 10x10 in 0.18s with 1.48 loss.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Precalculate the discrete coverage of the full dataset\n",
"firstDataset.preprocess(variance = fss.metric.variance)\n",
@@ -228,19 +198,9 @@
},
{
"cell_type": "code",
- "execution_count": 32,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Solved for subset of size 10x10 in 0.14s with 258.0 loss.\n",
- "Solved for subset of size 10x10 in 0.14s with 154.0 loss.\n",
- "Solved for subset of size 10x10 in 1.37s with 76.0 loss.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Create a unicriterion loss function with the coverage metric and update solver\n",
"crossingsLoss = fss.UniCriterion(objective = fss.objective.pcpLineCrossings)\n",
@@ -274,19 +234,9 @@
},
{
"cell_type": "code",
- "execution_count": 33,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Solved for subset of size 10x10 in 0.03s with -28.0 loss.\n",
- "Solved for subset of size 10x10 in 0.03s with -44.0 loss.\n",
- "Solved for subset of size 10x10 in 0.21s with -56.0 loss.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Bin and one hot encode the dataset for discretization\n",
"firstDataset.discretize(bins=6)\n",
@@ -327,19 +277,9 @@
},
{
"cell_type": "code",
- "execution_count": 34,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Solved for subset of size 10x10 in 0.03s with 6.43 loss.\n",
- "Solved for subset of size 10x10 in 0.03s with 2.83 loss.\n",
- "Solved for subset of size 10x10 in 0.13s with 1.64 loss.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Precalculate the discrete distribution of the full dataset\n",
"firstDataset.preprocess(distribution = fss.metric.discreteDistribution)\n",
@@ -380,7 +320,7 @@
},
{
"cell_type": "code",
- "execution_count": 35,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -404,7 +344,7 @@
},
{
"cell_type": "code",
- "execution_count": 44,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -438,208554 +378,9 @@
},
{
"cell_type": "code",
- "execution_count": 49,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "data": {
- "image/svg+xml": [
- "\n",
- "\n",
- "\n"
- ],
- "text/plain": [
- "