From f495ddd0729c7ac61dc8d8f54fc706178a0d253f Mon Sep 17 00:00:00 2001 From: kwinkunks Date: Sun, 21 Apr 2024 11:31:53 +0200 Subject: [PATCH] Catch up --- docs/notebooks/Demo.ipynb | 129 ++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 74 deletions(-) diff --git a/docs/notebooks/Demo.ipynb b/docs/notebooks/Demo.ipynb index 2bfbd3f..d39cc31 100644 --- a/docs/notebooks/Demo.ipynb +++ b/docs/notebooks/Demo.ipynb @@ -1,26 +1,5 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "import matplotlib.pyplot as plt\n", - "import seaborn as sns\n", - "\n", - "from sklearn.svm import SVC\n", - "from sklearn.ensemble import RandomForestClassifier\n", - "from sklearn.pipeline import make_pipeline\n", - "from sklearn.metrics import accuracy_score, f1_score\n", - "from sklearn.model_selection import train_test_split\n", - "from sklearn.preprocessing import StandardScaler\n", - "\n", - "np.set_printoptions(suppress=True)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -32,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -209,12 +188,14 @@ "4 2382.602601 siliciclastic True " ] }, - "execution_count": 2, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "import pandas as pd\n", + "\n", "df = pd.read_csv('https://raw.githubusercontent.com/scienxlab/datasets/main/kgs/panoma-training-data.csv')\n", "\n", "df.head()" @@ -229,10 +210,12 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ + "import numpy as np\n", + "\n", "rng = np.random.default_rng(42)\n", "\n", "df['Noise'] = rng.normal(size=len(df))" @@ -254,7 +237,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -264,7 +247,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -280,7 +263,7 @@ "Name: count, dtype: int64" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -300,16 +283,16 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[]" + "[]" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, @@ -325,6 +308,8 @@ } ], "source": [ + "import matplotlib.pyplot as plt\n", + "\n", "shrimplin = df['Well Name'] == 'SHRIMPLIN'\n", "\n", "plt.plot(df.loc[shrimplin, 'Depth'], df.loc[shrimplin, 'GR'])" @@ -339,7 +324,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -355,7 +340,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -458,7 +443,7 @@ "max 200.000000 2802.871147 8.094000 3.178854" ] }, - "execution_count": 8, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -469,16 +454,16 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" }, @@ -494,12 +479,14 @@ } ], "source": [ + "import seaborn as sns\n", + "\n", "sns.pairplot(df, x_vars=features, y_vars=features, hue='Lithology')" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -508,7 +495,7 @@ "" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" }, @@ -545,7 +532,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -554,7 +541,7 @@ "'0.4.2rc2.dev14+g54704af.d20240421'" ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -575,7 +562,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -584,7 +571,7 @@ "True" ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -595,7 +582,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -604,7 +591,7 @@ "True" ] }, - "execution_count": 13, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -615,7 +602,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -624,7 +611,7 @@ "3.4203357617985457" ] }, - "execution_count": 14, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -635,7 +622,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -644,7 +631,7 @@ "array(['dolomite', 'sandstone', 'mudstone', 'wackestone'], dtype='