{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Predictions with the trained RF-models\n", "\n", "Linn Alexandra Emhjellen, 2021.\n" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import os\n", "import matplotlib.pyplot as plt\n", "import joblib" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "from sklearn.preprocessing import StandardScaler\n", "from sklearn import datasets, linear_model\n", "from sklearn.ensemble import RandomForestClassifier,RandomForestRegressor\n", "from sklearn.metrics import recall_score,roc_curve,auc\n", "from sklearn.model_selection import cross_val_score\n", "from sklearn.model_selection import cross_val_predict\n", "from sklearn import metrics" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "# vestland dataset\n", "#df_database = pd.read_excel(\"ML_Vestland_database2.xlsx\")\n", "#df_database = pd.read_excel('ML_Lærdal_Aurland_database.xlsx')\n", "#df_database = pd.read_excel('ML_test_area_database.xlsx')\n", "#df_database = pd.read_excel('ML_Lærdal_Gård_Bø_database.xlsx')\n", "\n", "\n", "#df_database = pd.read_csv('ML_Lærdal_Aurland_close_10_m_database.csv')\n", "\n", "df_database = pd.read_csv(\"ML_Vestland_West_10_m_database.csv\")\n", "df_database = df_database.dropna()" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "# load models\n", "\n", "RF_p1_model = joblib.load(\"../RF/lr_p1_Emhjellen2.joblib\")\n", "RF_p2_model = joblib.load(\"../RF/lr_p2_Emhjellen2.joblib\")\n", "RF_p3_model = joblib.load(\"../RF/lr_p3_Emhjellen2.joblib\")\n", "RF_p4_model = joblib.load(\"../RF/lr_p4_Emhjellen2.joblib\")\n", "RF_p5_model = joblib.load(\"../RF/lr_p5_Emhjellen2.joblib\")\n", "RF_p6_model = joblib.load(\"../RF/lr_p6_Emhjellen2.joblib\")\n", "RF_p7_model = joblib.load(\"../RF/lr_p7_Emhjellen2.joblib\")\n", "RF_p8_model = joblib.load(\"../RF/lr_p8_Emhjellen2.joblib\")\n", "\n" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "#missing_bedrocks = ['Arkose', 'Greenstone', 'Metagreywacke', 'Tonalite', 'Peridotite', 'Meta-arkose', 'Dioritic gneis', 'Pyroclastic rock', 'Quartz diorite', 'Sedimentary breccia', 'Andesite', 'Pyroksenite', 'Charnockite', 'Shale', 'Mica schist', 'Intermediate volcanic rock', 'Trondhjemite', 'Amphibole schist', 'Serpentinite', 'Mangerite', 'Felsic volcanic rock', 'Greywacke', 'Pegmatite/aplite', 'Tuffite', 'Mafic dyke (Diabase, Dolerite)', 'Eclogite', 'Mafic volcanic rock', 'Calcareous mica schist', 'Diorite', 'Garnet mica schist', 'Limestone', 'Basalt', 'Graphitic schist', 'Norite', 'Konglomerate', 'Sandstone', 'Volcanic breccia', 'Quartz dioritic gneiss', 'Dacite', 'Calcite marble', 'Calc-silicate rock', 'Syenite', 'Greenschist', 'Siltstone']\n", "\n", "#missing_bedrocks = ['Intermediate volcanic rock', 'Orthopyroxene gneiss', 'Metagabbro', 'Mangerite', 'Peridotite', 'Banded gneiss', 'Metagreywacke', 'Greywacke', 'Amphibolite', 'Syenite', 'Cataclasite', 'Limestone', 'Monzonitic gneiss', 'Rhyolite', 'Felsic volcanic rock', 'Andesite', 'Phyllite', 'Basalt', 'Mafic volcanic rock', 'Volcanic breccia', 'Tuffite', 'Amphibole schist', 'Mica gneiss', 'Shale', 'Meta-arkose', 'Quartz dioritic gneiss', 'Augengneiss', 'Diorite', 'Eclogite', 'Metasandstone', 'Tonalite', 'Mica schist', 'Serpentinite', 'Greenschist', 'Calcareous phyllite', 'Konglomerate', 'Siltstone', 'Quartz diorite', 'Calcareous mica schist', 'Dioritic gneis', 'Norite', 'Mafic dyke (Diabase, Dolerite)', 'Amphibole gneiss', 'Quartz schist', 'Granodioritic gneiss', 'Sedimentary breccia', 'Dacite', 'Sandstone', 'Pyroksenite', 'Garnet mica schist', 'Pyroclastic rock', 'Anorthosite', 'Pegmatite/aplite', 'Quartzite', 'Mylonite/Phyllonite', 'Calcite marble', 'Granodiorite', 'Graphitic schist', 'Calc-silicate rock', 'Gabbro', 'Arkose', 'Greenstone', 'Migmatite', 'Trondhjemite']\n", "\n", "#missing_bedrocks = ['Gabbro', 'Amphibole schist', 'Mylonite/Phyllonite', 'Amphibolite', 'Basalt', 'Greenschist', 'Mangerite', 'Intermediate volcanic rock', 'Volcanic breccia', 'Anorthosite', 'Tuffite', 'Granodioritic gneiss', 'Banded gneiss', 'Syenite', 'Dacite', 'Felsic volcanic rock', 'Metagreywacke', 'Augengneiss', 'Peridotite', 'Cataclasite', 'Konglomerate', 'Orthopyroxene gneiss', 'Pyroclastic rock', 'Metagabbro', 'Andesite', 'Greywacke', 'Shale', 'Calcareous phyllite', 'Mica schist', 'Graphitic schist', 'Calcareous mica schist', 'Norite', 'Calc-silicate rock', 'Diorite', 'Migmatite', 'Monzonitic gneiss', 'Arkose', 'Pyroksenite', 'Dioritic gneis', 'Siltstone', 'Quartzite', 'Phyllite', 'Meta-arkose', 'Serpentinite', 'Quartz dioritic gneiss', 'Garnet mica schist', 'Mafic volcanic rock', 'Quartz schist', 'Tonalite', 'Trondhjemite', 'Calcite marble', 'Quartz diorite', 'Amphibole gneiss', 'Granodiorite', 'Metasandstone', 'Rhyolite', 'Sedimentary breccia', 'Sandstone', 'Mica gneiss', 'Greenstone', 'Eclogite', 'Pegmatite/aplite', 'Limestone', 'Mafic dyke (Diabase, Dolerite)']\n", "\n", "\n", "#missing_bedrocks = ['Graphitic schist', 'Cataclasite', 'Dioritic gneis', 'Trondhjemite', 'Norite', 'Sedimentary breccia', 'Andesite', 'Mafic dyke (Diabase, Dolerite)', 'Gabbro', 'Quartz diorite', 'Greenstone', 'Dacite', 'Calc-silicate rock', 'Mangerite', 'Metasandstone', 'Quartz schist', 'Phyllite', 'Tonalite', 'Calcareous mica schist', 'Granite', 'Eclogite', 'Pegmatite/aplite', 'Pyroclastic rock', 'Mica gneiss', 'Mafic volcanic rock', 'Konglomerate', 'Intermediate volcanic rock', 'Migmatite', 'Calcareous phyllite', 'Quartzite', 'Diorite', 'Arkose', 'Volcanic breccia', 'Sandstone', 'Garnet mica schist', 'Siltstone', 'Calcite marble', 'Shale', 'Mylonite/Phyllonite', 'Granodioritic gneiss', 'Amphibole gneiss', 'Orthopyroxene gneiss', 'Syenite', 'Rhyolite', 'Banded gneiss', 'Quartz dioritic gneiss', 'Limestone', 'Metagreywacke', 'Basalt', 'Mica schist', 'Metagabbro', 'Granodiorite', 'Felsic volcanic rock', 'Tuffite', 'Meta-arkose', 'Greywacke', 'Peridotite', 'Pyroksenite', 'Augengneiss', 'Serpentinite', 'Greenschist', 'Amphibole schist', 'Amphibolite', 'Monzonitic gneiss']\n", "\n", "#missing_bedrocks = ['Granodiorite', 'Dioritic gneis', 'Gabbro', 'Monzodiorite', 'Quartz diorite', 'Tuffite', 'Norite', 'Felsic volcanic rock', 'Basalt', 'Shale', 'Andesite', 'Greenschist', 'Syenite', 'Calcareous phyllite', 'Meta-arkose', 'Arkose', 'Amphibole gneiss', 'Granite', 'Graphitic schist', 'Mafic dyke (Diabase, Dolerite)', 'Amphibole schist', 'Peridotite', 'Monzonitic gneiss', 'Garnet mica schist', 'Greenstone', 'Trondhjemite', 'Charnockite', 'Rhyolite', 'Siltstone', 'Metasandstone', 'Calcareous mica schist', 'Pegmatite/aplite', 'Volcanic breccia', 'Metagabbro', 'Granodioritic gneiss', 'Metagreywacke', 'Pyroclastic rock', 'Mica gneiss', 'Diorite', 'Calc-silicate rock', 'Augengneiss', 'Quartzite', 'Calcite marble', 'Mafic volcanic rock', 'Cataclasite', 'Migmatite', 'Pyroksenite', 'Intermediate volcanic rock', 'Tonalite', 'Mangerite', 'Greywacke', 'Sedimentary breccia', 'Anorthosite', 'Eclogite', 'Monzonite', 'Mylonite/Phyllonite', 'Serpentinite', 'Phyllite', 'Quartz dioritic gneiss', 'Orthopyroxene gneiss', 'Limestone']\n", "\n", "missing_bedrocks = ['Basalt', 'Syenite', 'Monzonitic gneiss', 'Garnet mica schist', 'Dioritic gneis', 'Quartzite', 'Monzonite', 'Pyroclastic rock', 'Calcite marble', 'Sedimentary breccia', 'Norite', 'Orthopyroxene gneiss', 'Meta-arkose', 'Quartz dioritic gneiss', 'Peridotite', 'Mica gneiss', 'Anorthosite', 'Shale', 'Mylonite/Phyllonite', 'Monzodiorite', 'Quartz diorite', 'Metagabbro', 'Andesite', 'Tonalite', 'Amphibole schist', 'Pegmatite/aplite', 'Metasandstone', 'Metagreywacke', 'Granodiorite', 'Limestone', 'Rhyolite', 'Granodioritic gneiss', 'Greenstone', 'Augengneiss', 'Siltstone', 'Calcareous mica schist', 'Gabbro', 'Mangerite', 'Trondhjemite', 'Volcanic breccia', 'Serpentinite', 'Phyllite', 'Eclogite', 'Calc-silicate rock', 'Graphitic schist', 'Pyroksenite', 'Calcareous phyllite', 'Granite', 'Greenschist', 'Mafic volcanic rock', 'Mafic dyke (Diabase, Dolerite)', 'Felsic volcanic rock', 'Diorite', 'Greywacke', 'Arkose', 'Charnockite', 'Intermediate volcanic rock', 'Tuffite', 'Cataclasite', 'Amphibole gneiss', 'Migmatite']" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "#df = pd.DataFrame(data, columns = ['Arkose', 'Greenstone', 'Metagreywacke', 'Tonalite', 'Peridotite', 'Meta-arkose', 'Dioritic gneis', 'Pyroclastic rock', 'Quartz diorite', 'Sedimentary breccia', 'Andesite', 'Pyroksenite', 'Charnockite', 'Shale', 'Mica schist', 'Intermediate volcanic rock', 'Trondhjemite', 'Amphibole schist', 'Serpentinite', 'Mangerite', 'Felsic volcanic rock', 'Greywacke', 'Pegmatite/aplite', 'Tuffite', 'Mafic dyke (Diabase, Dolerite)', 'Eclogite', 'Mafic volcanic rock', 'Calcareous mica schist', 'Diorite', 'Garnet mica schist', 'Limestone', 'Basalt', 'Graphitic schist', 'Norite', 'Konglomerate', 'Sandstone', 'Volcanic breccia', 'Quartz dioritic gneiss', 'Dacite', 'Calcite marble', 'Calc-silicate rock', 'Syenite', 'Greenschist', 'Siltstone'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " , , , , , , , , 'Konglomerate', 'Sandstone', 'Volcanic breccia', 'Quartz dioritic gneiss', 'Dacite', 'Calcite marble', 'Calc-silicate rock', 'Syenite', 'Greenschist', 'Siltstone'] " ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Basalt\n", "Syenite\n", "Monzonitic gneiss\n", "Garnet mica schist\n", "Dioritic gneis\n", "Quartzite\n", "Monzonite\n", "Pyroclastic rock\n", "Calcite marble\n", "Sedimentary breccia\n", "Norite\n", "Orthopyroxene gneiss\n", "Meta-arkose\n", "Quartz dioritic gneiss\n", "Peridotite\n", "Mica gneiss\n", "Anorthosite\n", "Shale\n", "Mylonite/Phyllonite\n", "Monzodiorite\n", "Quartz diorite\n", "Metagabbro\n", "Andesite\n", "Tonalite\n", "Amphibole schist\n", "Pegmatite/aplite\n", "Metasandstone\n", "Metagreywacke\n", "Granodiorite\n", "Limestone\n", "Rhyolite\n", "Granodioritic gneiss\n", "Greenstone\n", "Augengneiss\n", "Siltstone\n", "Calcareous mica schist\n", "Gabbro\n", "Mangerite\n", "Trondhjemite\n", "Volcanic breccia\n", "Serpentinite\n", "Phyllite\n", "Eclogite\n", "Calc-silicate rock\n", "Graphitic schist\n", "Pyroksenite\n", "Calcareous phyllite\n", "Granite\n", "Greenschist\n", "Mafic volcanic rock\n", "Mafic dyke (Diabase, Dolerite)\n", "Felsic volcanic rock\n", "Diorite\n", "Greywacke\n", "Arkose\n", "Charnockite\n", "Intermediate volcanic rock\n", "Tuffite\n", "Cataclasite\n", "Amphibole gneiss\n", "Migmatite\n" ] } ], "source": [ "for i in missing_bedrocks:\n", " print(i)\n", " df_database[i] = 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "df_database['Arkose'] = 0\n", "df_database['Greenstone'] = 0 \n", "df_database['Metagreywacke'] = 0\n", "df_database['Tonalite'] = 0\n", "df_database['Peridotite'] = 0\n", "df_database['Meta-arkose'] = 0\n", "df_database['Dioritic gneis'] = 0\n", "df_database['Pyroclastic rock'] = 0\n", "df_database['Quartz diorite'] = 0\n", "df_database['Sedimentary breccia'] = 0\n", "df_database['Andesite'] = 0\n", "df_database['Pyroksenite'] = 0\n", "df_database['Charnockite'] = 0\n", "df_database['Shale'] = 0\n", "df_database['Mica schist'] = 0\n", "df_database['Intermediate volcanic rock'] = 0\n", "df_database['Trondhjemite'] = 0\n", "df_database['Amphibole schist'] = 0\n", "df_database['Serpentinite'] = 0\n", "df_database['Mangerite'] = 0\n", "df_database['Felsic volcanic rock'] = 0\n", "df_database['Greywacke'] = 0\n", "df_database['Pegmatite/aplite'] = 0\n", "df_database['Tuffite'] = 0\n", "df_database['Mafic dyke (Diabase, Dolerite)'] = 0\n", "df_database['Mafic volcanic rock'] = 0\n", "df_database['Calcareous mica schist'] = 0\n", "df_database['Diorite'] = 0\n", "df_database['Garnet mica schist'] = 0\n", "df_database['Limestone'] = 0\n", "df_database['Basalt'] = 0\n", "df_database['Graphitic schist'] = 0\n", "df_database['Norite'] = 0\n" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "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", " \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", " \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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0POINT_XPOINT_YElevationSlopeAspectProfile_curvPlan_curvFlow_dirFlow_acc...Felsic volcanic rockDioriteGreywackeArkoseCharnockiteIntermediate volcanic rockTuffiteCataclasiteAmphibole gneissMigmatite
00-12021.5566.727549e+06212.35667421.265505261.564423-0.9289172.16950216.00.0...0000000000
11-12011.5566.727549e+06215.33285517.124088237.247726-0.1045491.0506338.021.0...0000000000
22-12001.5566.727549e+06217.09384216.037911231.8048710.052524-0.7517068.02.0...0000000000
33-11991.5566.727549e+06219.43772920.578068248.7411192.373503-2.1141378.05.0...0000000000
44-11981.5566.727549e+06224.55523722.921480254.060852-2.0837711.69204716.00.0...0000000000
..................................................................
492376492376-1531.5566.733009e+06568.71008315.073245209.229599-1.011383-0.7120678.02.0...0000000000
492377492377-1521.5566.733009e+06570.21466116.294689214.0924990.1115300.6706738.00.0...0000000000
492378492378-1511.5566.733009e+06571.42431617.588123207.1574101.255567-0.3467288.02.0...0000000000
492379492379-1501.5566.733009e+06573.16540517.707794209.771149-0.668694-0.5230644.03.0...0000000000
492380492380-1491.5566.733009e+06575.25317415.909173222.063995-1.713338-0.0335898.09.0...0000000000
\n", "

492381 rows × 102 columns

\n", "
" ], "text/plain": [ " Unnamed: 0 POINT_X POINT_Y Elevation Slope \\\n", "0 0 -12021.556 6.727549e+06 212.356674 21.265505 \n", "1 1 -12011.556 6.727549e+06 215.332855 17.124088 \n", "2 2 -12001.556 6.727549e+06 217.093842 16.037911 \n", "3 3 -11991.556 6.727549e+06 219.437729 20.578068 \n", "4 4 -11981.556 6.727549e+06 224.555237 22.921480 \n", "... ... ... ... ... ... \n", "492376 492376 -1531.556 6.733009e+06 568.710083 15.073245 \n", "492377 492377 -1521.556 6.733009e+06 570.214661 16.294689 \n", "492378 492378 -1511.556 6.733009e+06 571.424316 17.588123 \n", "492379 492379 -1501.556 6.733009e+06 573.165405 17.707794 \n", "492380 492380 -1491.556 6.733009e+06 575.253174 15.909173 \n", "\n", " Aspect Profile_curv Plan_curv Flow_dir Flow_acc ... \\\n", "0 261.564423 -0.928917 2.169502 16.0 0.0 ... \n", "1 237.247726 -0.104549 1.050633 8.0 21.0 ... \n", "2 231.804871 0.052524 -0.751706 8.0 2.0 ... \n", "3 248.741119 2.373503 -2.114137 8.0 5.0 ... \n", "4 254.060852 -2.083771 1.692047 16.0 0.0 ... \n", "... ... ... ... ... ... ... \n", "492376 209.229599 -1.011383 -0.712067 8.0 2.0 ... \n", "492377 214.092499 0.111530 0.670673 8.0 0.0 ... \n", "492378 207.157410 1.255567 -0.346728 8.0 2.0 ... \n", "492379 209.771149 -0.668694 -0.523064 4.0 3.0 ... \n", "492380 222.063995 -1.713338 -0.033589 8.0 9.0 ... \n", "\n", " Felsic volcanic rock Diorite Greywacke Arkose Charnockite \\\n", "0 0 0 0 0 0 \n", "1 0 0 0 0 0 \n", "2 0 0 0 0 0 \n", "3 0 0 0 0 0 \n", "4 0 0 0 0 0 \n", "... ... ... ... ... ... \n", "492376 0 0 0 0 0 \n", "492377 0 0 0 0 0 \n", "492378 0 0 0 0 0 \n", "492379 0 0 0 0 0 \n", "492380 0 0 0 0 0 \n", "\n", " Intermediate volcanic rock Tuffite Cataclasite Amphibole gneiss \\\n", "0 0 0 0 0 \n", "1 0 0 0 0 \n", "2 0 0 0 0 \n", "3 0 0 0 0 \n", "4 0 0 0 0 \n", "... ... ... ... ... \n", "492376 0 0 0 0 \n", "492377 0 0 0 0 \n", "492378 0 0 0 0 \n", "492379 0 0 0 0 \n", "492380 0 0 0 0 \n", "\n", " Migmatite \n", "0 0 \n", "1 0 \n", "2 0 \n", "3 0 \n", "4 0 \n", "... ... \n", "492376 0 \n", "492377 0 \n", "492378 0 \n", "492379 0 \n", "492380 0 \n", "\n", "[492381 rows x 102 columns]" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_database" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [], "source": [ "# feature combinations\n", "p1 = df_database[['Slope']]\n", "\n", "p2 = df_database[['Slope','Elevation']]\n", "\n", "p3 = df_database[['Slope','North','East','North East','North West','South','South East','South West','West']]\n", "\n", "p4 = df_database[['Slope','Elevation','Plan_curv','Profile_curv','TRI','Distance_to_roads']]\n", "\n", "p5 = df_database[['Slope','Elevation','Plan_curv','Profile_curv','TRI','Flow_dir','Flow_acc','Distance_to_roads']]\n", "\n", "p6 = df_database[['Slope','Elevation','Plan_curv','Profile_curv','TRI']]\n", "\n", "p7 = df_database[['Elevation','North','East','North East','North West','South','South East','South West','West','Plan_curv','Profile_curv','TRI','Flow_dir','Flow_acc','Distance_to_roads']]\n", "\n", "p8 = df_database[['Slope','Elevation','North','East','North East','North West','South','South East','South West','West','Plan_curv','Profile_curv','TRI','Flow_dir','Flow_acc','Distance_to_roads',\n", " 'Granite','Granodiorite','Tonalite','Trondhjemite','Syenite','Monzonite','Monzodiorite','Quartz diorite','Diorite','Gabbro','Norite','Peridotite','Pyroksenite','Charnockite','Mangerite','Anorthosite','Mafic dyke (Diabase, Dolerite)','Pegmatite/aplite','Felsic volcanic rock','Rhyolite','Dacite','Intermediate volcanic rock','Andesite','Mafic volcanic rock','Basalt',\n", " 'Pyroclastic rock','Volcanic breccia','Siltstone','Sandstone','Greywacke','Arkose','Konglomerate','Sedimentary breccia','Limestone','Tuffite','Shale','Phyllite','Mica schist','Garnet mica schist','Calcareous phyllite','Calcareous mica schist','Amphibole schist','Graphitic schist','Calcite marble',\n", " 'Metasandstone','Metagreywacke','Meta-arkose','Quartzite','Quartz schist','Mica gneiss','Calc-silicate rock','Amphibole gneiss','Granitic gneiss','Granodioritic gneiss','Tonalitic gneiss','Quartz dioritic gneiss','Monzonitic gneiss','Dioritic gneis','Orthopyroxene gneiss','Migmatite','Augengneiss',\n", " 'Banded gneiss','Greenschist','Greenstone','Amphibolite','Metagabbro','Eclogite','Serpentinite','Mylonite/Phyllonite','Cataclasite']]\n", "\n", "feature_combinations = [p1,p2,p3,p4,p5,p6,p7,p8]" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "x_p1 = p1[~np.isnan(p1).any(axis=1)]\n", "x_p2 = p2[~np.isnan(p2).any(axis=1)]\n", "x_p3 = p3[~np.isnan(p3).any(axis=1)]\n", "x_p4 = p4[~np.isnan(p4).any(axis=1)]\n", "x_p5 = p5[~np.isnan(p5).any(axis=1)]\n", "x_p6 = p6[~np.isnan(p6).any(axis=1)]\n", "x_p7 = p7[~np.isnan(p7).any(axis=1)]\n", "x_p8 = p8[~np.isnan(p8).any(axis=1)]\n", "\n", "x_p = [x_p1,x_p2,x_p3,x_p4,x_p5,x_p6,x_p7,x_p8]" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [], "source": [ "rf_models = [RF_p1_model,RF_p2_model,RF_p3_model,RF_p4_model,RF_p5_model,RF_p6_model,RF_p7_model,RF_p8_model]\n", "\n", "predictions = []\n", "pred_probabilities = []\n", "\n", "for i in range(0,len(x_p)):\n", " \n", " AUTO_SCALING = True\n", " if AUTO_SCALING:\n", " scaler = StandardScaler()\n", " scaler.fit(x_p[i])\n", " x_p_i = scaler.transform(x_p[i])\n", " \n", " p_i_predictions = rf_models[i].predict(x_p_i)\n", " predictions.append(p_i_predictions)\n", " \n", " prob_p_i = rf_models[i].predict_proba(x_p_i)\n", " pred_probabilities.append(prob_p_i)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "df_coor = df_database[['POINT_X', 'POINT_Y']]" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[0.91548145, 0.08451855],\n", " [0.97716025, 0.02283975],\n", " [0.9839588 , 0.0160412 ],\n", " ...,\n", " [0.97346074, 0.02653926],\n", " [0.97241575, 0.02758425],\n", " [0.98461904, 0.01538096]])" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pred_probabilities[0]" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "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", "
POINT_XPOINT_Y
0-12021.5566.727549e+06
1-12011.5566.727549e+06
2-12001.5566.727549e+06
3-11991.5566.727549e+06
4-11981.5566.727549e+06
.........
492376-1531.5566.733009e+06
492377-1521.5566.733009e+06
492378-1511.5566.733009e+06
492379-1501.5566.733009e+06
492380-1491.5566.733009e+06
\n", "

492381 rows × 2 columns

\n", "
" ], "text/plain": [ " POINT_X POINT_Y\n", "0 -12021.556 6.727549e+06\n", "1 -12011.556 6.727549e+06\n", "2 -12001.556 6.727549e+06\n", "3 -11991.556 6.727549e+06\n", "4 -11981.556 6.727549e+06\n", "... ... ...\n", "492376 -1531.556 6.733009e+06\n", "492377 -1521.556 6.733009e+06\n", "492378 -1511.556 6.733009e+06\n", "492379 -1501.556 6.733009e+06\n", "492380 -1491.556 6.733009e+06\n", "\n", "[492381 rows x 2 columns]" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_coor" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p1'] = predictions[0]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p1'] = pred_probabilities[0][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p1'] = predictions[0]\n", "df_coor['lr_Vestland_prob_p1'] = pred_probabilities[0][:,1]" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "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", "
POINT_XPOINT_Ylr_Vestland_pred_p1lr_Vestland_prob_p1
0-12021.5566.727549e+0600.084519
1-12011.5566.727549e+0600.022840
2-12001.5566.727549e+0600.016041
3-11991.5566.727549e+0600.068466
4-11981.5566.727549e+0600.137857
...............
492376-1531.5566.733009e+0600.011700
492377-1521.5566.733009e+0600.017442
492378-1511.5566.733009e+0600.026539
492379-1501.5566.733009e+0600.027584
492380-1491.5566.733009e+0600.015381
\n", "

492381 rows × 4 columns

\n", "
" ], "text/plain": [ " POINT_X POINT_Y lr_Vestland_pred_p1 lr_Vestland_prob_p1\n", "0 -12021.556 6.727549e+06 0 0.084519\n", "1 -12011.556 6.727549e+06 0 0.022840\n", "2 -12001.556 6.727549e+06 0 0.016041\n", "3 -11991.556 6.727549e+06 0 0.068466\n", "4 -11981.556 6.727549e+06 0 0.137857\n", "... ... ... ... ...\n", "492376 -1531.556 6.733009e+06 0 0.011700\n", "492377 -1521.556 6.733009e+06 0 0.017442\n", "492378 -1511.556 6.733009e+06 0 0.026539\n", "492379 -1501.556 6.733009e+06 0 0.027584\n", "492380 -1491.556 6.733009e+06 0 0.015381\n", "\n", "[492381 rows x 4 columns]" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_coor" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p2'] = predictions[1]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p2'] = pred_probabilities[1][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p2'] = predictions[1]\n", "df_coor['lr_Vestland_prob_p2'] = pred_probabilities[1][:,1]" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p3'] = predictions[2]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p3'] = pred_probabilities[2][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p3'] = predictions[2]\n", "df_coor['lr_Vestland_prob_p3'] = pred_probabilities[2][:,1]" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p4'] = predictions[3]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p4'] = pred_probabilities[3][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p4'] = predictions[3]\n", "df_coor['lr_Vestland_prob_p4'] = pred_probabilities[3][:,1]" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p5'] = predictions[4]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p5'] = pred_probabilities[4][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p5'] = predictions[4]\n", "df_coor['lr_Vestland_prob_p5'] = pred_probabilities[4][:,1]" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p6'] = predictions[5]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p6'] = pred_probabilities[5][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p6'] = predictions[5]\n", "df_coor['lr_Vestland_prob_p6'] = pred_probabilities[5][:,1]" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p7'] = predictions[6]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p7'] = pred_probabilities[6][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p7'] = predictions[6]\n", "df_coor['lr_Vestland_prob_p7'] = pred_probabilities[6][:,1]" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ ":1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_pred_p8'] = predictions[7]\n", ":2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " df_coor['lr_Vestland_prob_p8'] = pred_probabilities[7][:,1]\n" ] } ], "source": [ "df_coor['lr_Vestland_pred_p8'] = predictions[7]\n", "df_coor['lr_Vestland_prob_p8'] = pred_probabilities[7][:,1]" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "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", " \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", " \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", "
POINT_XPOINT_Ylr_Vestland_pred_p1lr_Vestland_prob_p1lr_Vestland_pred_p2lr_Vestland_prob_p2lr_Vestland_pred_p3lr_Vestland_prob_p3lr_Vestland_pred_p4lr_Vestland_prob_p4lr_Vestland_pred_p5lr_Vestland_prob_p5lr_Vestland_pred_p6lr_Vestland_prob_p6lr_Vestland_pred_p7lr_Vestland_prob_p7lr_Vestland_pred_p8lr_Vestland_prob_p8
0-12021.5566.727549e+0600.08451900.08387200.14871100.08198700.08344000.07819310.55711103.665532e-02
1-12011.5566.727549e+0600.02284000.02335300.04171000.02284700.02361200.02230210.50345908.876416e-03
2-12001.5566.727549e+0600.01604100.01651000.02932500.01701800.01752500.01678210.50288506.343416e-03
3-11991.5566.727549e+0600.06846600.06757300.12176200.07821200.08095700.07544010.56738102.926984e-02
4-11981.5566.727549e+0600.13785700.13283400.23361100.12333000.12498000.12143310.50882705.738864e-02
.........................................................
492376-1531.5566.733009e+0600.01170000.00683500.02137600.00000900.00000900.00702200.00232603.901299e-07
492377-1521.5566.733009e+0600.01744200.01008200.03188400.00001200.00001200.00941800.00203205.146157e-07
492378-1511.5566.733009e+0600.02653900.01520100.04841100.00001800.00001800.01497700.00205207.660662e-07
492379-1501.5566.733009e+0600.02758400.01574600.05029800.00001900.00002000.01638800.00219407.805199e-07
492380-1491.5566.733009e+0600.01538100.00883900.02811800.00001100.00001100.00959000.00236904.310515e-07
\n", "

