From dc24717e86b3ecd753e277260de7a740721ce1aa Mon Sep 17 00:00:00 2001 From: Emeli Dral Date: Fri, 3 Mar 2023 17:21:58 +0000 Subject: [PATCH] Version 0.2.6 --- ...descriptors_in_text_specific_metrics.ipynb | 386 +----------------- src/evidently/_version.py | 2 +- 2 files changed, 19 insertions(+), 369 deletions(-) diff --git a/examples/how_to_questions/how_to_use_text_descriptors_in_text_specific_metrics.ipynb b/examples/how_to_questions/how_to_use_text_descriptors_in_text_specific_metrics.ipynb index ed62b488c4..477a933b4a 100644 --- a/examples/how_to_questions/how_to_use_text_descriptors_in_text_specific_metrics.ipynb +++ b/examples/how_to_questions/how_to_use_text_descriptors_in_text_specific_metrics.ipynb @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "id": "tmBHvzszAEN-" }, @@ -29,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "id": "-Xko20Q1FvZV" }, @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -58,33 +58,7 @@ "id": "HmpgBJFqH7y-", "outputId": "58c188d4-d810-4ce9-a806-9d3a033309c8" }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[nltk_data] Downloading package words to\n", - "[nltk_data] C:\\Users\\v.morov\\AppData\\Roaming\\nltk_data...\n", - "[nltk_data] Package words is already up-to-date!\n", - "[nltk_data] Downloading package wordnet to\n", - "[nltk_data] C:\\Users\\v.morov\\AppData\\Roaming\\nltk_data...\n", - "[nltk_data] Package wordnet is already up-to-date!\n", - "[nltk_data] Downloading package omw-1.4 to\n", - "[nltk_data] C:\\Users\\v.morov\\AppData\\Roaming\\nltk_data...\n", - "[nltk_data] Package omw-1.4 is already up-to-date!\n" - ] - }, - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "import nltk\n", "nltk.download('words')\n", @@ -94,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "id": "Y_EV_iCeCiz1" }, @@ -107,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "id": "YWyVOGsM2gV7" }, @@ -119,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -128,151 +102,14 @@ "id": "1lUgz2JlAheU", "outputId": "4202acf4-3c91-4809-81a6-fd5fc72430a2" }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
Unnamed:_0Clothing_IDAgeTitleReview_TextRatingRecommended_INDPositive_Feedback_CountDivision_NameDepartment_NameClass_Name
00.0767.033.0NoneAbsolutely wonderful - silky and sexy and comf...4.01.00.0InitmatesIntimateIntimates
11.01080.034.0NoneLove this dress! it's sooo pretty. i happene...5.01.04.0GeneralDressesDresses
22.01077.060.0Some major design flawsI had such high hopes for this dress and reall...3.00.00.0GeneralDressesDresses
33.01049.050.0My favorite buy!I love, love, love this jumpsuit. it's fun, fl...5.01.00.0General PetiteBottomsPants
44.0847.047.0Flattering shirtThis shirt is very flattering to all due to th...5.01.06.0GeneralTopsBlouses
\n", - "
" - ], - "text/plain": [ - " Unnamed:_0 Clothing_ID Age Title \\\n", - "0 0.0 767.0 33.0 None \n", - "1 1.0 1080.0 34.0 None \n", - "2 2.0 1077.0 60.0 Some major design flaws \n", - "3 3.0 1049.0 50.0 My favorite buy! \n", - "4 4.0 847.0 47.0 Flattering shirt \n", - "\n", - " Review_Text Rating Recommended_IND \\\n", - "0 Absolutely wonderful - silky and sexy and comf... 4.0 1.0 \n", - "1 Love this dress! it's sooo pretty. i happene... 5.0 1.0 \n", - "2 I had such high hopes for this dress and reall... 3.0 0.0 \n", - "3 I love, love, love this jumpsuit. it's fun, fl... 5.0 1.0 \n", - "4 This shirt is very flattering to all due to th... 5.0 1.0 \n", - "\n", - " Positive_Feedback_Count Division_Name Department_Name Class_Name \n", - "0 0.0 Initmates Intimate Intimates \n", - "1 4.0 General Dresses Dresses \n", - "2 0.0 General Dresses Dresses \n", - "3 0.0 General Petite Bottoms Pants \n", - "4 6.0 General Tops Blouses " - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "reviews.head()" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "id": "60Wxndq7FzGT" }, @@ -294,66 +131,11 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "scrolled": true }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "
Loading...
\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "#NO descriptors\n", "\n", @@ -369,64 +151,9 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "
Loading...
\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "#WITH descriptors\n", "\n", @@ -458,7 +185,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -468,62 +195,7 @@ "outputId": "0e86becd-b75d-42f9-d115-72de002f8786", "scrolled": true }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "
Loading...
\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "#NO descriptors\n", "\n", @@ -537,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -547,29 +219,7 @@ "outputId": "644abbf8-d717-484f-8125-902b99288c59", "scrolled": true }, - "outputs": [ - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[1;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", - "Cell \u001B[1;32mIn [12], line 12\u001B[0m\n\u001B[0;32m 1\u001B[0m \u001B[38;5;66;03m#WITH descriptors\u001B[39;00m\n\u001B[0;32m 2\u001B[0m text_overview_report \u001B[38;5;241m=\u001B[39m Report(metrics\u001B[38;5;241m=\u001B[39m[\n\u001B[0;32m 3\u001B[0m TextOverviewPreset(column_name\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mReview_Text\u001B[39m\u001B[38;5;124m\"\u001B[39m, descriptors\u001B[38;5;241m=\u001B[39m{\n\u001B[0;32m 4\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mReview Text OOV\u001B[39m\u001B[38;5;124m\"\u001B[39m : OOV(),\n\u001B[1;32m (...)\u001B[0m\n\u001B[0;32m 9\u001B[0m })\n\u001B[0;32m 10\u001B[0m ])\n\u001B[1;32m---> 12\u001B[0m text_overview_report\u001B[38;5;241m.\u001B[39mrun(reference_data\u001B[38;5;241m=\u001B[39mreviews_ref, current_data\u001B[38;5;241m=\u001B[39mreviews_cur, column_mapping\u001B[38;5;241m=\u001B[39mcolumn_mapping)\n\u001B[0;32m 13\u001B[0m text_overview_report\n", - "File \u001B[1;32m~\\PycharmProjects\\evidently\\src\\evidently\\report\\report.py:93\u001B[0m, in \u001B[0;36mReport.run\u001B[1;34m(self, reference_data, current_data, column_mapping)\u001B[0m\n\u001B[0;32m 91\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m 92\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mIncorrect item instead of a metric or metric preset was passed to Report\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m---> 93\u001B[0m curr_add, ref_add \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_inner_suite\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcreate_additional_features\u001B[49m\u001B[43m(\u001B[49m\u001B[43mcurrent_data\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mreference_data\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mdata_definition\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 94\u001B[0m data \u001B[38;5;241m=\u001B[39m InputData(reference_data, current_data, ref_add, curr_add, column_mapping, data_definition)\n\u001B[0;32m 95\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_inner_suite\u001B[38;5;241m.\u001B[39mrun_calculate(data)\n", - "File \u001B[1;32m~\\PycharmProjects\\evidently\\src\\evidently\\suite\\base_suite.py:261\u001B[0m, in \u001B[0;36mSuite.create_additional_features\u001B[1;34m(self, current_data, reference_data, data_definition)\u001B[0m\n\u001B[0;32m 259\u001B[0m curr_additional_data \u001B[38;5;241m=\u001B[39m feature_data\n\u001B[0;32m 260\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m--> 261\u001B[0m curr_additional_data \u001B[38;5;241m=\u001B[39m \u001B[43mcurr_additional_data\u001B[49m\u001B[38;5;241m.\u001B[39mjoin(feature_data)\n\u001B[0;32m 262\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m reference_data \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m 263\u001B[0m \u001B[38;5;28;01mcontinue\u001B[39;00m\n", - "File \u001B[1;32m~\\PycharmProjects\\evidently\\src\\evidently\\suite\\base_suite.py:261\u001B[0m, in \u001B[0;36mSuite.create_additional_features\u001B[1;34m(self, current_data, reference_data, data_definition)\u001B[0m\n\u001B[0;32m 259\u001B[0m curr_additional_data \u001B[38;5;241m=\u001B[39m feature_data\n\u001B[0;32m 260\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m--> 261\u001B[0m curr_additional_data \u001B[38;5;241m=\u001B[39m \u001B[43mcurr_additional_data\u001B[49m\u001B[38;5;241m.\u001B[39mjoin(feature_data)\n\u001B[0;32m 262\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m reference_data \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m 263\u001B[0m \u001B[38;5;28;01mcontinue\u001B[39;00m\n", - "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_39_64.pyx:1179\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_39_64.SafeCallWrapper.__call__\u001B[1;34m()\u001B[0m\n", - "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_39_64.pyx:620\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_39_64.PyDBFrame.trace_dispatch\u001B[1;34m()\u001B[0m\n", - "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_39_64.pyx:929\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_39_64.PyDBFrame.trace_dispatch\u001B[1;34m()\u001B[0m\n", - "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_39_64.pyx:920\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_39_64.PyDBFrame.trace_dispatch\u001B[1;34m()\u001B[0m\n", - "File \u001B[1;32m_pydevd_bundle\\pydevd_cython_win32_39_64.pyx:317\u001B[0m, in \u001B[0;36m_pydevd_bundle.pydevd_cython_win32_39_64.PyDBFrame.do_wait_suspend\u001B[1;34m()\u001B[0m\n", - "File \u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\PyCharm-P\\ch-0\\223.8617.48\\plugins\\python\\helpers\\pydev\\pydevd.py:1160\u001B[0m, in \u001B[0;36mPyDB.do_wait_suspend\u001B[1;34m(self, thread, frame, event, arg, send_suspend_message, is_unhandled_exception)\u001B[0m\n\u001B[0;32m 1157\u001B[0m from_this_thread\u001B[38;5;241m.\u001B[39mappend(frame_id)\n\u001B[0;32m 1159\u001B[0m \u001B[38;5;28;01mwith\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_threads_suspended_single_notification\u001B[38;5;241m.\u001B[39mnotify_thread_suspended(thread_id, stop_reason):\n\u001B[1;32m-> 1160\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_do_wait_suspend\u001B[49m\u001B[43m(\u001B[49m\u001B[43mthread\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mframe\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mevent\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43marg\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43msuspend_type\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mfrom_this_thread\u001B[49m\u001B[43m)\u001B[49m\n", - "File \u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\PyCharm-P\\ch-0\\223.8617.48\\plugins\\python\\helpers\\pydev\\pydevd.py:1175\u001B[0m, in \u001B[0;36mPyDB._do_wait_suspend\u001B[1;34m(self, thread, frame, event, arg, suspend_type, from_this_thread)\u001B[0m\n\u001B[0;32m 1172\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_call_mpl_hook()\n\u001B[0;32m 1174\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mprocess_internal_commands()\n\u001B[1;32m-> 1175\u001B[0m \u001B[43mtime\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43msleep\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m0.01\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[0;32m 1177\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcancel_async_evaluation(get_current_thread_id(thread), \u001B[38;5;28mstr\u001B[39m(\u001B[38;5;28mid\u001B[39m(frame)))\n\u001B[0;32m 1179\u001B[0m \u001B[38;5;66;03m# process any stepping instructions\u001B[39;00m\n", - "\u001B[1;31mKeyboardInterrupt\u001B[0m: " - ] - } - ], + "outputs": [], "source": [ "#WITH descriptors\n", "text_overview_report = Report(metrics=[\n", @@ -613,7 +263,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.8.13" } }, "nbformat": 4, diff --git a/src/evidently/_version.py b/src/evidently/_version.py index 3457b9bba9..41e41bca32 100644 --- a/src/evidently/_version.py +++ b/src/evidently/_version.py @@ -1,5 +1,5 @@ #!/usr/bin/env python # coding: utf-8 -version_info = (0, 2, 5) +version_info = (0, 2, 6) __version__ = ".".join(map(str, version_info))