From 76ef4d69ab158fd68d12c7ed4b335acb604f10f5 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Thu, 25 Jul 2024 16:44:42 -0400 Subject: [PATCH] feat: make return value pd dataframe --- docs/Basic Usage.ipynb | 107 ++++++++---------- .../experimentalist/nearest_value/__init__.py | 2 + 2 files changed, 47 insertions(+), 62 deletions(-) diff --git a/docs/Basic Usage.ipynb b/docs/Basic Usage.ipynb index cb71eae..1409ade 100644 --- a/docs/Basic Usage.ipynb +++ b/docs/Basic Usage.ipynb @@ -11,7 +11,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "pycharm": { + "is_executing": true + } + }, "outputs": [], "source": [ "# Uncomment the following line when running on Google Colab\n", @@ -20,21 +24,13 @@ }, { "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "ename": "ImportError", - "evalue": "attempted relative import with no known parent package", - "output_type": "error", - "traceback": [ - "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[1;31mImportError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[1;32mIn[3], line 3\u001B[0m\n\u001B[0;32m 1\u001B[0m \u001B[39mimport\u001B[39;00m \u001B[39mnumpy\u001B[39;00m \u001B[39mas\u001B[39;00m \u001B[39mnp\u001B[39;00m\n\u001B[0;32m 2\u001B[0m \u001B[39mimport\u001B[39;00m \u001B[39mmatplotlib\u001B[39;00m\u001B[39m.\u001B[39;00m\u001B[39mpyplot\u001B[39;00m \u001B[39mas\u001B[39;00m \u001B[39mplt\u001B[39;00m\n\u001B[1;32m----> 3\u001B[0m \u001B[39mfrom\u001B[39;00m \u001B[39m.\u001B[39;00m\u001B[39msrc\u001B[39;00m\u001B[39m.\u001B[39;00m\u001B[39mautora\u001B[39;00m\u001B[39m.\u001B[39;00m\u001B[39mexperimentalist\u001B[39;00m\u001B[39m.\u001B[39;00m\u001B[39msampler\u001B[39;00m\u001B[39m.\u001B[39;00m\u001B[39mnearest_value_sampler\u001B[39;00m \u001B[39mimport\u001B[39;00m nearest_values_sampler\n", - "\u001B[1;31mImportError\u001B[0m: attempted relative import with no known parent package" - ] + "execution_count": null, + "metadata": { + "pycharm": { + "is_executing": true } - ], + }, + "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", @@ -51,14 +47,17 @@ }, "source": [ "# Define Meta-Space\n", - "\n", "We will here define X values of interest as well as a ground truth model to derive y values." ] }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, + "execution_count": null, + "metadata": { + "pycharm": { + "is_executing": true + } + }, "outputs": [], "source": [ "#Define meta-parameters\n", @@ -84,20 +83,13 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGdCAYAAACyzRGfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAge0lEQVR4nO3df3BU9b3/8dcmyAYke2wCySbfLDSiFWMKCEKMKAMlQmInI4rWqlyBMlgzgRawI6ZjpXitsdoq9VdQO0W8muLYihanhME4BNsGESiDSEkNxkuEJCCU3RAnC83u9w8uWxcIsMnuZ3/k+Zg5o3v27O6b2YF95uw5Jza/3+8XAACAIUnRHgAAAPQtxAcAADCK+AAAAEYRHwAAwCjiAwAAGEV8AAAAo4gPAABgFPEBAACM6hftAU7n8/l04MABpaamymazRXscAABwAfx+v9rb25Wdna2kpHPv24i5+Dhw4IBcLle0xwAAAD3Q3NysnJycc24Tc/GRmpoq6eTwDocjytMAAIAL4fF45HK5Ap/j5xJz8XHqqxaHw0F8AAAQZy7kkAkOOAUAAEYRHwAAwCjiAwAAGEV8AAAAo4gPAABgFPEBAACMIj4AAIBRxAcAADAq5i4yBgAAIqPL59eWpiM62N6pjNQUjc9NU3KS+d+jRnwAANAH1Oxq0bK1u9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WlTZs26bnnnpPX61VycnIUJ+xbsrKylJeXF7Tuyiuv1B//+MeozEN8xKAhQ4ZoyJAhF7Tt/v37NXnyZI0dO1YrV65UUhI7s0zp37+/xo4dq9raWk2fPl3SyZ8uamtrNX/+/OgO1wf5/X4tWLBAa9as0caNG5Wbmxvtkfq0KVOm6OOPPw5aN2fOHI0YMUJLliwhPAybMGHCGaee//Of/9SwYcOiMg/xEcf279+vSZMmadiwYfrVr36lQ4cOBe7jJ28zFi9erFmzZumaa67R+PHjtXz5cnV0dGjOnDnRHq3PKS8vV3V1td555x2lpqYGjruxLEsDBgyI8nR9T2pq6hnH21x88cVKT0/nOJwoWLRoka677jo99thj+t73vqctW7bopZdeitrecuIjjm3YsEGNjY1qbGw8Y/cyZ1Cbcccdd+jQoUN6+OGH1draqtGjR6umpuaMg1AReVVVVZKkSZMmBa1fuXLleb/GBBLduHHjtGbNGlVUVOiRRx5Rbm6uli9frrvvvjsq83CdDwAAYBQHCAAAAKOIDwAAYBTxAQAAjCI+AACAUcQHAAAwivgAAABGER8AAMAo4gMAABhFfAAAAKOIDwAAYBTxAQAAjCI+AACAUf8fE9WFiOOg3HsAAAAASUVORK5CYII=", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" + "execution_count": null, + "metadata": { + "pycharm": { + "is_executing": true } - ], + }, + "outputs": [], "source": [ "plt.plot(X, ground_truth(X), 'o')\n", "plt.show()" @@ -115,27 +107,16 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "New datapoints:\n", - "[[-1.]\n", - " [ 6.]\n", - " [-3.]\n", - " [-2.]\n", - " [ 1.]]\n", - "\n" - ] + "execution_count": null, + "metadata": { + "pycharm": { + "is_executing": true } - ], + }, + "outputs": [], "source": [ "sampler_proposal = nearest_values_sample(X, X_allowed, 5)\n", - "\n", - "print('New datapoints:\\n' + str(sampler_proposal) + '\\n')" + "print(sampler_proposal)" ] }, { @@ -150,26 +131,28 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGdCAYAAACyzRGfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA4VklEQVR4nO3deXhU9d3//9dkmck6ExKyAWMIEPZNFllFLGig1UssVOSmFigXogKWzYW6b0XFCqIC6n0X0J+ItQpWqyJEE1sEFBQREEwwSIQkIJDJApksc35/5MvUYU9IzmR5Pq7rXDBnfc+ckHnxOZ/zORbDMAwBAACYJMDfBQAAgKaF8AEAAExF+AAAAKYifAAAAFMRPgAAgKkIHwAAwFSEDwAAYCrCBwAAMFWQvws4ncfj0aFDhxQZGSmLxeLvcgAAwEUwDENFRUVq0aKFAgLO37ZR78LHoUOH5HQ6/V0GAACogZycHLVq1eq869S78BEZGSmpqni73e7nagAAwMUoLCyU0+n0fo+fT70LH6cutdjtdsIHAAANzMV0maDDKQAAMBXhAwAAmIrwAQAATFXv+nxcDMMwVFFRocrKSn+XAtSq4OBgBQYG+rsMAKhTDS58lJWVKTc3VydOnPB3KUCts1gsatWqlSIiIvxdCgDUmQYVPjwej7KzsxUYGKgWLVrIarUyEBkaDcMwdOTIEf30009KSUmhBQRAo9WgwkdZWZk8Ho+cTqfCwsL8XQ5Q62JjY7V//36Vl5cTPgA0Wg2yw+mFhm0FGipa8gA0BQ2q5QMAANScp7JSeTlZcpcUyBYepQRnOwX4oZWVJoQGYv/+/bJYLNq+fftFb7NixQpFRUX5vY6GzGKxaO3atf4uAwAu2Y97vtKW1x7QwXfu17EPntDBd+7Xltce0I97vjK9liYbPjweQznHTmhPXqFyjp2Qx2PU+TFzcnL0xz/+0dtZNikpSX/605909OjRC27rdDqVm5urrl27XvTxxo4dq++///5SSq6RoUOHymKxyGKxy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RWrFih3bt367nnntMrr7yihQsXSqq6bDRnzhx16dJFubm5ys3N1dixYyVV3fG0ePFi7dq1SytXrtQnn3yiu+++2+d4J06c0BNPPKFXX31VGzduVEFBgW6++Wbv8jVr1uhPf/qT5syZo507d2rq1KmaNGmSPv300/O+j/vuu09z587V9u3b1b59e40bN04VFRUaOHCgFi1aJLvd7q137ty52rp1q+688049+uij2rt3rz766CMNGTLkkj9PALgY7pICBVS6peCzD1HhCQ5XQKVb7pIC02pqUne7HCw4qX1HipXoCDnjlkaLxaJER4iyDhfrYMFJOaNrbxyRzMxMGYahTp06nXV5p06ddPz4cR05csR7meRXv/qV5syZ411n//79Ptu89NJL6tChgxYsWCBJ6tChg3bu3KknnnjivLV4PB6tWLFCkZGRkqRbbrlFaWlp3u1Gjx7ts/7f/vY3xcbGavfu3dXqb3I2AQEBat++vc97uf/++71/b926tebOnavVq1fr7rvvVmhoqCIiIhQUFKSEhASffc2cOdNnu8cff1y33XablixZ4p1fXl6uF154Qf369ZMkrVy5Up06ddIXX3yhK664Qs8884wmTpyoO+64Q5I0e/Zsbd68Wc8884yuvvrqc76PuXPn6je/+Y0k6ZFHHlGXLl2UlZWljh07yuFwyGKx+NR74MABhYeH67rrrlNkZKSSkpJ0+eWXV/8DBIAasIVHyRNok8pPVF1yOU1AeYk8gTbZwqNMq6lJtXyUlFWotKJSYdazZ65Qa6DcFZUqKauok+P/smXjQvr06XPe5Xv37lXfvn195l1xxRUX3G/r1q29wUOSEhMTdfjwYe/rzMxMjRs3Tm3atJHdblfr1q0lVX2B1gbDMHyC35tvvqlBgwYpISFBERERuv/++y/qWBs2bNCwYcPUsmVLRUZG6pZbbtHRo0d9ht0PCgry+Yw6duyoqKgofffdd5Kk7777ToMGDfLZ76BBg7zLz6V79+7evycmJkqSz2d4umuuuUZJSUlq06aNbrnlFr3++us8HgCAaRKc7VQRnSJrSa50eiu2x6PgkjxVRqcowdnOtJqaVPgItwYpJChQJ84RLk6WVcoWFKjwc4STmmrXrp0sFss5v9S+++47NWvWTLGxsf+tNTy8Vms4JTg42Oe1xWLxuaRy/fXX69ixY3rllVe0ZcsWbdmyRVJVp9dLVVlZqczMTCUnJ0uSNm3apPHjx+vXv/613n//fX399de67777Lnis/fv367rrrlP37t319ttva9u2bXrxxRdrrc4L+eVneCpIne+yVGRkpL766iu98cYbSkxM1IMPPqgePXp4++YAQF0KCAxUi/5jqu5uKciUxe2S4amQxe2StSBTFSHNlNh/jKnjfTSp8NEyKlRtYyOU6yo9oxXCMAzlukrVLi5CLaNCz7GHmomJidE111yjJUuW6OTJkz7L8vLy9Prrr2vs2LHVGt2yQ4cO2rp1q8+8L7/88pLqPHr0qPbu3av7779fw4YN814Oqi0rV67U8ePHvZd2Pv/8cyUlJem+++5Tnz59lJKSoh9//NFnG6vVesbTi7dt2yaPx6O//vWv6t+/v9q3b69Dhw6dcbyKigqfz2jv3r0qKCjwXv7q1KmTNm7c6LPNxo0b1blz5xq/x7PVK1W1wgwfPlxPP/20duzYof379+uTTz6p8XEAoDqSOvZSwjUzVRbbTYGlBbIV/KDA0gKVx3ZTwjUzldSxl6n1NKk+HwEBFqV2jdch10llHq7q+xFqDdTJskrlukoVHW7VtV3iFRBQ+0Ncv/DCCxo4cKBSU1P1+OOPKzk5Wbt27dJdd92lli1bXrCvxummTp2qZ599Vvfcc48mT56s7du3e+8EqekQ3c2aNVNMTIxefvllJSYm6sCBA7r33ntrtK8TJ04oLy9PFRUV+umnn7RmzRotXLhQt99+u7c/RUpKig4cOKDVq1erb9+++te//qU1a9b47Kd169bKzs7W9u3b1apVK0VGRqpdu3YqLy/X888/r+uvv14bN27UsmXLzqghODhYM2bM0OLFixUUFKTp06erf//+3stTd911l2666SZdfvnlGj58uN577z298847PnfjVFfr1q1VXFystLQ09ejRQ2FhYfrkk0/0ww8/aMiQIWrWrJk++OADeTwedejQocbHAYDqSurYS86UHvVihFMZ1bBkyRKjW7duRmRkpBEZGWn079/f+OCDD7zLr7rqKkOSzzR16tTqHMJwuVyGJMPlcp2x7OTJk8bu3buNkydPVmufp8vMLzReSMs0Zq3+2rjj/9tqzFr9tfHiJ5lGZn7hJe33Qvbv329MmDDBiI+PN4KDgw2n02nMmDHD+Pnnn33WS0pKMhYuXOgzLzs725BkfP3119557777rtGuXTvDZrMZQ4cONZYuXWpI8n4+y5cvNxwOh3f9hx56yOjRo4fPfhcuXGgkJSV5X69fv97o1KmTYbPZjO7duxvp6emGJGPNmjXnrON0v/w5sFqtRmJionHdddcZ77zzzhnr3nXXXUZMTIwRERFhjB071li4cKFPzaWlpcbo0aONqKgoQ5KxfPlywzAM49lnnzUSExON0NBQIzU11Xj11VcNScbx48d93vvbb79ttGnTxrDZbMbw4cONH3/80ef4S5YsMdq0aWMEBwcb7du3N1599VWf5Rd678ePHzckGZ9++ql33m233WbExMQYkoyHHnrI+Pe//21cddVVRrNmzYzQ0FCje/fuxptvvnnWz662fsYBwGzn+/4+ncUwLr4X5HvvvafAwEClpKTIMAytXLlSCxYs0Ndff60uXbpo6NChat++vR599FHvNmFhYbLbz+xdey6FhYVyOBxyuVxnbFdaWqrs7GwlJycrJCTkovd5Nh6PoYMFJ1VSVqFwa5BaRoXWSYuHmZ544gktW7bsjLEsmqIVK1Zo5syZDa5fRW3+jAOAmc73/X26al12uf76631eP/HEE1q6dKk2b96sLl26SPrv4FL1XUCApVZvp/WHJUuWqG/fvoqJidHGjRu1YMECTZ8+3d9lAQBwXjXucFpZWanVq1erpKREAwYM8M5//fXX1bx5c3Xt2lXz5s274C2FbrdbhYWFPhMuTmZmpm644QZ17txZjz32mObMmeMdURMAgPqqWpddJOnbb7/VgAEDVFpaqoiICK1atUq//vWvJUkvv/yykpKS1KJFC+3YsUP33HOPrrjiivM+UOzhhx/WI488csb8ur7sAtRH/IwDaKiqc9ml2uGjrKxMBw4ckMvl0j/+8Q/97//+rzIyMs56e+Inn3yiYcOGKSsrS23btj3r/txut9xut0/xTqeT8IEmiZ9xAA1VnfX5kKrGMWjXrmoUtN69e+vLL7/Uc889p5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K4/GoVatWeuutt7R79249+OCD+vOf/6y///3vPsdLS0vTd999p/T0dL3xxht65513fIbav/vuu/X2229r5cqV+uqrr9SuXTulpqbq2LFj53wPJ06c0DPPPKPXXntNn332mQ4cOKC5c+dKkubOnaubbrrJG0hyc3M1cOBALV68WP/85z/197//XXv37tXrr7+u1q1bV/vzAwBcnKYVPlw50s+ZkqOldHpTvcUi2VtKR76vWq+O3HjjjerZs6ceeuihsy6fP3++xo8fr5kzZyolJcX75fjqq6+qtLRUXbt2VXR0tPfOovT0dM2ZM8f7+osvvlB5ebkGDhxY7do6duwoSdq/f78kqWXLlpo7d6569uypNm3aaMaMGRoxYoQ3RDgcDlmtVu+TjBMSEhQYGKjg4GA98sgj6tOnj5KTkzV+/HhNmjTpjPBhtVr1t7/9TV26dNFvfvMbPfroo1q8eLE8Ho9KSkq0dOlSLViwQCNHjlTnzp31yiuvKDQ09Lx3XZWXl2vZsmXq06ePevXqpenTpystLU2SFBERodDQUNlsNm+9VqtVBw4cUEpKigYPHqykpCQNHjxY48aNq/bnBwC4OE0rfJQVSxWlUnD42Zdbw6qWlxXXaRlPPfWUVq5cqe++++6MZd98841WrFihiIgI75SamiqPx6Ps7GxZLBYNGTJE6enpKigo0O7du3XHHXfI7XZrz549ysjIUN++fRUWFlbtuk495udUH4rKyko99thj6tatm6KjoxUREaF169bpwIEDF9zXiy++qN69eys2NlYRERF6+eWXz9iuR48ePnUOGDBAxcXFysnJ0b59+1ReXq5BgwZ5lwcHB+uKK6446+d2SlhYmM9Q/omJiTp8+PB5a504caK2b9+uDh066M4779THH398wfcHAKi5phU+rBFSUIhUXnL25WUnqpZbI+q0jCFDhig1NVXz5s07Y1lxcbGmTp2q7du3e6dvvvlGmZmZ3i/VoUOHKj09Xf/+9791+eWXy263ewNJRkaGrrrqqhrVdepLPTk5WZK0YMECPffcc7rnnnv06aefavv27UpNTfXpl3E2q1ev1ty5czV58mR9/PHH2r59uyZNmnTB7WpDcHCwz2uLxaILPTuxV69eys7O1m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MHdfXVV6t3795avny5AgJozDKL1WpV7969lZaWplGjRkmq+t9FWlqapk+f7t/imiDDMDRjxgytWbNG6enpSk5O9ndJTdqwYcP07bff+sybNGmSOnbsqHvuuYfgYbJBgwadcev5999/r6SkJL/UQ/howA4ePKihQ4cqKSlJzzzzjI4cOeJdxv+8zTF79mxNmDBBffr00RVXXKFFixappKREkyZN8ndpTc60adO0atUqvfvuu4qMjPT2u3E4HAoNDfVzdU1PZGTkGf1twsPDFRMTQz8cP5g1a5YGDhyov/zlL7rpppv0xRdf6OWXX/ZbaznhowFbv369srKylJWVdUbzMndQm2Ps2LE6cuSIHnzwQeXl5alnz5766KOPzuiEirq3dOlSSdLQoUN95i9fvvyClzGBxq5v375as2aN5s2bp0cffVTJyclatGiRxo8f75d6GOcDAACYig4CAADAVIQPAABgKsIHAAAwFeEDAACYivABAABMRfgAAACmInwAAABTET4AAICpCB8AAMBUhA8AAGAqwgcAADAV4QMAAJjq/wfTHRCU1UAHmAAAAABJRU5ErkJggg==", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" + "execution_count": null, + "metadata": { + "pycharm": { + "is_executing": true } - ], + }, + "outputs": [], "source": [ "plt.plot(X, ground_truth(X), 'o', alpha = .5, label = 'Original Datapoints')\n", "plt.plot(sampler_proposal, ground_truth(sampler_proposal), 'o', alpha = .5, label = 'New Datapoints')\n", "plt.legend()\n", "plt.show()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + } } ], "metadata": { diff --git a/src/autora/experimentalist/nearest_value/__init__.py b/src/autora/experimentalist/nearest_value/__init__.py index 6005508..f7081e5 100644 --- a/src/autora/experimentalist/nearest_value/__init__.py +++ b/src/autora/experimentalist/nearest_value/__init__.py @@ -56,6 +56,8 @@ def sample( if isinstance(conditions, pd.DataFrame): x_new = pd.DataFrame(x_new, columns=conditions.columns) + else: + x_new = pd.DataFrame(x_new) return x_new