492381 rows × 18 columns

\n", "
" ], "text/plain": [ " POINT_X POINT_Y lr_Vestland_pred_p1 lr_Vestland_prob_p1 \\\n", "0 -12021.556 6.727549e+06 0 0.084519 \n", "1 -12011.556 6.727549e+06 0 0.022840 \n", "2 -12001.556 6.727549e+06 0 0.016041 \n", "3 -11991.556 6.727549e+06 0 0.068466 \n", "4 -11981.556 6.727549e+06 0 0.137857 \n", "... ... ... ... ... \n", "492376 -1531.556 6.733009e+06 0 0.011700 \n", "492377 -1521.556 6.733009e+06 0 0.017442 \n", "492378 -1511.556 6.733009e+06 0 0.026539 \n", "492379 -1501.556 6.733009e+06 0 0.027584 \n", "492380 -1491.556 6.733009e+06 0 0.015381 \n", "\n", " lr_Vestland_pred_p2 lr_Vestland_prob_p2 lr_Vestland_pred_p3 \\\n", "0 0 0.083872 0 \n", "1 0 0.023353 0 \n", "2 0 0.016510 0 \n", "3 0 0.067573 0 \n", "4 0 0.132834 0 \n", "... ... ... ... \n", "492376 0 0.006835 0 \n", "492377 0 0.010082 0 \n", "492378 0 0.015201 0 \n", "492379 0 0.015746 0 \n", "492380 0 0.008839 0 \n", "\n", " lr_Vestland_prob_p3 lr_Vestland_pred_p4 lr_Vestland_prob_p4 \\\n", "0 0.148711 0 0.081987 \n", "1 0.041710 0 0.022847 \n", "2 0.029325 0 0.017018 \n", "3 0.121762 0 0.078212 \n", "4 0.233611 0 0.123330 \n", "... ... ... ... \n", "492376 0.021376 0 0.000009 \n", "492377 0.031884 0 0.000012 \n", "492378 0.048411 0 0.000018 \n", "492379 0.050298 0 0.000019 \n", "492380 0.028118 0 0.000011 \n", "\n", " lr_Vestland_pred_p5 lr_Vestland_prob_p5 lr_Vestland_pred_p6 \\\n", "0 0 0.083440 0 \n", "1 0 0.023612 0 \n", "2 0 0.017525 0 \n", "3 0 0.080957 0 \n", "4 0 0.124980 0 \n", "... ... ... ... \n", "492376 0 0.000009 0 \n", "492377 0 0.000012 0 \n", "492378 0 0.000018 0 \n", "492379 0 0.000020 0 \n", "492380 0 0.000011 0 \n", "\n", " lr_Vestland_prob_p6 lr_Vestland_pred_p7 lr_Vestland_prob_p7 \\\n", "0 0.078193 1 0.557111 \n", "1 0.022302 1 0.503459 \n", "2 0.016782 1 0.502885 \n", "3 0.075440 1 0.567381 \n", "4 0.121433 1 0.508827 \n", "... ... ... ... \n", "492376 0.007022 0 0.002326 \n", "492377 0.009418 0 0.002032 \n", "492378 0.014977 0 0.002052 \n", "492379 0.016388 0 0.002194 \n", "492380 0.009590 0 0.002369 \n", "\n", " lr_Vestland_pred_p8 lr_Vestland_prob_p8 \n", "0 0 3.665532e-02 \n", "1 0 8.876416e-03 \n", "2 0 6.343416e-03 \n", "3 0 2.926984e-02 \n", "4 0 5.738864e-02 \n", "... ... ... \n", "492376 0 3.901299e-07 \n", "492377 0 5.146157e-07 \n", "492378 0 7.660662e-07 \n", "492379 0 7.805199e-07 \n", "492380 0 4.310515e-07 \n", "\n", "[492381 rows x 18 columns]" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_coor" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [], "source": [ "#df_coor.to_csv(\"lr_results_lærdal_aurland_close_10.csv\")" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [], "source": [ "df_coor.to_csv('Lr_results_Vestland_West_10.csv')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.3" } }, "nbformat": 4, "nbformat_minor": 4 }