Skip to content

Instantly share code, notes, and snippets.

@yogabonito
Created August 29, 2017 15:04
Show Gist options
  • Save yogabonito/4788eaa456931eba14779a93263968df to your computer and use it in GitHub Desktop.
Save yogabonito/4788eaa456931eba14779a93263968df to your computer and use it in GitHub Desktop.
p-regions-problem exact solution
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from region.p_regions.exact import ClusterExact"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import libpysal as ps\n",
"import libpysal.api as ps_api\n",
"import networkx as nx\n",
"import pandas as pd\n",
"import geopandas as gpd\n",
"from shapely.geometry import Polygon\n",
"\n",
"from region.util import dataframe_to_dict"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Inputs for the 3x3 lattice example"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADYBJREFUeJzt3W2oHuWdx/Hvb2NsF7Q1NKFKkmMsDSxabE0PqW7bbVgp\nG0Mx0FpWoT4US+iDrMW+WNuFSH2z+MZSV7cSqlRdUXdV5FQiIq2s9oWpxzQ+Zl1OhWIkrNG0idJW\nN+W/L+6JPXs88R7NzH2f6PcDQ+bhOjP/XDn3LzNzD9ekqpD03vYX4y5A0vgZBJIMAkkGgSQMAkkY\nBJIwCCRhEEjCIJAEHDWuAy9durRWrVo1rsNL7wmPPfbYS1W1bFi7sQXBqlWrmJ6eHtfhpfeEJL9p\n085LA0kGgSSDQBIGgSQMAkm0DIIk65M8m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cK\nDwJ/1fHxbwN2A//L4Jr3YuDrwNfrz3eRr2vqexKY7KEPhtVwyaw+eAT46x5q+AyDm2JPADuaacMo\n+6JlDb32BXAq8KumhqeAzX19LnyyUNKCuTSQNEYGgSSDQJJBIAmDQBIGgSQMAkkYBJKA/wNkdlDh\n4PSM+QAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb4eb3d30>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"geometry = [\n",
" Polygon([(x, y),\n",
" (x, y+1),\n",
" (x+1, y+1),\n",
" (x+1, y)]) for y in range(3) for x in range(3)\n",
"]\n",
"\n",
"areas_gdf = gpd.GeoDataFrame(\n",
" {\"values\": [726.7, 623.6, 487.3,\n",
" 200.4, 245.0, 481.0,\n",
" 170.9, 225.9, 226.9]},\n",
" geometry=geometry)\n",
"areas_gdf[\"values2\"] = areas_gdf[[\"values\"]] + 1\n",
"areas_gdf.plot(column=\"values\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"areas_w = ps.weights.Contiguity.Rook.from_dataframe(areas_gdf)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"areas_dict = areas_w.neighbors"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"areas_nx = areas_w.to_networkx()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{0: 726.70000000000005,\n",
" 1: 623.60000000000002,\n",
" 2: 487.30000000000001,\n",
" 3: 200.40000000000001,\n",
" 4: 245.0,\n",
" 5: 481.0,\n",
" 6: 170.90000000000001,\n",
" 7: 225.90000000000001,\n",
" 8: 226.90000000000001}"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from region.util import dataframe_to_dict\n",
"data_dict = dataframe_to_dict(areas_gdf, \"values\")\n",
"data_dict"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Clustering"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## with dict"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### &nbsp;&nbsp;&nbsp;&nbsp;i) using `fit_from_dict()`"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2)\n",
"cluster_obj.fit_from_dict(areas_dict, data_dict)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADU5JREFUeJzt3V+oHvWdx/H3Z2NsF9QamoCS5BhLA4sWW+0hjduyhC2F\nGIqBrcV4UbVYQruVTaE3tgsRvVl6Y6mrVEKVxiKaXRVJJVKkDdhemHqSjZo/63IqFCMBY9ImSlvd\nyHcvnok9ezzxGc3Mc87R9wuGzJ/fmfnml/N8MjPP8JtUFZI+3P5mtguQNPsMAkkGgSSDQBIGgSQM\nAkkYBJIwCCRhEEgCzpqtAy9evLhWrFgxW4eXPhR27979alUtGdZu1oJgxYoVTExMzNbhpQ+FJL9v\n085LA0kGgSSDQBIGgSQMAkm0DIIka5O8kGQyyS0zbP9Ikm3N9l1JVnRdqKT+DA2CJAuAu4GrgEuA\n65JcMq3ZTcAfquqTwA+BH3RdqKT+tDkjWAVMVtWLVfUm8BCwflqb9cDWZv5h4ItJ0l2ZkvrU5oGi\npcBLU5YPAZ87XZuqOpnkOPBx4NWpjZJsBDYCjI2NtSrQPJHeadGiRRw7dqyz/Y30ycKq2gJsARgf\nH289aupbJ37UW03zxYLzNtkP2A+nLDhvU6f7a3Np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osvjt6xhTZLjU/pg80ztzrCG5Ul2JjnQDJi7aYY2vfZF\nyxp67YuRDhz8XkYo6msCFjAY1egTwNnAs8Al09r8M3BPM78B2DYLNdwI3NVjP/wDcAWw7zTb1wFP\nAAFWA7tmoYY1wOM9/z5cCFzRzJ8L/M8M/xa99kXLGnrti+bvdk4zvxDYBaye1qaTz8VcOSNYBUxW\n1YtV9SbwEIMBUafqe4DUNjX0qqqeYjCew+msB+6vgaeB85NcOOIaeldVh6tqTzP/GnCQwbiYU/Xa\nFy1r6FXzdxvJwMFzJQjeHvy0cYh3dnrfA6S2qQHgK82p6MNJlnd4/Dba1ti3K5vT1SeSXNrngZpT\n3csZ/G841cj64l1qgJ77YlQDB8+VIJgvfg6sqKrLgCf5axJ/mOxh8Njqp4F/Bx7r60BJzgEeAb5T\nVSf6Os4Z1NB7X1TVW1X1GWAZsCrJp7o+BsydIDg1+Okpy5p1M7Z5twFS+6yhqo5W1RvN4k+Az3Z4\n/Dba9FOvqurEqdPVqtoBLEyyuOvjJFnI4AP4QFU9OkOT3vtiWA2j6otm/39kMIL42mmbOvlczJUg\neAZYmeTiJGczuOmxfVqbvgdIHVrDtGvQqxlcN47SduD65o75auB4VR0eZQFJLjh1DZpkFYPfoS4D\nmWb/9wIHq+qO0zTrtS/a1NB3X2SUAwf3dcfzfdwhXcfgzuzvgH9t1t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb4da5390>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_dict\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_dict\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### &nbsp;&nbsp;&nbsp;&nbsp;ii) using `fit()`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`fit()` is currently just an alias for `fit_from_dict()`"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2) # reset cluster_obj\n",
"cluster_obj.fit_from_dict(areas_dict, data_dict)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADU5JREFUeJzt3V+oHvWdx/H3Z2NsF9QamoCS5BhLA4sWW+0hjduyhC2F\nGIqBrcV4UbVYQruVTaE3tgsRvVl6Y6mrVEKVxiKaXRVJJVKkDdhemHqSjZo/63IqFCMBY9ImSlvd\nyHcvnok9ezzxGc3Mc87R9wuGzJ/fmfnml/N8MjPP8JtUFZI+3P5mtguQNPsMAkkGgSSDQBIGgSQM\nAkkYBJIwCCRhEEgCzpqtAy9evLhWrFgxW4eXPhR27979alUtGdZu1oJgxYoVTExMzNbhpQ+FJL9v\n085LA0kGgSSDQBIGgSQMAkm0DIIka5O8kGQyyS0zbP9Ikm3N9l1JVnRdqKT+DA2CJAuAu4GrgEuA\n65JcMq3ZTcAfquqTwA+BH3RdqKT+tDkjWAVMVtWLVfUm8BCwflqb9cDWZv5h4ItJ0l2ZkvrU5oGi\npcBLU5YPAZ87XZuqOpnkOPBx4NWpjZJsBDYCjI2NtSrQPJHeadGiRRw7dqyz/Y30ycKq2gJsARgf\nH289aupbJ37UW03zxYLzNtkP2A+nLDhvU6f7a3Np8DKwfMrysmbdjG2SnAV8DDjaRYGS+tc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QDJi7aYY2vfZF\nyxp67YuRDhz8XkYo6msCFjAY1egTwNnAs8Al09r8M3BPM78B2DYLNdwI3NVjP/wDcAWw7zTb1wFP\nAAFWA7tmoYY1wOM9/z5cCFzRzJ8L/M8M/xa99kXLGnrti+bvdk4zvxDYBaye1qaTz8VcOSNYBUxW\n1YtV9SbwEIMBUafqe4DUNjX0qqqeYjCew+msB+6vgaeB85NcOOIaeldVh6tqTzP/GnCQwbiYU/Xa\nFy1r6FXzdxvJwMFzJQjeHvy0cYh3dnrfA6S2qQHgK82p6MNJlnd4/Dba1ti3K5vT1SeSXNrngZpT\n3csZ/G841cj64l1qgJ77YlQDB8+VIJgvfg6sqKrLgCf5axJ/mOxh8Njqp4F/Bx7r60BJzgEeAb5T\nVSf6Os4Z1NB7X1TVW1X1GWAZsCrJp7o+BsydIDg1+Okpy5p1M7Z5twFS+6yhqo5W1RvN4k+Az3Z4\n/Dba9FOvqurEqdPVqtoBLEyyuOvjJFnI4AP4QFU9OkOT3vtiWA2j6otm/39kMIL42mmbOvlczJUg\neAZYmeTiJGczuOmxfVqbvgdIHVrDtGvQqxlcN47SduD65o75auB4VR0eZQFJLjh1DZpkFYPfoS4D\nmWb/9wIHq+qO0zTrtS/a1NB3X2SUAwf3dcfzfdwhXcfgzuzvgH9t1t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb4da5ac8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_dict\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_dict\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## with GeoDataFrame"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### &nbsp;&nbsp;&nbsp;&nbsp; using a string as 2<sup>nd</sup> arg"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2) # reset cluster_obj\n",
"cluster_obj.fit_from_geodataframe(areas_gdf, \"values\")"
]
},
{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ZpT\n3csZ/G841cj64l1qgJ77YlQDB8+VIJgvfg6sqKrLgCf5axJ/mOxh8Njqp4F/Bx7r60BJzgEeAb5T\nVSf6Os4Z1NB7X1TVW1X1GWAZsCrJp7o+BsydIDg1+Okpy5p1M7Z5twFS+6yhqo5W1RvN4k+Az3Z4\n/Dba9FOvqurEqdPVqtoBLEyyuOvjJFnI4AP4QFU9OkOT3vtiWA2j6otm/39kMIL42mmbOvlczJUg\neAZYmeTiJGczuOmxfVqbvgdIHVrDtGvQqxlcN47SduD65o75auB4VR0eZQFJLjh1DZpkFYPfoS4D\nmWb/9wIHq+qO0zTrtS/a1NB3X2SUAwf3dcfzfdwhXcfgzuzvgH9t1t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb149c048>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_gdf\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_gdf\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### &nbsp;&nbsp;&nbsp;&nbsp; using a list of length 1 as 2<sup>nd</sup> arg"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2) # reset cluster_obj\n",
"cluster_obj.fit_from_geodataframe(areas_gdf, [\"values\"])"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADU5JREFUeJzt3V+oHvWdx/H3Z2NsF9QamoCS5BhLA4sWW+0hjduyhC2F\nGIqBrcV4UbVYQruVTaE3tgsRvVl6Y6mrVEKVxiKaXRVJJVKkDdhemHqSjZo/63IqFCMBY9ImSlvd\nyHcvnok9ezzxGc3Mc87R9wuGzJ/fmfnml/N8MjPP8JtUFZI+3P5mtguQNPsMAkkGgSSDQBIGgSQM\nAkkYBJIwC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t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb4e03b00>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_gdf\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_gdf\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### &nbsp;&nbsp;&nbsp;&nbsp; using a list containing multiple elements as 2<sup>nd</sup> arg"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n",
"/home/vegcev/.local/lib/python3.5/site-packages/sklearn/utils/validation.py:395: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.\n",
" DeprecationWarning)\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2) # reset cluster_obj\n",
"cluster_obj.fit_from_geodataframe(areas_gdf, [\"values\", \"values2\"])"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADU5JREFUeJzt3V+oHvWdx/H3Z2NsF9QamoCS5BhLA4sWW+0hjduyhC2F\nGIqBrcV4UbVYQruVTaE3tgsRvVl6Y6mrVEKVxiKaXRVJJVKkDdhemHqSjZo/63IqFCMBY9ImSlvd\nyHcvnok9ezzxGc3Mc87R9wuGzJ/fmfnml/N8MjPP8JtUFZI+3P5mtguQNPsMAkkGgSSDQBIGgSQM\nAkkYBJIwCCRhEEgCzpqtAy9evLhWrFgxW4eXPhR27979alUtGdZu1oJgxYoVTExMzNbhpQ+FJL9v\n085LA0kGgSSDQBIGgSQMAkm0DIIka5O8kGQyyS0zbP9Ikm3N9l1JVnRdqKT+DA2CJAuAu4GrgEuA\n65JcMq3ZTcAfquqTwA+BH3RdqKT+tDkjWAVMVtWLVfUm8BCwflqb9cDWZv5h4ItJ0l2ZkvrU5oGi\npcBLU5YPAZ87XZuqOpnkOPBx4NWpjZJsBDYCjI2NtSrQPJHeadGiRRw7dqyz/Y30ycKq2gJsARgf\nH289aupbJ37UW03zxYLzNtkP2A+nLDhvU6f7a3Np8DKwfMrysmbdjG2SnA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ztzrCG5Ul2JjnQDJi7aYY2vfZF\nyxp67YuRDhz8XkYo6msCFjAY1egTwNnAs8Al09r8M3BPM78B2DYLNdwI3NVjP/wDcAWw7zTb1wFP\nAAFWA7tmoYY1wOM9/z5cCFzRzJ8L/M8M/xa99kXLGnrti+bvdk4zvxDYBaye1qaTz8VcOSNYBUxW\n1YtV9SbwEIMBUafqe4DUNjX0qqqeYjCew+msB+6vgaeB85NcOOIaeldVh6tqTzP/GnCQwbiYU/Xa\nFy1r6FXzdxvJwMFzJQjeHvy0cYh3dnrfA6S2qQHgK82p6MNJlnd4/Dba1ti3K5vT1SeSXNrngZpT\n3csZ/G841cj64l1qgJ77YlQDB8+VIJgvfg6sqKrLgCf5axJ/mOxh8Njqp4F/Bx7r60BJzgEeAb5T\nVSf6Os4Z1NB7X1TVW1X1GWAZsCrJp7o+BsydIDg1+Okpy5p1M7Z5twFS+6yhqo5W1RvN4k+Az3Z4\n/Dba9FOvqurEqdPVqtoBLEyyuOvjJFnI4AP4QFU9OkOT3vtiWA2j6otm/39kMIL42mmbOvlczJUg\neAZYmeTiJGczuOmxfVqbvgdIHVrDtGvQqxlcN47SduD65o75auB4VR0eZQFJLjh1DZpkFYPfoS4D\nmWb/9wIHq+qO0zTrtS/a1NB3X2SUAwf3dcfzfdwhXcfgzuzvgH9t1t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb137a400>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_gdf\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_gdf\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## with networkx"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2) # reset cluster_obj\n",
"cluster_obj.fit_from_networkx(areas_nx, data_dict)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADU5JREFUeJzt3V+oHvWdx/H3Z2NsF9QamoCS5BhLA4sWW+0hjduyhC2F\nGIqBrcV4UbVYQruVTaE3tgsRvVl6Y6mrVEKVxiKaXRVJJVKkDdhemHqSjZo/63IqFCMBY9ImSlvd\nyHcvnok9ezzxGc3Mc87R9wuGzJ/fmfnml/N8MjPP8JtUFZI+3P5mtguQNPsMAkkGgSSDQBIGgSQM\nAkkYBJIwCCRhEEgCzpqtAy9evLhWrFgxW4eXPhR27979alUtGdZu1oJgxYoVTExMzNbhpQ+FJL9v\n085LA0kGgSSDQBIGgSQMAkm0DIIka5O8kGQyyS0zbP9Ikm3N9l1JVnRdqKT+DA2CJAuAu4GrgEuA\n65JcMq3ZTcAfquqTwA+BH3RdqKT+tDkjWAVMVtWLVfUm8BCwflqb9cDWZv5h4ItJ0l2ZkvrU5oGi\npcBLU5YPAZ87XZuqOpnkOPBx4NWpjZJsBDYCjI2NtSrQPJHeadGiRRw7dqyz/Y30ycKq2gJsARgf\nH289aupbJ37UW03zxYLzNtkP2A+nLDhvU6f7a3Np8DKwfMrysmbdjG2SnAV8DDjaRYGS+tcmCJ4B\nVia5OMnZwAZg+7Q224EbmvlrgF+V46RL88bQS4Pmmv9m4BfAAuC+qtqf5HZgoqq2A/cCP0syCRxj\nEBaS5olW9wiqagewY9q6zV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OM9/z5cCFzRzJ8L/M8M/xa99kXLGnrti+bvdk4zvxDYBaye1qaTz8VcOSNYBUxW\n1YtV9SbwEIMBUafqe4DUNjX0qqqeYjCew+msB+6vgaeB85NcOOIaeldVh6tqTzP/GnCQwbiYU/Xa\nFy1r6FXzdxvJwMFzJQjeHvy0cYh3dnrfA6S2qQHgK82p6MNJlnd4/Dba1ti3K5vT1SeSXNrngZpT\n3csZ/G841cj64l1qgJ77YlQDB8+VIJgvfg6sqKrLgCf5axJ/mOxh8Njqp4F/Bx7r60BJzgEeAb5T\nVSf6Os4Z1NB7X1TVW1X1GWAZsCrJp7o+BsydIDg1+Okpy5p1M7Z5twFS+6yhqo5W1RvN4k+Az3Z4\n/Dba9FOvqurEqdPVqtoBLEyyuOvjJFnI4AP4QFU9OkOT3vtiWA2j6otm/39kMIL42mmbOvlczJUg\neAZYmeTiJGczuOmxfVqbvgdIHVrDtGvQqxlcN47SduD65o75auB4VR0eZQFJLjh1DZpkFYPfoS4D\nmWb/9wIHq+qO0zTrtS/a1NB3X2SUAwf3dcfzfdwhXcfgzuzvgH9t1t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb120bfd0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_nx\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_nx\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## with W"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"running FLOW algorithm\n"
]
}
],
"source": [
"cluster_obj = ClusterExact(2) # reset cluster_obj\n",
"cluster_obj.fit_from_w(areas_w, data_dict)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAAD8CAYAAACcoKqNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADU5JREFUeJzt3V+oHvWdx/H3Z2NsF9QamoCS5BhLA4sWW+0hjduyhC2F\nGIqBrcV4UbVYQruVTaE3tgsRvVl6Y6mrVEKVxiKaXRVJJVKkDdhemHqSjZo/63IqFCMBY9ImSlvd\nyHcvnok9ezzxGc3Mc87R9wuGzJ/fmfnml/N8MjPP8JtUFZI+3P5mtguQNPsMAkkGgSSDQBIGgSQM\nAkkYBJIwCCRhEEgCzpqtAy9evLhWrFgxW4eXPhR27979alUtGdZu1oJgxYoVTExMzNbhpQ+FJL9v\n085LA0kGgSSDQBIGgSQMAkm0DIIka5O8kGQyyS0zbP9Ikm3N9l1JVnRdqKT+DA2CJAuAu4GrgEuA\n65JcMq3ZTcAfquqTwA+BH3RdqKT+tDkjWAVMVtWLVfUm8BCwflqb9cDWZv5h4ItJ0l2ZkvrU5oGi\npcBLU5YPAZ87XZuqOpnkOPBx4NWpjZJsBDYCjI2NtSrQPJHeadGiRRw7dqyz/Y30ycKq2gJsARgf\nH289aupbJ37UW03zxYLzNtkP2A+nLDhvU6f7a3Np8DKwfMrysmbdjG2SnAV8DDjaRYGS+tcmCJ4B\nVia5OMnZwAZg+7Q224EbmvlrgF+V46RL88bQS4Pmmv9m4BfAAuC+qtqf5HZgoqq2A/cCP0syCRxj\nEBaS5olW9wiqagewY9q6zVPm/wJ8tdvSJI2KTxZKMggkGQSSMAgkYRBIwiCQhEEgCYNAEgaBJAwC\nSRgEkjAIJGEQSMIgkIRBIAmDQBIGgSQMAkkYBJIwCCRhEEjCIJCEQSAJg0ASLYM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zP/GnCQwbiYU/Xa\nFy1r6FXzdxvJwMFzJQjeHvy0cYh3dnrfA6S2qQHgK82p6MNJlnd4/Dba1ti3K5vT1SeSXNrngZpT\n3csZ/G841cj64l1qgJ77YlQDB8+VIJgvfg6sqKrLgCf5axJ/mOxh8Njqp4F/Bx7r60BJzgEeAb5T\nVSf6Os4Z1NB7X1TVW1X1GWAZsCrJp7o+BsydIDg1+Okpy5p1M7Z5twFS+6yhqo5W1RvN4k+Az3Z4\n/Dba9FOvqurEqdPVqtoBLEyyuOvjJFnI4AP4QFU9OkOT3vtiWA2j6otm/39kMIL42mmbOvlczJUg\neAZYmeTiJGczuOmxfVqbvgdIHVrDtGvQqxlcN47SduD65o75auB4VR0eZQFJLjh1DZpkFYPfoS4D\nmWb/9wIHq+qO0zTrtS/a1NB3X2SUAwf3dcfzfdwhXcfgzuzvgH9t1t0OXN3MfxT4T2AS+C3wiVmo\n4d+A/Qy+UdgJ/F3Hx38QOAz8L4Nr3puAbwLfrL/eRb67qe95YLyHPhhWw81T+uBp4O97qOELDG6K\nPQfsbaZ1o+yLljX02hfAZcB/NTXsAzb39bnwyUJJc+bSQNIsMggkGQSSDAJJGASSMAgkYRBIwiCQ\nBPwfDRpQTxEl+gAAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f3eb12762b0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"areas_gdf[\"region_w\"] = pd.Series(cluster_obj.labels_)\n",
"areas_gdf.plot(\"region_w\")\n",
"plt.gca().invert_yaxis()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"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.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment