MII_Salin_Oleg_PIbd-33/lec5.ipynb

1472 lines
2.9 MiB
Plaintext
Raw Normal View History

2024-11-20 19:19:56 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Загрузка данных"
]
},
{
"cell_type": "code",
"execution_count": 129,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[-2.32401186e+00 7.05074756e-01 4.48535225e-01 7.70090520e-01\n",
" -1.16617999e+00]\n",
" [-1.63988490e+00 -2.21973399e+00 -1.04704769e+00 -1.58925732e+00\n",
" -1.51443302e+00]\n",
" [-1.13037684e+00 -2.22988519e+00 -1.94326817e+00 -1.42554953e-01\n",
" 2.10224064e+00]\n",
" [ 8.89767155e-01 -1.99946166e-02 -5.92572962e-01 8.44169856e-01\n",
" 2.59653162e+00]\n",
" [ 2.52863614e+00 -5.86695065e-01 3.37245492e-01 -1.96432890e+00\n",
" -1.49138457e+00]\n",
" [-9.47696580e-01 7.07797661e-01 -9.33993509e-02 1.48477196e+00\n",
" 1.49224073e+00]\n",
" [-2.44791559e+00 -1.22007013e+00 -6.33679067e-01 -5.20124031e-01\n",
" -1.26493805e+00]\n",
" [-2.60738014e-01 -6.97849748e-01 -9.82892815e-02 -9.39816888e-01\n",
" -1.25008567e+00]\n",
" [ 2.75252550e+00 -9.43712510e-03 5.24284409e-01 -1.37074995e+00\n",
" -8.57686558e-01]\n",
" [-3.67259514e-01 7.63618140e-01 7.07417207e-01 9.98208513e-02\n",
" -1.19947859e+00]\n",
" [ 3.36701785e+00 8.88176188e-01 1.10099581e+00 -9.84728456e-01\n",
" -8.51415934e-01]\n",
" [ 6.64819182e-01 3.03843068e+00 1.80593569e+00 1.79060735e+00\n",
" -1.93589802e-02]\n",
" [ 4.61145798e-01 1.01080810e+00 7.82473809e-01 2.42854908e-01\n",
" -5.98775837e-01]\n",
" [ 1.94269425e+00 -3.01272578e+00 -1.28541457e+00 -3.07312169e+00\n",
" -8.09046024e-01]\n",
" [ 7.53183627e-01 -1.38299848e+00 -4.94669889e-01 -1.55270510e+00\n",
" -7.94455067e-01]\n",
" [ 1.66835300e+00 -2.24532878e+00 -5.78017577e-01 -2.98222798e+00\n",
" -1.96090718e+00]\n",
" [-3.23311391e-01 -1.92013284e+00 -8.07199059e-01 -1.72397519e+00\n",
" -1.22268471e+00]\n",
" [ 3.87002898e-01 -1.72388946e+00 -1.45822798e+00 -3.92560220e-01\n",
" 1.99062094e+00]\n",
" [ 1.29180739e+00 -6.66698890e-01 -4.89292656e-01 -4.67528892e-01\n",
" 9.68194767e-01]\n",
" [ 3.00903015e+00 -5.62690331e-01 4.05331998e-01 -2.12079964e+00\n",
" -1.49594730e+00]\n",
" [-1.05578756e+00 -1.52753087e+00 -7.01896645e-01 -1.13772773e+00\n",
" -1.08257843e+00]\n",
" [ 3.85933835e-02 2.72219392e+00 1.73929616e+00 1.48597851e+00\n",
" -7.16527769e-01]\n",
" [ 1.65725033e+00 2.68970754e-01 -5.13933472e-02 2.61643933e-01\n",
" 1.48183567e+00]\n",
" [-1.11207161e+00 -2.30290435e+00 -7.26655967e-01 -2.36588668e+00\n",
" -2.69526342e+00]\n",
" [ 5.61837545e-01 2.66700802e-01 7.30978713e-01 -9.13221264e-01\n",
" -1.97501003e+00]\n",
" [-1.35492363e-01 7.02465614e-01 4.36856228e-01 4.27915114e-01\n",
" -2.00752796e-01]\n",
" [ 2.47328934e+00 -3.47444499e+00 -1.45007006e+00 -3.63801255e+00\n",
" -9.57984984e-01]\n",
" [-1.34159831e+00 -6.26203386e-01 -9.21340952e-01 7.75816671e-01\n",
" 1.59145461e+00]\n",
" [-7.99516309e-01 -1.91004018e-01 -1.34443068e-01 4.74966951e-02\n",
" -2.39666613e-01]\n",
" [-1.67702569e+00 5.89636027e-01 1.12756226e-01 1.05319626e+00\n",
" 1.39555930e-01]\n",
" [-4.71637541e-01 1.06921441e+00 1.27433073e-01 1.62243064e+00\n",
" 1.63500568e+00]\n",
" [-1.59204136e+00 -1.62432795e+00 -1.79256496e+00 6.72608794e-01\n",
" 2.64593841e+00]\n",
" [-9.41729071e-02 -1.28770715e-01 -1.02190057e+00 1.56654050e+00\n",
" 3.58359742e+00]\n",
" [-1.44225275e+00 8.90625263e-01 2.03200368e-01 1.35560587e+00\n",
" 5.46984283e-01]\n",
" [ 3.62538500e-01 -1.78842111e+00 -1.46613316e+00 -4.81452484e-01\n",
" 1.87035172e+00]\n",
" [ 1.54884285e+00 -9.65672411e-02 -9.79541287e-02 -2.43744164e-01\n",
" 8.20152259e-01]\n",
" [-2.49857121e+00 -2.26679455e+00 -1.13773822e+00 -1.36995184e+00\n",
" -1.63373925e+00]\n",
" [ 3.83263661e-01 5.57447514e-01 -1.94520234e-01 1.19334466e+00\n",
" 2.11548115e+00]\n",
" [-1.02259420e-01 1.68088463e+00 7.11452032e-01 1.56386210e+00\n",
" 8.88784737e-01]\n",
" [-2.40919500e+00 2.58034721e-04 -5.83804388e-01 1.40215680e+00\n",
" 1.21043305e+00]\n",
" [-9.16088134e-01 -1.25825735e+00 -1.13167611e+00 2.57433578e-02\n",
" 1.20268179e+00]\n",
" [-6.72912927e-01 -5.13438246e-01 -1.74146645e-01 -4.37010449e-01\n",
" -7.34468017e-01]\n",
" [-1.24940354e+00 -8.33029422e-01 -1.05365534e+00 6.47641045e-01\n",
" 1.68680226e+00]\n",
" [ 1.08781107e+00 -6.59236358e-01 3.54211521e-01 -1.87766488e+00\n",
" -2.32363703e+00]\n",
" [ 1.24169036e+00 -7.60775616e-01 -3.73392153e-01 -8.14681743e-01\n",
" 3.00057482e-01]\n",
" [-2.98242427e+00 -7.31481416e-02 8.39818910e-03 3.52643415e-01\n",
" -1.45346481e+00]\n",
" [-1.49955191e+00 -4.52175218e-01 -1.01024935e+00 1.24241729e+00\n",
" 2.24199765e+00]\n",
" [-1.64372400e+00 1.21437485e+00 8.25868474e-01 8.48376946e-01\n",
" -1.21362382e+00]\n",
" [ 4.82815115e-01 -1.60125809e+00 -6.97300730e-01 -1.51908316e+00\n",
" -6.08851929e-01]\n",
" [ 3.69196732e-01 1.39287818e+00 1.26603432e+00 5.40827949e-02\n",
" -1.65509196e+00]\n",
" [-2.33136489e+00 -6.21017288e-01 -2.15423676e-01 -2.72066365e-01\n",
" -1.51246813e+00]\n",
" [-1.55290874e+00 -6.55141194e-01 -5.45462670e-01 1.13871401e-01\n",
" 3.54445022e-03]\n",
" [-1.70867065e+00 -2.09139706e+00 -2.30818816e+00 8.10511888e-01\n",
" 3.55187277e+00]\n",
" [ 1.58229686e+00 -7.12483411e-01 3.91380708e-02 -1.50267249e+00\n",
" -1.02651792e+00]\n",
" [ 5.73921945e-01 -9.73172493e-01 -1.97728693e-01 -1.35927833e+00\n",
" -1.11470025e+00]\n",
" [ 1.65983137e+00 5.47758784e-01 1.98195614e-01 2.90712698e-01\n",
" 1.13493019e+00]\n",
" [ 9.21364254e-01 -1.06342762e+00 -1.04442434e+00 -1.03786828e-01\n",
" 2.07029521e+00]\n",
" [ 3.27190962e+00 1.84630675e-01 9.57879270e-01 -1.88367583e+00\n",
" -1.87253732e+00]\n",
" [ 1.17618176e+00 -1.23443978e+00 -3.15780257e-01 -1.68539285e+00\n",
" -9.76095704e-01]\n",
" [ 5.48339224e-01 2.63682216e+00 1.70610234e+00 1.31893406e+00\n",
" -5.59304052e-01]\n",
" [ 1.08449640e+00 -1.11130225e+00 -9.45159546e-01 -3.80836414e-01\n",
" 1.65628285e+00]\n",
" [-1.65570361e-01 -2.65300684e+00 -2.19185538e+00 -5.69896795e-01\n",
" 2.54148813e+00]\n",
" [-3.05246009e+00 -6.96843213e-01 -5.34818987e-01 2.71968474e-01\n",
" -7.62466037e-01]\n",
" [-1.40237494e+00 1.12322945e+00 7.74338118e-01 7.47355739e-01\n",
" -1.11252365e+00]\n",
" [-8.93686047e-01 -5.47012333e-01 -4.09857502e-01 -4.95024138e-02\n",
" -5.50505067e-04]\n",
" [ 3.30465394e+00 -8.32078650e-01 -5.48925999e-01 -9.66925184e-01\n",
" 1.68901590e+00]\n",
" [ 1.37030563e+00 -5.56716982e-01 -3.49002855e-01 -5.40926713e-01\n",
" 7.04387324e-01]\n",
" [ 8.66418291e-01 9.31841174e-01 3.04543386e-01 8.71059388e-01\n",
" 1.22674989e+00]\n",
" [ 2.07959188e+00 -3.11611817e-02 4.99785502e-01 -1.25424504e+00\n",
" -1.09615990e+00]\n",
" [ 4.38734763e-01 1.01911030e+00 2.50845305e-01 1.17778079e+00\n",
" 1.44026007e+00]\n",
" [-7.84260783e-01 4.64261795e-01 -6.74854194e-01 2.05952052e+00\n",
" 3.25349034e+00]\n",
" [ 1.13823897e+00 -2.23127395e+00 -6.13983375e-01 -2.81022722e+00\n",
" -2.01744288e+00]\n",
" [ 1.09352824e+00 -1.81798150e-01 3.84529148e-01 -1.14270174e+00\n",
" -1.40043942e+00]\n",
" [ 7.93459861e-01 -1.31465500e+00 -8.04000422e-01 -9.12580041e-01\n",
" 5.52431795e-01]\n",
" [ 5.73059507e-01 -4.79265988e+00 -2.46694576e+00 -3.74839519e+00\n",
" -7.40571087e-01]\n",
" [-2.66876373e-01 2.81947710e+00 1.59694025e+00 1.94225646e+00\n",
" -9.09190168e-02]\n",
" [-1.42090057e+00 1.30261908e-01 -3.93148823e-01 1.12605075e+00\n",
" 1.18288094e+00]\n",
" [ 5.80935274e-01 -1.66944383e+00 -1.18161788e+00 -8.11808714e-01\n",
" 1.13444490e+00]\n",
" [-1.91694566e+00 5.59871952e-02 1.50956034e-01 1.45489974e-01\n",
" -1.26652345e+00]\n",
" [-2.45626305e-01 -1.79881951e-01 -3.03596982e-02 -2.04394049e-01\n",
" -3.78571542e-01]\n",
" [-7.61341420e-01 4.56966196e-01 3.75352565e-01 2.31143996e-01\n",
" -7.63799261e-01]\n",
" [ 1.87532049e+00 -4.84389287e-02 2.73092483e-01 -8.58096335e-01\n",
" -3.54318040e-01]\n",
" [-1.02560771e+00 1.59381412e+00 3.04852423e-01 2.27292824e+00\n",
" 1.86181950e+00]\n",
" [ 6.55133420e-01 -1.45394216e+00 -1.28615744e+00 -2.87737560e-01\n",
" 2.03301200e+00]\n",
" [-1.09764135e+00 9.54341127e-01 5.98205807e-01 7.22670118e-01\n",
" -6.77475144e-01]\n",
" [-2.06545779e+00 1.02300229e+00 2.82286533e-01 1.53960758e+00\n",
" 2.68501701e-01]\n",
" [ 5.98430922e-01 -1.25715913e+00 -1.15810243e+00 -1.74597264e-01\n",
" 1.94715336e+00]\n",
" [ 2.19317944e+00 6.53583615e-01 4.88711783e-01 -1.23238237e-01\n",
" 4.80879262e-01]\n",
" [-1.99112180e+00 1.39225582e+00 4.50467983e-01 1.84679500e+00\n",
" 4.59310992e-01]\n",
" [-2.28506035e+00 4.29493275e-01 1.86820620e-01 7.60449188e-01\n",
" -7.48417786e-01]\n",
" [ 1.64928678e-01 3.17378349e+00 1.77659211e+00 2.14649065e+00\n",
" 1.74958852e-01]\n",
" [-1.26063140e+00 -1.58256204e+00 -1.56003412e+00 2.86014172e-01\n",
" 1.98878889e+00]\n",
" [-6.51202394e-01 -1.17946939e+00 -2.34913275e-01 -1.43526440e+00\n",
" -1.93921423e+00]\n",
" [ 4.07206333e-01 -5.86604679e-01 -2.83093246e-01 -5.46469347e-01\n",
" -1.99542756e-02]\n",
" [ 6.26050241e-01 -5.81468747e-01 -2.88410427e-01 -5.64614305e-01\n",
" 1.04149941e-01]\n",
" [-3.02807572e+00 -1.80180468e+00 -8.11852158e-01 -1.07811225e+00\n",
" -2.09304062e+00]\n",
" [-6.22496112e-01 8.20149679e-01 8.27459556e-01 2.77215026e-02\n",
" -1.64328274e+00]\n",
" [-5.62435594e-01 2.86710137e+00 1.42271503e+00 2.36993314e+00\n",
" 5.52791599e-01]\n",
" [ 1.59443272e+00 -2.72456995e-02 5.16717405e-02 -3.94999873e-01\n",
" 4.18477064e-01]\n",
" [-2.59329155e+00 2.41577012e+00 5.67006074e-01 3.43393527e+00\n",
" 1.98144945e+00]\n",
" [-1.19257193e+00 3.31165872e-02 -5.62117555e-01 1.21994436e+00\n",
" 1.71398590e+00]\n",
" [-9.12678493e-01 8.76975437e-01 7.90712908e-01 2.32431456e-01\n",
" -1.50240317e+00]\n",
" [-3.80285801e-01 1.01492530e+00 -8.92773445e-02 1.89188465e+00\n",
" 2.38351295e+00]\n",
" [ 9.80994864e-01 3.98631172e-01 6.22629648e-01 -5.76979510e-01\n",
" -1.09730105e+00]\n",
" [ 1.12293931e+00 -5.96546154e-02 -5.36985599e-01 6.44608332e-01\n",
" 2.39682611e+00]\n",
" [-1.68336645e+00 -1.34947106e-01 -5.77738556e-01 1.04973131e+00\n",
" 1.20099103e+00]\n",
" [ 3.44644261e+00 -9.06047771e-02 1.01155175e+00 -2.45926174e+00\n",
" -2.60121428e+00]\n",
" [ 1.55635768e+00 -2.42226510e-01 5.53666297e-02 -7.50069826e-01\n",
" -7.85014197e-02]\n",
" [ 9.34177543e-02 8.43197721e-01 7.77867381e-01 3.42471378e-02\n",
" -1.10075669e+00]\n",
" [ 1.84076164e+00 -1.28653158e+00 -3.05988484e-02 -2.37231664e+00\n",
" -1.89707040e+00]\n",
" [-8.24426464e-01 4.95525305e-01 -2.35201187e-01 1.35889573e+00\n",
" 1.62515550e+00]\n",
" [-1.37337974e+00 -4.27759235e-01 7.03784303e-02 -6.03001032e-01\n",
" -1.77892144e+00]\n",
" [-1.80630266e-01 9.06001500e-01 9.80680415e-01 -1.67276018e-01\n",
" -1.85504051e+00]\n",
" [-6.81671337e-01 6.53554194e-01 7.22599881e-01 -5.66575952e-02\n",
" -1.62953117e+00]\n",
" [ 3.34476851e-01 3.13051414e-01 -4.47382987e-01 1.23426435e+00\n",
" 2.52999859e+00]\n",
" [-3.03854933e-01 8.00584586e-01 1.13519922e+00 -5.87843504e-01\n",
" -2.72624640e+00]\n",
" [ 1.51574132e+00 1.40061832e+00 9.69059527e-01 3.91852912e-01\n",
" -1.86468780e-02]\n",
" [-2.31468266e-01 1.61622069e+00 1.02342668e+00 9.39796900e-01\n",
" -4.97860979e-01]\n",
" [-4.56684606e-01 1.01440959e+00 1.06868065e+00 -9.50219712e-02\n",
" -2.07264636e+00]\n",
" [-1.46692019e+00 -1.20243214e+00 -1.59523052e+00 1.00808170e+00\n",
" 2.86119265e+00]\n",
" [ 6.05369271e-02 1.85555246e+00 5.48226964e-01 2.10731187e+00\n",
" 1.96034708e+00]\n",
" [-7.69696067e-01 8.68764996e-01 7.21703517e-01 3.14590958e-01\n",
" -1.19612494e+00]\n",
" [-3.54774167e-01 6.71641610e-01 6.20182736e-01 9.64906137e-02\n",
" -1.06070173e+00]\n",
" [-1.10309302e+00 -5.69665127e-01 -7.77939549e-01 5.82639965e-01\n",
" 1.26746774e+00]\n",
" [ 2.24413787e+00 -2.24917026e+00 -5.48991553e-01 -3.13286090e+00\n",
" -1.83635720e+00]\n",
" [-1.85867893e+00 5.28156290e-01 1.10377843e-01 9.85518550e-01\n",
" -6.17404072e-02]\n",
" [-8.35303619e-01 8.94105746e-01 4.00333659e-01 9.21821654e-01\n",
" 5.85563526e-02]\n",
" [-6.80563819e-01 2.26687673e+00 1.44779726e+00 1.35502965e+00\n",
" -8.96170990e-01]\n",
" [-7.67910130e-01 9.72109045e-01 1.52462414e-01 1.46738401e+00\n",
" 1.20315838e+00]\n",
" [-2.86833951e-01 6.86835495e-01 3.17994439e-01 6.32015985e-01\n",
" 1.55223606e-01]\n",
" [-5.64907969e-01 -1.19546231e+00 -6.54276407e-01 -7.51993892e-01\n",
" -3.35692143e-01]\n",
" [ 4.13141684e+00 -7.47917442e-01 6.82256144e-01 -3.08816482e+00\n",
" -2.48062866e+00]\n",
" [ 1.58725355e+00 2.17687628e+00 1.56422235e+00 6.34504829e-01\n",
" -5.76190261e-01]\n",
" [ 1.10869323e+00 2.64110459e+00 8.24962970e-01 2.75511863e+00\n",
" 3.05263101e+00]\n",
" [-1.49702457e+00 5.24036105e-01 -9.39573409e-02 1.27222053e+00\n",
" 8.62852973e-01]\n",
" [ 2.09568939e+00 -1.66461385e+00 -2.12654949e-01 -2.72399819e+00\n",
" -1.91466502e+00]\n",
" [ 1.87232229e-01 6.88821300e-01 -5.27238705e-01 2.01655338e+00\n",
" 3.58850346e+00]\n",
" [ 2.73593477e+00 -4.25241487e-01 3.99117606e-01 -1.83847717e+00\n",
" -1.28940701e+00]\n",
" [-5.85530900e-02 1.64278513e+00 9.33853402e-01 1.10996287e+00\n",
" -2.48693018e-02]\n",
" [ 1.70380541e+00 1.80920644e-01 1.72343023e-01 -2.77491184e-01\n",
" 4.55840310e-01]\n",
" [-1.82481260e+00 -1.39620162e+00 -4.86021218e-01 -1.16768939e+00\n",
" -1.94751913e+00]\n",
" [ 5.22411828e-02 1.84085437e+00 5.19920027e-01 2.13325900e+00\n",
" 2.03303927e+00]\n",
" [ 6.53251865e-01 -1.47619962e+00 -1.06995257e+00 -6.97329890e-01\n",
" 1.15812059e+00]\n",
" [-1.59092913e+00 -2.72335754e+00 -2.66660440e+00 3.66518950e-01\n",
" 3.59859238e+00]]\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>X1</th>\n",
" <th>X2</th>\n",
" <th>X3</th>\n",
" <th>X4</th>\n",
" <th>X5</th>\n",
" <th>y</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>-2.324012</td>\n",
" <td>0.705075</td>\n",
" <td>0.448535</td>\n",
" <td>0.770091</td>\n",
" <td>-1.166180</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>-1.639885</td>\n",
" <td>-2.219734</td>\n",
" <td>-1.047048</td>\n",
" <td>-1.589257</td>\n",
" <td>-1.514433</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>-1.130377</td>\n",
" <td>-2.229885</td>\n",
" <td>-1.943268</td>\n",
" <td>-0.142555</td>\n",
" <td>2.102241</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>0.889767</td>\n",
" <td>-0.019995</td>\n",
" <td>-0.592573</td>\n",
" <td>0.844170</td>\n",
" <td>2.596532</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2.528636</td>\n",
" <td>-0.586695</td>\n",
" <td>0.337245</td>\n",
" <td>-1.964329</td>\n",
" <td>-1.491385</td>\n",
" <td>2</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" X1 X2 X3 X4 X5 y\n",
"0 -2.324012 0.705075 0.448535 0.770091 -1.166180 1\n",
"1 -1.639885 -2.219734 -1.047048 -1.589257 -1.514433 0\n",
"2 -1.130377 -2.229885 -1.943268 -0.142555 2.102241 1\n",
"3 0.889767 -0.019995 -0.592573 0.844170 2.596532 3\n",
"4 2.528636 -0.586695 0.337245 -1.964329 -1.491385 2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>X1</th>\n",
" <th>X2</th>\n",
" <th>X3</th>\n",
" <th>X4</th>\n",
" <th>X5</th>\n",
" <th>y</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>139</th>\n",
" <td>1.703805</td>\n",
" <td>0.180921</td>\n",
" <td>0.172343</td>\n",
" <td>-0.277491</td>\n",
" <td>0.455840</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>140</th>\n",
" <td>-1.824813</td>\n",
" <td>-1.396202</td>\n",
" <td>-0.486021</td>\n",
" <td>-1.167689</td>\n",
" <td>-1.947519</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>141</th>\n",
" <td>0.052241</td>\n",
" <td>1.840854</td>\n",
" <td>0.519920</td>\n",
" <td>2.133259</td>\n",
" <td>2.033039</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>142</th>\n",
" <td>0.653252</td>\n",
" <td>-1.476200</td>\n",
" <td>-1.069953</td>\n",
" <td>-0.697330</td>\n",
" <td>1.158121</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>143</th>\n",
" <td>-1.590929</td>\n",
" <td>-2.723358</td>\n",
" <td>-2.666604</td>\n",
" <td>0.366519</td>\n",
" <td>3.598592</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" X1 X2 X3 X4 X5 y\n",
"139 1.703805 0.180921 0.172343 -0.277491 0.455840 3\n",
"140 -1.824813 -1.396202 -0.486021 -1.167689 -1.947519 0\n",
"141 0.052241 1.840854 0.519920 2.133259 2.033039 1\n",
"142 0.653252 -1.476200 -1.069953 -0.697330 1.158121 3\n",
"143 -1.590929 -2.723358 -2.666604 0.366519 3.598592 1"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array([1, 0, 1, 3, 2, 1, 0, 1, 2, 0, 3, 2, 2, 2, 2, 0, 0, 3, 3, 2, 0, 3,\n",
" 3, 0, 0, 0, 2, 1, 1, 1, 1, 1, 3, 0, 3, 3, 0, 3, 3, 0, 1, 1, 1, 2,\n",
" 3, 0, 1, 0, 2, 2, 0, 0, 1, 2, 2, 3, 0, 2, 2, 2, 3, 3, 1, 0, 1, 3,\n",
" 3, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 0, 2, 1, 3, 3, 3, 0, 0, 3, 3,\n",
" 0, 0, 1, 1, 0, 2, 2, 0, 0, 2, 3, 3, 1, 0, 1, 2, 3, 1, 2, 3, 0, 2,\n",
" 1, 0, 0, 1, 3, 0, 3, 2, 0, 1, 1, 0, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2,\n",
" 2, 1, 1, 2, 1, 2, 2, 3, 0, 1, 3, 1])"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from sklearn import datasets\n",
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"\n",
"X, y = datasets.make_classification(\n",
" n_samples=144, \n",
" n_features=5,\n",
" n_informative=3, \n",
" n_classes=4,\n",
")\n",
"print(X)\n",
"df = pd.DataFrame(X) # type: ignore\n",
"df.columns = [\"X1\", \"X2\", \"X3\", \"X4\", \"X5\"]\n",
"df['y'] = y\n",
"\n",
"y_names = ['class' + str(i) for i in range(5)]\n",
"display(df.head())\n",
"display(df.tail())\n",
"\n",
"display(y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация данных с учетом понимания из особенностей"
]
},
{
"cell_type": "code",
"execution_count": 130,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABR4AAAPbCAYAAAA6qpd6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3hU1dbA4d8+U9IrHULvRXpHEQRBUIq99y6WK9d7FfVTsV/b1WuvWBGxIKAC0nvvvfce0tu0s78/BgIhM5NCkknCep8nD2TOnnNW2sw56+y9ltJaa4QQQgghhBBCCCGEEKIEGcEOQAghhBBCCCGEEEIIUflI4lEIIYQQQgghhBBCCF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TJSnJkcEbmyYC5JvdaaLZkX6E73bP4/6mwSkNsfdoMt9OX+lzm8fUHElO59vpK3jsyovKODIhhKj4PB4PP//8M5mZmfTo0cPnGIfDgcNx+gZUWlpaWYUnhBBCCBF0kngUQuTROKpmsZONZxtQqx0NIqrz095FLDq+FY82aRdXn+vr96RzlcbF26mtHbhW4T8BaaDsRVsWfi7+PLQqYK1KE82v+5Zyb5N+GKrsJ5lPWrwRi6HwmL5jNE3NbwvW8+jwCwPOUBVCCHHa+vXr6dGjBzk5OURGRjJhwgRatWrlc+xrr73G6NGjyzhCIYQQQojyQRKPQohS1Sy6Fv93wdUltj8VcTs6ZYW/rYAFwq4tseMVZE/GcQylAiYfU1xZpLtyiLGHl1lcpxw6kUZBPXzSsxzkON2EhdjKJighhKjgmjdvzpo1a0hNTeWXX37h9ttvZ+7cuT6Tj6N
"text/plain": [
"<Figure size 1600x1200 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from visual import draw_data_2d\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plt.figure(figsize=(16, 12))\n",
"draw_data_2d(df, 0, 1, y.tolist(), y_names, plt.subplot(3, 2, 1))\n",
"draw_data_2d(df, 2, 3, y.tolist(), y_names, plt.subplot(3, 2, 2))\n",
"draw_data_2d(df, 0, 2, y.tolist(), y_names, plt.subplot(3, 2, 3))\n",
"draw_data_2d(df, 1, 3, y.tolist(), y_names, plt.subplot(3, 2, 4))\n",
"draw_data_2d(df, 1, 2, y.tolist(), y_names, plt.subplot(3, 2, 5))\n",
"draw_data_2d(df, 0, 3, y.tolist(), y_names, plt.subplot(3, 2, 6))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация данных без понимания их особенностей"
]
},
{
"cell_type": "code",
"execution_count": 131,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABR4AAAPbCAYAAAA6qpd6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90b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XHCMpdYRkL5QzFm+RQmpS3KJCwUk6oDCHCz3BwAAAMwyvbpSyy45pUecXkGcDheQeIwILhTIhTqgMEF6uX/3+Y3p5f7LLjmFaxUAAAAQgOnVlZpWVcFGpHAdiccI4UKBbKgDiqDlW+6fUPty/2lVFVyzAAAAgAD0KkqwAg6uI/EYMVwokEm6Dmhj04GMiZ+E2mfHUgcUXmG5PwAAAADED5vLADFAwWAEjeX+AAAAABA/oUk81tTU6PTTT9fAgQM1dOhQXXTRRXr11VeDbhYQGuk6oBVlXZdTV5T1obYePMdyfwAAAABh0pZMqXbbXq2u26XabXvVlsy0fhD5hGap9VNPPaW5c+fq9NNP10cffaTvfe97Ouecc7R161b1798/6OYBoUAdUASF5f4AAAAAwmJNfUOPzXsr2bzXkUQqlQplyvadd97R0KFD9dRTT+mss86y9DvNzc0qKytTU1OTSktLPW4hAKCz9K7WkrokH9Npb2beAvkRy4Qf7yEAAGZL91u6J8vot3zMTjwTmqXW3TU1NUmSysuzz45pbW1Vc3Nzl38AgGCw3B8AAABhwlLb+GlLprTkka0ZV2mlv7fkka2cCzaEZql1Z8lkUldeeaUmTJig6urqrI+rqanRkiVLfGwZAL8d/CipX9S+oTf3faDjyvvpq+OHq/iw0I6pRB7L/QEAABAGLLWNp03b93V5z7t
"text/plain": [
"<Figure size 1600x1200 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(16, 12))\n",
"draw_data_2d(df, 0, 1, subplot=plt.subplot(3, 2, 1))\n",
"draw_data_2d(df, 2, 3, subplot=plt.subplot(3, 2, 2))\n",
"draw_data_2d(df, 0, 2, subplot=plt.subplot(3, 2, 3))\n",
"draw_data_2d(df, 1, 3, subplot=plt.subplot(3, 2, 4))\n",
"draw_data_2d(df, 1, 2, subplot=plt.subplot(3, 2, 5))\n",
"draw_data_2d(df, 0, 3, subplot=plt.subplot(3, 2, 6))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Иерархическая агломеративная кластеризация"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Также формируется дендрограмма"
]
},
{
"cell_type": "code",
"execution_count": 132,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiAAAAGhCAYAAABYjQ/8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAslElEQVR4nO3deXRUZZ7G8adISKUKSSQgJGhAEARBUVT2VU2z9DSiQguC49rttIOsjdjMIKjQjdqM0j2CyKi4NLSiRxadMSqMgMqiIGh7HBWQJQJBBJJAUtnf+YNOdSpVCantrSR8P+fcc5K7/d73bnly61aVwxhjBAAAYFGjWDcAAACcewggAADAOgIIAACwjgACAACsI4AAAADrCCAAAMA6AggAALCOAAIAAKyLj3UDqiovL9fhw4fVtGlTORyOWDcHAADUgjFGp06dUuvWrdWo0dnvb9S5AHL48GGlp6fHuhkAACAEWVlZuuiii846X50LIE2bNpV0pgNJSUkxbg0AAKiNvLw8paene/+On02dCyAVL7skJSURQAAAqGdq+/gED6ECAADrCCAAAMA6AggAALCOAAIAAKwjgAAAAOsIIAAAwDoCCAAAsI4AAgAArCOAAAAA6wggAADAOgIIAACwjgACAACsq3NfRodzizFGnpKyWDcDQJS4GsfV+svJcG4hgCBmjDEavWSLdhw4GeumAIiSa9s20xu/6UMIgR9egkHMeErKCB9AA7f9wEnuciIg7oCgTtg+K0PuhLhYNwNAhBQUl+naeeti3QzUYQQQ1AnuhDi5EzgcAeBcwUswAADAOgIIAACwjgACAACsI4AAAADrCCAAAMA6AggAALCOAAIAAKwjgAAAAOsIIAAAwDoCCAAAsI4AAgAArCOAAAAA6wggAADAOgIIAACwjgACAACsI4AAAADrCCAAAMA6AggAALCOAAIAAKwjgAAAAOsIIAAAwDoCCAAAsI4AAgAArCOAAAAA6wggAADAOgIIAAC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Sw+GwXjdYBBAAQINijNGBcePl2bnTeu3CuARpxB8kSbv79VdiWbH1Nriuvlptl/+lzocQAggAoEExHk9MwockJZYV693V02NSu4Ln889lPB453O6YtuNsCCAAgAar4ycfq5HLFetmWFHu8Wh3v/6xbkatEUAAAA1WI5dLjer4nYBzFe+CAQAA1hFAAACAdQQQAABgHQEEAABYRwABAADWEUAAAIB1BBAAAGAdAQQAAFhHAAEAANYRQAAAgHUEEAAAYB0BBAAAWEcAAQAA1hFAAACAdQQQAABgHQEEAABYRwABAADWEUAAAIB1BBAAAGAdAQQAAFhHAAEAANYRQAAAgHUEEAAAYB0BBAAAWEcAAQAA1hFAAACAdQQQAABgHQEEAABYRwABAADWEUAAAIB1QQeQTZs2acSIEWrdurUcDodWr17tM/2uu+6Sw+HwGYYNGxap9gIAgAYg6ACSn5+vK6+8UosWLap2nmHDhunIkSPe4a9//WtYjQQAAA1LfLALDB8+XMOHD69xHqfTqdTU1JAbBQAAGraoPAOyYcMGtWzZUp06ddL999+v48ePVztvUVGR8vLyfAYAANCwRTyADBs2TK+88orWr1+vJ554Qhs3btTw4cNVVlYWcP758+crOTnZO6Snp0e6SQAAoI4J+iWYsxk7dqz35yuuuELdunXTJZdcog0bNuiGG27wm3/mzJmaNm2a9/e8vDxCCAAADVzU34bbvn17tWjRQnv27Ak43el0KikpyWcAAAANW9QDyA8//KDjx48rLS0t2qUAAEA9EfRLMKdPn/a5m7Fv3z7t2rVLKSkpSklJ0aOPPqpRo0YpNTVVe/fu1YwZM9ShQwc
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils_clusters import get_linkage_matrix, run_agglomerative\n",
"from visual import draw_dendrogram\n",
"from scipy.cluster import hierarchy\n",
"\n",
"tree = run_agglomerative(df)\n",
"linkage_matrix = get_linkage_matrix(tree)\n",
"draw_dendrogram(linkage_matrix)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Получение результатов иерархической кластеризации"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Также производится сравнение с реальным разбиением\n",
"\n",
"https://joernhees.de/blog/2015/08/26/scipy-hierarchical-clustering-and-dendrogram-tutorial/"
]
},
{
"cell_type": "code",
"execution_count": 133,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([4, 4, 6, 7, 2, 7, 4, 4, 2, 3, 2, 5, 5, 1, 2, 1, 4, 6, 2, 2, 4, 5,\n",
" 2, 4, 3, 3, 1, 7, 4, 7, 7, 6, 7, 7, 6, 2, 4, 7, 5, 7, 7, 4, 7, 2,\n",
" 2, 4, 7, 3, 2, 5, 4, 4, 6, 2, 2, 2, 7, 2, 2, 5, 6, 6, 4, 3, 4, 2,\n",
" 2, 5, 2, 5, 7, 1, 2, 6, 1, 5, 7, 6, 4, 2, 3, 2, 7, 6, 3, 7, 6, 2,\n",
" 7, 4, 5, 6, 4, 2, 2, 4, 3, 5, 2, 7, 7, 3, 7, 2, 7, 7, 2, 2, 3, 1,\n",
" 7, 4, 3, 3, 7, 3, 5, 5, 3, 6, 7, 3, 3, 7, 1, 7, 3, 5, 7, 3, 4, 2,\n",
" 5, 7, 7, 1, 7, 2, 5, 2, 4, 7, 6, 6], dtype=int32)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array([1, 0, 1, 3, 2, 1, 0, 1, 2, 0, 3, 2, 2, 2, 2, 0, 0, 3, 3, 2, 0, 3,\n",
" 3, 0, 0, 0, 2, 1, 1, 1, 1, 1, 3, 0, 3, 3, 0, 3, 3, 0, 1, 1, 1, 2,\n",
" 3, 0, 1, 0, 2, 2, 0, 0, 1, 2, 2, 3, 0, 2, 2, 2, 3, 3, 1, 0, 1, 3,\n",
" 3, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 0, 2, 1, 3, 3, 3, 0, 0, 3, 3,\n",
" 0, 0, 1, 1, 0, 2, 2, 0, 0, 2, 3, 3, 1, 0, 1, 2, 3, 1, 2, 3, 0, 2,\n",
" 1, 0, 0, 1, 3, 0, 3, 2, 0, 1, 1, 0, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2,\n",
" 2, 1, 1, 2, 1, 2, 2, 3, 0, 1, 3, 1])"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABR4AAAd3CAYAAACgO2L8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3hUVfrA8e+5dya9ESCE3nvvRUEEEcHee6+rq+66rm1/u6u7q666ll0L9t6wITZARUEUBOm99xKSkN6m3Ht+fwwJhGQmk5DMpLyf5+EJmXvmzjspkzPvPed9ldZaI4QQQgghhBBCCCGEELXICHcAQgghhBBCCCGEEEKIxkcSj0IIIYQQQgghhBBCiFoniUchhBBCCCGEEEIIIUStk8SjEEIIIYQQQgghhBCi1kniUQghhBBCCCGEEEIIUesk8SiEEEIIIYQQQgghhKh1kngUQgghhBBCCCGEEELUOkk8CiGEEEIIIYQQQgghap0j3AGEkm3b7N+/n/j4eJRS4Q5HCCGEEKJatNbk5+fTpk0bDEOuHzdEMh8VQgghRENXnTlpk0o87t+/n/bt24c7DCGEEEKI47Jnzx7atWsX7jBEDch8VAghhBCNRTBz0iaVeIyPjwd8X5iEhIQwRyOEEEIIUT15eXm0b9++bE4jGh6ZjwohhBCioavOnLRJJR5Lt7MkJCTIRE8IIYQQDZZs0W24ZD4qhBBCiMYimDmpFAcSQgghhBBCCCGEEELUOkk8CiGEEEIIIYQQQgghap0kHoUQQgghhBBCCCGEELVOEo9CCCGEEEIIIYQQQohaJ4lHIYQQQgghhBBCCCFErZPEoxBCCCGEEEIIIYQQotZJ4lEIIYQQQgghhBBCCFHrJPEohBBCCCGEEEIIIYSodZJ4FEIIIYQQQgghhBBC1DpJP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FrjULzf6um0y2+NR1jW1T73F7bYn76epZkbsVC0y+xPZNbDyTaEVF7T6ABaBEZz529pnJHzym4bC+RhkOu2gshRCMhc1Ihasd9K99nf3E2APrwrLS0E/PctDV0jW/F9V0n1OjcW/IPMGv/SnLchaREJXJG2yG0i2leO4E3EIYyOKf9cM5pPxyP7UWhJJErhKhzDSbxeP/99zNlyhQ6dOhAfn4+77//PvPmzWPOnDnhDk2IBu+T3YsAKq36oo8a86feZ1Yywr9dBRncsfQNDpTklNU4/GLvUv63aRZPDL6Coc27HEfUDZNSiijTGe4whBBC1JDMSYWoG+tz97ImZ7ff4xr4cOdCruo8DqcR/NtYr23xz7WfMmv/yrL5qNaa17f9yBWdx3J7j9Oa5MXg6nwNhRDieDSYV5v09HSuuuoqDhw4QGJiIgMGDGDOnDlMmjQp3KEJ0eD9mrml7GpyZSxt82vmlmqds9Dr4ne/vUq2u7DsHEcf+8OyN3n/hDtpH9u0rjQLIYRo2GROKkTdWHpoe1m9QX9yPUXsKEinRzWa8j2z8Rtm718FUGG+++6OBTSLiOXKzuNqFrQQQogqNZjE42uvvRbuEIRotOwgSr0GM+Zos/avINOVX+kxjcarbabvWsjdfaq3ilIIIYQIJ5mTClE3dICE49GqMyfNcRfy2Z7FAc/91vb5XNxxDBGyAlAIIeqEEe4AhBDhNzS5S9nWk8qYymBocvW2Rf94cB2BNq1Y2mZu2ppqnfNYbtvLroIM9hVl0YD7ZAkhhBBCNHkDkjoEXO0IEGtG0ikuJehzLsrcjDfArh6APE8xawNs8a6K1hpt7Ud7t6F1cY3PI4QQjZVc1hFCcGHHUczc+5vf47bWXNBhVLXOWex1V3nd2mV7q3XOUiWWm1e3/sBne5ZQ4C0BoF1MMtd0Gc+ZbYc2yTo9QgghhBAN2aBmnegW14odhRmVlgAyUJzXYWS1amWXWJ5aHXcsXTIHXfA
"text/plain": [
"<Figure size 1600x2400 with 8 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"result = hierarchy.fcluster(linkage_matrix, 10, criterion=\"distance\")\n",
"display(result)\n",
"display(y)\n",
"# result = [0 if val == 1 else 1 if val == 3 else 2 for val in result]\n",
"\n",
"plt.figure(figsize=(16, 24))\n",
"draw_data_2d(df, 0, 1, result, y_names, plt.subplot(4, 2, 1))\n",
"draw_data_2d(df, 0, 1, y.tolist(), y_names, plt.subplot(4, 2, 2))\n",
"draw_data_2d(df, 2, 3, result, y_names, plt.subplot(4, 2, 3))\n",
"draw_data_2d(df, 2, 3, y.tolist(), y_names, plt.subplot(4, 2, 4))\n",
"draw_data_2d(df, 0, 2, result, y_names, plt.subplot(4, 2, 5))\n",
"draw_data_2d(df, 0, 2, y.tolist(), y_names, plt.subplot(4, 2, 6))\n",
"draw_data_2d(df, 1, 3, result, y_names, plt.subplot(4, 2, 7))\n",
"draw_data_2d(df, 1, 3, y.tolist(), y_names, plt.subplot(4, 2, 8))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Неиерархическая четка кластеризация (k-means)"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cluster 1 (57):\n",
"1, 4, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 26, 34, 35, 36, 43, 44, 48, 53, 54, 57, 58, 60, 61, 65, 66, 68, 71, 72, 73, 74, 77, 81, 83, 86, 87, 92, 93, 94, 95, 98, 103, 106, 107, 109, 124, 130, 131, 135, 137, 139, 140, 142\n",
"\n",
"--------\n",
"Cluster 2 (87):\n",
"0, 2, 3, 5, 6, 9, 11, 12, 21, 22, 25, 27, 28, 29, 30, 31, 32, 33, 37, 38, 39, 40, 41, 42, 45, 46, 47, 49, 50, 51, 52, 55, 56, 59, 62, 63, 64, 67, 69, 70, 75, 76, 78, 79, 80, 82, 84, 85, 88, 89, 90, 91, 96, 97, 99, 100, 101, 102, 104, 105, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 132, 133, 134, 136, 138, 141, 143\n",
"\n",
"--------\n"
]
},
{
"data": {
"text/plain": [
"array([[ 1.05781172, -1.10417484, -0.35961761, -1.37530793, -0.57595436,\n",
" 1.96491228],\n",
" [-0.69486012, 0.55944142, 0.10909332, 0.84899378, 0.50377892,\n",
" 1.17241379]])"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array([1, 0, 1, 3, 2, 1, 0, 1, 2, 0, 3, 2, 2, 2, 2, 0, 0, 3, 3, 2, 0, 3,\n",
" 3, 0, 0, 0, 2, 1, 1, 1, 1, 1, 3, 0, 3, 3, 0, 3, 3, 0, 1, 1, 1, 2,\n",
" 3, 0, 1, 0, 2, 2, 0, 0, 1, 2, 2, 3, 0, 2, 2, 2, 3, 3, 1, 0, 1, 3,\n",
" 3, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 0, 2, 1, 3, 3, 3, 0, 0, 3, 3,\n",
" 0, 0, 1, 1, 0, 2, 2, 0, 0, 2, 3, 3, 1, 0, 1, 2, 3, 1, 2, 3, 0, 2,\n",
" 1, 0, 0, 1, 3, 0, 3, 2, 0, 1, 1, 0, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2,\n",
" 2, 1, 1, 2, 1, 2, 2, 3, 0, 1, 3, 1])"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils_clusters import print_cluster_result, run_kmeans\n",
"\n",
"random_state = 9\n",
"\n",
"labels, centers = run_kmeans(df, 2, random_state)\n",
"print_cluster_result(df, 2, labels)\n",
"display(centers)\n",
"display(y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация результатов кластеризации"
]
},
{
"cell_type": "code",
"execution_count": 135,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQsAAAPHCAYAAACPOR82AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaH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1bFJenihhjRDjHVat197P/EElIQGJ15KvcAHBgqlEy/wjk3ejAsAAAAAAJgnEbcSjgYHCqUTt7Uts44DikSw0Cu8wAEAAAAAgB1vvjA04ShNUorts44DikSw0Cu8wAEAAAAAgB1HDzh7HJABwUKv8AIHAAAAAAB2jBzr7HFABgQLvcILHAAAAAAA2DF5ttUUVZEsB0Sk6HjrOKBIBAu9wgschUrEpT3PSbs3WJ+pYwkAAAAA4VRRKbWs7vticDyh7+uWVdZxQJEIFnqFFzgK0bFJWtMs3fdZ6ZEvWZ/XNNMpGwAAAADCqmmedO39UrQx/fboOOv2pnnejAuBUeX1AEIt9QJvuzW92Ul0nBUo5AUebh2bpIcXakjH7FindTtvAgAAAAAQTk3zpLOvspqiHj1glTCbPJuEIziCYKHXeIEjk0TcCiIPDhRKfbdFpLZl1rnDuQIAAAAA4VNRKU35pNejQAARLDQBL3AM9uYL6dmmQySl2D7rOM4dlEMizqIGAAAAAIQAwULAREcPOHscUIqOTVnKJaxmKzwAAAAABAwNTgATjRzr7HFAsVK1MwdnuqZqZ9JsBwAAAAAChWAhYKLJs63MrSGdslMiUnS8dRzglry1M2XVzkzEyzkqAAAAAICLCBYCJqqotLZ4ShoaMOz7umUVNePgLju1MwEAAAAAgUCwEDBV0zzp2vulaGP
"text/plain": [
"<Figure size 1600x1200 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from visual import draw_cluster_results\n",
"\n",
"plt.figure(figsize=(16, 12))\n",
"draw_cluster_results(df, 0, 1, labels, centers, plt.subplot(2, 2, 1))\n",
"draw_cluster_results(df, 2, 3, labels, centers, plt.subplot(2, 2, 2))\n",
"draw_cluster_results(df, 0, 2, labels, centers, plt.subplot(2, 2, 3))\n",
"draw_cluster_results(df, 1, 3, labels, centers, plt.subplot(2, 2, 4))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Разбиение на 4 кластера и сравнение с реальным разбиением"
]
},
{
"cell_type": "code",
"execution_count": 136,
"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AclhOFkkKuEKLa1ZrC4xNPPMHkyZOJj48nKyuLL7/8ksWLFzN//nx/hyZErfftko0A5XZ90SXGPHLVmEqd92BiKve9Pp3jqZnYDFdL2R9XbOXVaUt55e6L6d+x/vW5UkoRHFhrfvUKIYQ4g+SkQlSP7RlH2ZJ+2O1xDXx9cAU3thlJgOF9LuW0TJ7Z+gNzEzZiU658VGvNh/t+5YY2I3ig46R6eTO4Mp9DIYQ4F7Xmt01SUhI33ngjx48fJyoqip49ezJ//nzGjx/v79CEqPVWbD9UqvfgmUxLs2L7oUqdMye/kDtf+560rNxT57CKj+XmO3jgjel889cbiY+LPquYhRBCCH+QnFSI6rH25P7ifoPuZDhyOZCdRMdI73dffm3nHOYlbAJOz54s8vmB34gJDOMPbUaeXdBCCCEqVGsKjx988IG/QxCizrI8FB0rM6akOat3kJKRU/65tMZpWnz96wYevbpysyiFEEIIf5KcVIjqoT0UHEuyKrFFQXphDtOOrPZ47k/2L+HqVkMJlBmAQghRLQx/ByCE8L/+nVpgM9wvMbEZiv6dWlTqnIs27sXTohXT0ixYv7tS5zxTocPJwcRUjqVkUIv3yRJCCCGEqPd6Rsd7nO0IEGYLonV4nNfnXJmyG+cZsxzPlOnIY6uHJd4V0VqjzQS0cx9a5531eYQQoq6S2zpCCK4e1Zsfl211e9zSmqtH9a7UOXMLCiu8b13gcFbqnEXyCh28N3sV3/+2hew8VzP/lo2iuWXSAC4Z0q1e9ukRQgghhKjNese0pn14Yw7kJJdZEg1goLgsfhD
"text/plain": [
"<Figure size 1600x2400 with 8 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"labels, centers = run_kmeans(df, 4, random_state)\n",
"\n",
"plt.figure(figsize=(16, 24))\n",
"draw_data_2d(df, 0, 1, labels.tolist(), y_names, plt.subplot(4, 2, 1))\n",
"draw_data_2d(df, 0, 1, y.tolist(), y_names, plt.subplot(4, 2, 2))\n",
"draw_data_2d(df, 2, 3, labels.tolist(), y_names, plt.subplot(4, 2, 3))\n",
"draw_data_2d(df, 2, 3, y.tolist(), y_names, plt.subplot(4, 2, 4))\n",
"draw_data_2d(df, 0, 2, labels.tolist(), y_names, plt.subplot(4, 2, 5))\n",
"draw_data_2d(df, 0, 2, y.tolist(), y_names, plt.subplot(4, 2, 6))\n",
"draw_data_2d(df, 1, 3, labels.tolist(), y_names, plt.subplot(4, 2, 7))\n",
"draw_data_2d(df, 1, 3, y.tolist(), y_names, plt.subplot(4, 2, 8))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Понижение размерности до n=2"
]
},
{
"cell_type": "code",
"execution_count": 137,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 1.32593942e+00, -2.18749592e+00],\n",
" [-1.97826650e+00, -1.10701677e+00],\n",
" [ 2.71639984e-01, 2.31820884e+00],\n",
" [ 1.25744596e+00, 2.81369781e+00],\n",
" [-3.22217535e+00, -1.60031442e-01],\n",
" [ 2.40214727e+00, 2.46806378e-01],\n",
" [-3.69674519e-01, -1.65368049e+00],\n",
" [-1.32384707e+00, -9.90035169e-01],\n",
" [-2.37151218e+00, 7.58074265e-02],\n",
" [ 1.81753342e-01, -2.21238708e+00],\n",
" [-1.99480240e+00, 1.54103339e-01],\n",
" [ 2.35227119e+00, -1.44073541e+00],\n",
" [ 1.99596367e-01, -8.24024797e-01],\n",
" [-4.57633500e+00, 1.59002642e+00],\n",
" [-2.32120217e+00, 4.17385129e-01],\n",
" [-4.41726824e+00, -6.68615754e-01],\n",
" [-2.32198366e+00, -7.31514607e-01],\n",
" [-4.29087530e-01, 3.15934054e+00],\n",
" [-7.79068193e-01, 1.97363655e+00],\n",
" [-3.50689785e+00, -6.38732621e-02],\n",
" [-1.39728127e+00, -1.01048460e+00],\n",
" [ 1.88621795e+00, -1.53988950e+00],\n",
" [ 2.22856117e-01, 1.94858265e+00],\n",
" [-3.25080635e+00, -1.87463074e+00],\n",
" [-1.42709881e+00, -2.33401710e+00],\n",
" [ 7.09268385e-01, -1.33053092e+00],\n",
" [-5.44332864e+00, 1.85279709e+00],\n",
" [ 1.50112132e+00, 9.72993095e-01],\n",
" [ 2.19271277e-01, -5.95430684e-01],\n",
" [ 1.76586839e+00, -9.33884019e-01],\n",
" [ 2.53699446e+00, 2.71779314e-01],\n",
" [ 1.51540328e+00, 2.30545107e+00],\n",
" [ 2.50055734e+00, 3.42649564e+00],\n",
" [ 2.25340896e+00, -1.14859403e+00],\n",
" [-5.60663777e-01, 3.09384448e+00],\n",
" [-5.27198952e-01, 1.60023774e+00],\n",
" [-1.56629594e+00, -1.37784438e+00],\n",
" [ 1.75483269e+00, 1.99194756e+00],\n",
" [ 2.19429274e+00, 2.79893301e-01],\n",
" [ 2.53312842e+00, -3.55236486e-01],\n",
" [ 3.69138767e-01, 1.11500796e+00],\n",
" [-5.17740459e-01, -7.79793582e-01],\n",
" [ 1.32307501e+00, 1.18518882e+00],\n",
" [-2.98696830e+00, -1.12012356e+00],\n",
" [-1.32192214e+00, 1.48328012e+00],\n",
" [ 8.80981444e-01, -2.56560118e+00],\n",
" [ 2.23577569e+00, 1.35602887e+00],\n",
" [ 1.39055086e+00, -2.77422805e+00],\n",
" [-2.21479277e+00, 6.22261556e-01],\n",
" [-1.64262467e-01, -1.89675831e+00],\n",
" [-7.52957875e-02, -2.15523014e+00],\n",
" [ 5.09791723e-01, -7.48741253e-01],\n",
" [ 1.82319793e+00, 3.25677676e+00],\n",
" [-2.40004461e+00, 5.62354370e-02],\n",
" [-2.06653462e+00, -1.06587490e-01],\n",
" [ 2.23134983e-01, 1.51894414e+00],\n",
" [ 8.35958260e-02, 1.70207914e+00],\n",
" [-3.26340013e+00, -7.15754258e-01],\n",
" [-2.58496993e+00, 2.90260937e-01],\n",
" [ 1.66323595e+00, -1.67426284e+00],\n",
" [-5.52632938e-01, 2.71809702e+00],\n",
" [-5.28838999e-01, 3.98232108e+00],\n",
" [ 7.96501888e-01, -1.26050462e+00],\n",
" [ 1.22850749e+00, -2.58652708e+00],\n",
" [ 1.27301782e-01, -2.30138121e-01],\n",
" [-1.67496052e+00, 3.11188314e+00],\n",
" [-9.20672211e-01, 1.72153704e+00],\n",
" [ 1.14322455e+00, 1.19199664e+00],\n",
" [-2.14072759e+00, -2.60008050e-01],\n",
" [ 1.64932337e+00, 1.21249551e+00],\n",
" [ 3.23848407e+00, 2.67277957e+00],\n",
" [-4.23543458e+00, 7.15700353e-03],\n",
" [-1.87840480e+00, -6.50297891e-01],\n",
" [-1.36190448e+00, 1.88552701e+00],\n",
" [-5.29221524e+00, 2.30948117e+00],\n",
" [ 2.68774500e+00, -1.59545623e+00],\n",
" [ 1.88346626e+00, 6.36714570e-01],\n",
" [-1.12740736e+00, 2.49466713e+00],\n",
" [ 4.63048602e-01, -2.23789570e+00],\n",
" [-2.84107113e-01, -1.54896111e-01],\n",
" [ 4.05813974e-01, -1.36229837e+00],\n",
" [-1.54763720e+00, 7.17429763e-01],\n",
" [ 3.40877222e+00, 8.83768163e-01],\n",
" [-3.20095470e-01, 3.10637348e+00],\n",
" [ 1.19926669e+00, -2.07549088e+00],\n",
" [ 2.56474512e+00, -1.58998023e+00],\n",
" [-1.66730583e-01, 2.91564356e+00],\n",
" [-4.94736393e-01, 1.06623807e+00],\n",
" [ 2.99558541e+00, -1.62576887e+00],\n",
" [ 1.41640869e+00, -2.12021519e+00],\n",
" [ 2.99625518e+00, -1.90580317e+00],\n",
" [ 8.64102148e-01, 1.83828088e+00],\n",
" [-1.95994093e+00, -1.78882831e+00],\n",
" [-8.06960737e-01, 5.09330916e-01],\n",
" [-8.49760003e-01, 6.56589855e-01],\n",
" [-1.14152403e+00, -2.12534375e+00],\n",
" [ 7.03879551e-02, -2.65638914e+00],\n",
" [ 3.38848855e+00, -1.18011529e+00],\n",
" [-7.86036044e-01, 1.25343042e+00],\n",
" [ 5.23936833e+00, 1.53688725e-01],\n",
" [ 2.10066904e+00, 7.39620232e-01],\n",
" [ 4.08674973e-01, -2.64432373e+00],\n",
" [ 2.97660341e+00, 9.18001854e-01],\n",
" [-1.05396335e+00, -7.58011870e-01],\n",
" [ 9.27898191e-01, 2.73195679e+00],\n",
" [ 1.88170910e+00, 3.09803354e-01],\n",
" [-4.15836121e+00, -1.10080396e+00],\n",
" [-1.32218416e+00, 9.68951593e-01],\n",
" [ 3.58888407e-02, -2.06965739e+00],\n",
" [-3.72549122e+00, -2.55973339e-01],\n",
" [ 2.22694149e+00, 4.99182288e-01],\n",
" [-6.97951691e-01, -2.24857318e+00],\n",
" [-2.84762293e-01, -2.76820542e+00],\n",
" [-9.70900037e-02, -2.14032524e+00],\n",
" [ 1.86466006e+00, 2.44533611e+00],\n",
" [-9.40249095e-01, -3.43079482e+00],\n",
" [ 2.52489015e-01, 9.54766411e-02],\n",
" [ 1.26547237e+00, -1.24281113e+00],\n",
" [-1.70132052e-01, -3.06620379e+00],\n",
" [ 1.98027096e+00, 2.27183117e+00],\n",
" [ 3.15917813e+00, 2.19249127e-01],\n",
" [ 5.34696684e-01, -2.36280599e+00],\n",
" [ 1.91018239e-01, -2.04817767e+00],\n",
" [ 1.16551796e+00, 7.40410345e-01],\n",
" [-4.81789328e+00, 4.21301137e-01],\n",
" [ 1.67713941e+00, -1.10244667e+00],\n",
" [ 1.51632690e+00, -1.39562399e+00],\n",
" [ 1.85415809e+00, -2.02593818e+00],\n",
" [ 2.31951123e+00, -8.71471407e-02],\n",
" [ 1.05068741e+00, -1.07471134e+00],\n",
" [-9.19418638e-01, -5.91973296e-02],\n",
" [-5.10508391e+00, -4.79067414e-01],\n",
" [ 5.73359235e-01, -1.18790144e+00],\n",
" [ 4.01530110e+00, 8.97874118e-01],\n",
" [ 2.12070426e+00, -2.80541551e-01],\n",
" [-4.24576720e+00, -1.69481555e-04],\n",
" [ 3.20006458e+00, 2.18975297e+00],\n",
" [-3.05754194e+00, -4.03559153e-02],\n",
" [ 1.52629544e+00, -8.41106533e-01],\n",
" [-6.37066079e-01, 1.19336895e+00],\n",
" [-1.42342604e+00, -1.95148797e+00],\n",
" [ 3.20407657e+00, 2.83195472e-01],\n",
" [-9.78711507e-01, 2.42328725e+00],\n",
" [ 1.20394346e+00, 3.67222510e+00]])"
]
},
"execution_count": 137,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.decomposition import PCA\n",
"\n",
"\n",
"reduced_data = PCA(n_components=2).fit_transform(df)\n",
"reduced_data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация данных после понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 138,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABR0AAAINCAYAAACzjdj/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeXzU1fX/8df9TPZtCGvCIiCuARFQUdw3FBfcqrVWrNalLVVra/ur2tZSaltrF792sda61FbaWnfFBeuKG4iKCAiiIIpAWAPZ1/nc3x/DICEzySSZmc8s7+fjQW1mbmZOJpnJzZl7zjHWWouIiIiIiIiIiIhIjDheByAiIiIiIiIiIiLpRUlHERERERERERERiSklHUVERERERERERCSmlHQUERERERERERGRmFLSUURERERERERERGJKSUcRERERERERERGJKSUdRUREREREREREJKaUdBQREREREREREZGYyvI6gERyXZf169dTXFyMMcbrcERERES6xVpLbW0tgwcPxnH03nEq0n5UREREUl20e9KMSjquX7+eYcOGeR2GiIiISK98/vnnDB061OswpAe0HxUREZF00dWeNKOSjsXFxUDwQSkpKfE4GhEREZHuqampYdiwYTv3NJJ6tB8VERGRVBftnjSjko6hEpaSkhJt8kRERCRlqSw3dWk/KiIiIumiqz2pmgGJiIiIiIiIiIhITCnpKCIiIiIiIiIiIjGlpKOIiIiIiIiIiIjElJKOIiIiIiIiIiIiElNKOoqIiIiIiIiIiEhMKekoIiIiIiIiIiIiMaWko4iIiIiIiIiIiMSUko4iIiIiIiI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ml1TrhKBIf2sukPn0PRUTio6GphS01DfgL8/AXqq+4SDxFu5/JSmBMIiKShnyOYdKofl6HISIiIiIZrCAvhz3ycrwOQ0R2ofJqERERERERERERiSklHUVERERERERERCSmVF4tIiLSA+plKSIiIiJesm4VND6GbV0BJg+TdwLkHIUxOl8myUFJRxERkW6as7SSmbOXUVndtPOycn8eM6ZWaGq3iIiIiMSdbXwSW30D0EawiNVgGx+ArH2g9F6Mb6DHEYqovFpERKRb5iytZPqshe0SjgAbqpuYPmshc5ZWehSZiIiIiGQC2/I2tvr/Aa2ABQIEk49A2yrstsuw1vUuQJEdlHQUERGJUsC1zJy9DBvmutBlM2cvI+CGWyEiIiIi0nu27q9ETucEoG0FtLyWyJBEwlLSUUREJEoLVld1OOG4KwtUVjexYHVV4oISERERkYxhbQu0vE7wdGMkWdimFxMVkkhESjqKiIhEaVNt5IRjT9aJiIiIiHSLbYGwdTftFoHVflS8p6SjiIhIlAYW58V0nYiIiIhIt5hCcMq6WORisvdNSDginVHSUUREJEoTR/al3J+HiXC9ITjFeuLIvokMS0REREQyhDEGUzANIu5IAbIg/+xEhSQSkZKOIiIiUfI5hhlTK4CO27zQxzOmVuBzOtsEioiIiIj0QuHFkH0wHXekPsBg/L/COHoTXLynpKOIiEg3TBlTzh3TJlDmb19CXebP445pE5gyptyjyEREREQk0ay1tAY6G+oSe8bkYvreiyn6/i6l1gZyDsf0vR+Tf2ZC4xGJJMvrAERERHoi4FoWrK5iU20TA4uDJc2JOmE4ZUw5kyvKPLt/EREREfHWynVbuO9/7/DCwo9oaQswqLSI848Zx/nHjSM/Jzvu929MLhR9AwqvAFsPJjt4mUgSUdJRRERSzpyllcycvYzK6i+m8pX785gxtSJhJw19jmHSqH4JuS8RERERSR4LPlzD1bc/juu6BNzgJOmN2+r48xNv8OKij/nbd88jPzf+iUcI9njEFCXkvkS6S+XVIiKSUuY
"text/plain": [
"<Figure size 1600x600 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(16, 6))\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" subplot=plt.subplot(1, 2, 1),\n",
")\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" y.tolist(),\n",
" y_names,\n",
" plt.subplot(1, 2, 2),\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация результатов неиерархической кластеризации для двух кластеров с учетом понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 139,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGwCAYAAAA0bWYRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABFqklEQVR4nO3deVxU5eIG8GdA2VcVBEVBcQW3olyuIioooogpiNp1AdeumFY3u926pZZWpJmlltsvu6nZVXDB3DHc0yy3XCrEJZeuu6CgIvD+/uDOiWFmYAaHmTNznu/n46c4c2bmPbOd57yrSgghQERERIplZ+kCEBERkWUxDBARESkcwwAREZHCMQwQEREpHMMAERGRwjEMEBERKRzDABERkcIxDBARESkcwwAREZHCMQyQzblw4QJUKhW+/PJLSxelSpKSkhAUFGSx5y8pKUGrVq0wc+ZMi5VBDnbt2gWVSoVdu3ZZuih6BQUFISkpqUr3tfT3pGPHjnjttdcs8tykjWHAwr788kuoVCr8+OOPGttzc3PRvn17ODk5YevWrRYqHely+vRpTJs2DRcuXLB0UarFqlWrcOnSJUycOFHapv6cqv85OTmhWbNmmDhxIq5du6b1GNeuXcOrr76KFi1awMXFBa6urggLC8OMGTNw9+5dnc/bvn17qFQqfP7559V1aGQiBw4cwLRp0/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q0Neo5bt25pPEd5UVFR8PHxQYMGDTBkyBC4ublh3bp1Us1DXl4e3N3
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils_clusters import fit_kmeans\n",
"from visual import draw_clusters\n",
"\n",
"\n",
"kmeans = fit_kmeans(reduced_data, 2, random_state)\n",
"draw_clusters(reduced_data, kmeans)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация результатов неиерархической кластеризации для четырех кластеров с учетом понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 140,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGwCAYAAAA0bWYRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABNpUlEQVR4nO3deVxU5f4H8A+g7LuC4IriCqIWZXoV0UQR1xQ07Lpr0lXT6pfelntLS3Mr27TUvFmZ2VXQpKuYUuaaXctdWxDXtNxQUFAReH5/cOfEMDMwM8zMOWfO5/16+SrOnJl5ZoHzOd9nOS5CCAEiIiLSLFe5G0BERETyYhggIiLSOIYBIiIijWMYICIi0jiGASIiIo1jGCAiItI4hgEiIiKNYxggIiLSOIYBIiIijWMYIKdz5swZuLi44KOPPpK7KVYZM2YMIiIiZHv+srIytG3bFnPmzJGtDUrw7bffwsXFBd9++63cTTEpIiICY8aMseq+cv+edOrUCTNmzJDluckQw4DMPvroI7i4uOCHH37Q256fn4+OHTvC09MTW7Zskal1ZMyJEycwc+ZMnDlzRu6m2MWaNWtw/vx5TJkyRdqm+57q/nl6eqJly5aYMmUKLl26ZPAYly5dwrPPPovWrVvD29sbPj4+iI2NxezZs3Hjxg2jz9uxY0e4uLjg/ffft9dLIxvZu3cvZs6cafKzNMff//53LFmyBH/88YftGkZWYxhQoIK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plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"kmeans = fit_kmeans(reduced_data, 4, random_state)\n",
"draw_clusters(reduced_data, kmeans)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Сравнение результатов кластеризации с реальным разбиением с учетом понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 141,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABR0AAAPbCAYAAADRnSx5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdZ3wc1dnG4f+ZWWnVm3s3uGHjgjEGTK+m9xoIvYQSUkmBhDdAQkglkFBCaKH37tCr6Rg3bFzBvcq2el3tznk/rCxbtnYl2Vu00n3lp4BmjmZuWVh79plTjLXWIiIiIiIiIiIiIhIjTrIDiIiIiIiIiIiISOeioqOIiIiIiIiIiIjElIqOIiIiIiIiIiIiElMqOoqIiIiIiIiIiEhMqegoIiIiIiIiIiIiMaWio4iIiIiIiIiIiMSUio4iIiIiIiIiIiISUyo6ioiIiIiIiIiISEz5kh0gkTzPY82aNeTm5mKMSXYcERERkXax1lJZWUnfvn1xHD07TkXqj4qIiEiqa2uftEsVHdesWcOAAQOSHUNERERkp6xcuZL+/fsnO4bsAPVHRUREpLNorU/apYqOubm5QPgPJS8vL8lpRERERNqnoqKCAQMGNPVpJPWoPyoiIiKprq190i5VdNw8hSUvL0+dPBEREUlZmpabutQfFRERkc6itT6pFgMSERERERERERGRmFLRUURERERERERERGJKRUcRERERERERERGJKRUdRUREREREREREJKZUdBQREREREREREZGYUtFRREREREREREREYkpFRxEREREREREREYkpFR1FREREREREREQkplR0FBERERERERERkZhS0VFERERERERERERiSkVHEemyrA1ibSDZMURERESki7LWEvTqsdYmO4qIS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IiIiIdAW2YT627FoILd7qqIvNPAuTdz3GpCctm8hmml4tIiLSDs8s/4y/L5jSrOAIUBqo5teznuDj4gVJSiYiIiIiXYENLseWnAuhJducCUHtk9jyXyUll8i2VHQUERFpo9pggLsXvxW1zR0LXw9PdRERERERiQNbdS/YWiDU0lmo+x+2YV6iY4lsR0VHERGRNvp4wwJqtxnhuDULLK/ewOLKtYkLJSIiIiJdhrVBqHuFlguOm7nY2pcTFUkkIhUdRURE2qg0UI1pQ7uSQHXcs4iIiIhIF2RrgcgPwZt4m+IeRaQ1KjqKiIi0Ua+MfNoycbpXRn7cs4iIiIhIF2Sywh+tcfvEP4tIK1R0FBERaaP9egwnPy1yJ8/BMDKvH7vk9ExgKhERERHpKoxxIfMMwI3SKoTJPDVRkUQiUtFRRESkjdIcH78YdUKL5xwMrnH4+ciWz4uIiIiIxILJvhycbkQsPGZdhPHtktBMIi3xJTuAiIhIe1U21PLa6pnMKVuBYxz27jaEI/qMJcNNi/u9J/cZR5rj458LXmd1bUnT8WG5ffjFqBMYWzgw7hlEREREJLms9VhRPZ3FlVMJeDUUpvdn9/xjyEvvHfd7G7cHdHsGW34jBD6EzQsAmXxM9mWQfVncM4i0hbHWtmV5qk6hoqKC/Px8ysvLycvLS3YcERHZAV9sXMwvZz5OXSiAadzWxcNSmJ7Nv/a6iOF5fROSw1rL/IrVlAaq6Z2Rz5Dc+HcwRdSXSX36GYqIpL7aUDkvr/wN6+sWYHCxeBgMFssBPS5lQrezEpbFhtZA8FswGZC2B8akJ+ze0nW1tT+jkY4iIpIyVlRv5GczHiHoeVjAbrWtS3lDDVdNe4DnD/w5+eltWFx7JxljGJXfP+73EREREZGOw1rLlFU3Uly3KPw5ocZ/hvulH2+4j9y0ngzPOzQheYzbF9zEPHQXaS+t6SgiIinj6eWf4lnbrNi4mWctlQ21TFk9Iwn
"text/plain": [
"<Figure size 1600x1200 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"labels = [2 if val == 1 else 1 if val == 2 else val for val in kmeans.labels_]\n",
"\n",
"plt.figure(figsize=(16, 12))\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" labels,\n",
" y_names,\n",
" plt.subplot(2, 2, 1),\n",
")\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" result,\n",
" y_names,\n",
" plt.subplot(2, 2, 2),\n",
")\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" y.tolist(),\n",
" y_names,\n",
" plt.subplot(2, 2, 3),\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Выбор количества кластеров на основе инерции\n",
"\n",
"Инерция -- сумма квадратов расстояний выборок до ближайшего центра кластера, взвешенная по весам выборок, если таковые имеются."
]
},
{
"cell_type": "code",
"execution_count": 142,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"range(2, 13)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"[1095.0175884953487,\n",
" 840.435967632246,\n",
" 690.9568840077667,\n",
" 569.8045875559183,\n",
" 489.9561312217587,\n",
" 420.18478011974236,\n",
" 399.30137712803855,\n",
" 343.2316060605482,\n",
" 312.7806842989379,\n",
" 284.2906232030758,\n",
" 268.29293041255244]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArwAAAHUCAYAAADY9fvpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABMJklEQVR4nO3dd3hUVf7H8c8kgRBCCqCkkFAUlCJKUwSMgKCgogIiolR1cWVBAcGluICrdEUBFVh0FRSx0RZQVKSLdERQqdJLQCkJNYbk/v44vwwMmUBCMrkzk/freebJzb1nZr5DFD+enPs9DsuyLAEAAAB+KsDuAgAAAABPIvACAADArxF4AQAA4NcIvAAAAPBrBF4AAAD4NQIvAAAA/BqBFwAAAH6NwAsAAAC/RuAFAACAXyPwAvA7S5YskcPh0PTp0+0uxalhw4Zq2LCh83tvrDG3Lv+MAOAtCLwAfILD4cjWY8mSJflW0549e65Yy4gRI/KtlrzWuXNnl89SrFgx3XDDDWrdurVmzJih9PR0u0sEgGwLsrsAAMiOjz/+2OX7jz76SAsWLMh0vnLlytqyZUt+lqYnnnhCDzzwQKbzNWrUyNc68lpwcLDef/99SdK5c+e0d+9ezZ07V61bt1bDhg31v//9T+Hh4c7x3333nV2lAsAVEXgB+IT27du7fL9q1SotWLAg03lJ+R54a9as6bYOXxcUFJTpcw0ZMkQjRoxQ//791aVLF33++efOa4ULF87vEiVJZ86cUWhoqC3vDcA3sKQBgN9KT0/X0KFDFRcXpyJFiqhx48bauXNnpnGrV69Ws2bNFBERoaJFi6pBgwZasWJFvtSYlpamAQMGKDo6WqGhoXr44Ye1f//+TOO+/PJL1apVSyEhIbruuuvUvn17HTx40Hl9zpw5cjgc2rRpk/PcjBkz5HA41KpVK5fXqly5sh5//PFrrrlfv36677779OWXX2r79u3O85ev4f3rr780aNAg1apVSxEREQoNDVVCQoIWL16c6TWPHTumDh06KDw8XJGRkerUqZN+/vlnORwOTZ482Tmuc+fOKlasmH7//Xc98MADCgsLU7t27SRJy5cv12OPPaYyZcooODhY8fHx6tWrl86dO+fyXhmvsW/fPjVv3lzFihVT6dKl9e6770qSNm/erHvuuUehoaEqW7aspk2bds1/VgC8A4EXgN8aMWKEZs2apT59+qh///5atWqVMxxlWLRoke6++24lJydr8ODBGjZsmE6ePKl77rlHa9asydb7nD17Vn/++Wemx4ULF6763KFDh+qrr75S37599cILL2jBggVq0qSJS0ibPHmy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NPPaUGDRroiSee0JEjRzR27FiVK1dOvXr1cnm9hIQEffLJJ3I4HM4lDoGBgapXr56+/fZbNWzYMNsbRFy4cMH5uc6fP6+9e/dqzpw52rRpkxo1aqRJkyZd8fnNmzfXzJkz1bJlSz344IPavXu3Jk6cqCpVqrj8D0aLFi10xx13qHfv3tq5c6cqVaqkOXPm6Pjx45KUaU2tO5UqVdKNN96oPn366ODBgwoPD9eMGTNYewtAEoEXQAHXsGFDrVy5Uq+99preeecdnT59WtHR0apTp47+/ve/Z+s1Pv30U3366aeZznfq1OmqgXfAgAHatGmThg8frlOnTqlx48YaP368y6/2O3furKJFi2rEiBHq27evQkND1bJlS40cOVKRkZEur5cxq1upUiWVLFnS5fy3337rvJ4dKSkp6tChgySpaNGiKlWqlGrVqqVBgwapZcuWV73xrXPnzkpMTNR//vMfffvtt6pSpYqmTp2qL7/8UkuWLHGOCwwM1FdffaUePXpoypQpCgg
"text/plain": [
"<Figure size 800x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils_clusters import get_clusters_inertia\n",
"from visual import draw_elbow_diagram\n",
"\n",
"\n",
"inertias, clusters_range = get_clusters_inertia(df, random_state)\n",
"display(clusters_range)\n",
"display(inertias)\n",
"draw_elbow_diagram(inertias, clusters_range)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Выбор количества кластеров на основе коэффициента силуэта\n",
"\n",
"Коэффициент силуэта рассчитывается с использованием среднего расстояния внутри кластера (а) и среднего расстояния до ближайшего кластера (b) для каждого образца. Коэффициент силуэта для образца равен (b - a) / max(a, b). Для пояснения: b — это расстояние между образцом и ближайшим кластером, частью которого образец не является. Обратите внимание, что коэффициент силуэта определяется только в том случае, если количество меток равно 2 <= n_labels <= n_samples - 1.\n",
"\n",
"Эта функция возвращает средний коэффициент силуэта по всем образцам. \n",
"\n",
"Лучшее значение — 1, худшее — -1. Значения около 0 указывают на перекрывающиеся кластеры. Отрицательные значения обычно указывают на то, что образец был отнесен к неправильному кластеру."
]
},
{
"cell_type": "code",
"execution_count": 143,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"range(2, 13)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"[0.27024619065262834,\n",
" 0.2704234654274893,\n",
" 0.2619942652399716,\n",
" 0.2946089738043157,\n",
" 0.29442550478815743,\n",
" 0.3239316140412729,\n",
" 0.2955578664142471,\n",
" 0.3109257191360407,\n",
" 0.31515029418107016,\n",
" 0.3282942559953307,\n",
" 0.31900504693790716]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArgAAAHUCAYAAADRHluTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABpIUlEQVR4nO3deVxU9f7H8RegLCIgbrihmFaWpigoqZl2Q61scUtLS6Nbt72MNq1fate8aDfLUrO0zUzTMizb7BqhWeKuWV1TM687qJWgkIDD+f3xbUAUFBTmzAzv5+MxD86cOXPmc5jIz3zn8/18fSzLshARERER8RK+dgcgIiIiIlKRlOCKiIiIiFdRgisiIiIiXkUJroiIiIh4FSW4IiIiIuJVlOCKiIiIiFdRgisiIiIiXkUJroiIiIh4FSW4IiIiIuJVlOCKiMdZunQpPj4+LFiwwO5QCt12221ERUUV2+fj48PYsWML748dOxYfHx8OHTrk2uBERKoYJbgi4hZ8fHzKdFu6dKlL4zp48CAPPfQQrVq1IigoiPr169OpUyeeeOIJjh496tJYXCEnJ4exY8eW+Hv+/PPPiyXsIiLuqprdAYiIAMyePbvY/XfeeYclS5acsv+iiy5i8+bNLonp999/JzY2lqysLG6//XZatWrFb7/9xqZNm5g+fTr33HMPNWvWBGDmzJkUFBS4JK7KlJOTwzPPPANAjx49ij32+eefM23aNCW5IuL2lOCKiFu45ZZbit1fuXIlS5YsOWU/4LIE94033mDXrl189913dOnSpdhjWVlZ+Pv7F96vXr26S2KSypGdnU1wcLDdYYhIBVGJgoh4rIKCAsaPH0+TJk0IDAzkyiuv5JdffjnluFWrVnHVVVcRFhZGjRo16N69O999990Zz799+3b8/Py49NJLT3ksNDSUwMDAwvsl1eCW5vDhw9x2223UqlWLsLAwEhISyMnJKXbM8ePHGTduHC1atCAgIICoqCiefPJJcnNzix13cp2vU1RUFLfddtsprztixAgiIyMJCAigZcuWTJw4sXDk+X//+x/16tUD4JlnniksCxk7diy33XYb06ZNK3xN582poKCAyZMn07p1awIDA4mIiOCuu+7ijz/+OOPvIz09nYSEBJo0aUJAQAANGzbkhhtu4H//+1+x47744gu6d+9OSEgIoaGhdOzYkblz5xY75oMPPiAmJoagoCDq1q3LLbfcwt69e4sdc9ttt1GzZk22b9/ONddcQ0hICEOHDj3n6xAR96ERXBHxWBMmTMDX15dHH32UzMxMnnvuOYYOHcqqVasKj/n666+5+uqriYmJYcyYMfj6+vLWW2/xt7/9jeXLl9OpU6dSz9+sWTMcDgezZ89m+PDhFRb3oEGDaN68OUlJSaxfv57XX3+d+vXrM3HixMJj7rjjDmbNmsXAgQN55JFHWLVqFUlJSWzevJmFCxeW+zVzcnLo3r07e/fu5a677qJp06asWLGCUaNGsX//fiZPnky9evUKSy/69etH//79AWjbti3Z2dns27evxLIRgLvuuou3336bhIQEHnzwQXbs2MHUqVPZsGED33333WlHuAcMGMBPP/3EAw88QFRUFAcOHGDJkiXs2rWr8EPD22+/ze23307r1q0ZNWoUtWrVYsOGDSxevJghQ4YUHpOQkEDHjh1JSkoiIyODl156ie+++44NGzZQq1atwtc8fvw4vXv35rLLLuP555+nRo0a53wdIuJGLBERN3TfffdZpf0vKjU11QKsiy66yMrNzS3c/9JLL1mA9cMPP1iWZVkFBQXW+eefb/Xu3dsqKCgoPC4nJ8dq3ry51bNnz9PGkJ6ebtWrV88CrFatWll33323NXfuXOvw4cOnHDt8+HCrWbNmxfYB1pgxYwrvj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MDh8+TLNmzQr3hYeHc/jw4WLPz8vLOyW2Fi1acPTo0TP+Hk6XVJf2WIsWLfjqq6/o2rUrQUFBpz1/aVq0aMEjjzzCI488wrZt24iOjmbSpEm8++67he/jjz/+eMqotpPzd7Jlyxb+9re/FXtsy5YtxX5np4vhXK9DRNyDanBFxGvFxMTQokULnn/++RJXHTt48OBpn79q1Sqys7NP2b969Wp+++23Er8OrwjXXHMNAJMnTy62/4UXXgBMXalTixYtTqmfnTFjxikjuIMGDSItLY0vv/zylNc7fPgwx48fByjsJnBy0gwU9ok9+bFBgwbhcDgYN27cKc85fvx4iedyysnJ4dixY8X2tWjRgpCQkMKWaL169SIkJISkpKRTjnWOesfGxlK/fn1effXVYq3UvvjiCzZv3lzsd1aac7kOEXEvGsEVEa/l6+vL66+/ztVXX03r1q1JSEigcePG7N27l9TUVEJDQ/nkk09Kff7s2bOZM2cO/fr1IyYmBn9/fzZv3sybb75JYGAgTz75ZKXE3a5dO4YPH86MGTM4fPgw3bt3Z/Xq1cyaNYu+fftyxRVXFB57xx13cPfddzNgwAB69uzJ999/z5dffkndunWLnfOxxx5j0aJFXHvttdx2223ExMSQnZ3NDz/8wIIFC/jf//5H3bp1CQoK4uKLL2b+/PlccMEF1K5dmzZt2tCmTRtiYmIAePDBB+nduzd+fn7cdNNNdO/enbvuuoukpCQ2btxIr169qF69Otu2beODDz7gpZdeYuDAgSVe69atW7nyyisZNGgQF198MdWqVWPhwoVkZGRw0003AWYE/sUXX+SOO+6gY8eODBkyhPDwcL7//ntycnKYNWsW1atXZ+LEiSQkJNC9e3duvvnmwjZhUVFRPPzww2f8vZ/LdYiIm7G3iYOISMnK0ibsgw8+KLZ/x44dFmC99dZbxfZv2LDB6t+/v1WnTh0rICDAatasmTVo0CArJSXltDFs2rTJeuyxx6wOHTpYtWvXtqpVq2Y1bNjQuvHGG63169cXO7Y8bcIOHjxY7Li33nr
"text/plain": [
"<Figure size 800x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils_clusters import get_clusters_silhouette_scores\n",
"from visual import draw_silhouettes_diagram\n",
"\n",
"silhouette_scores, clusters_range = get_clusters_silhouette_scores(df, random_state)\n",
"display(clusters_range)\n",
"display(silhouette_scores)\n",
"draw_silhouettes_diagram(silhouette_scores, clusters_range)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Пример анализа силуэтов для разбиения от 2 до 12 кластеров\n",
"\n",
"max_clusters = int(math.sqrt(len(df)))\n",
"\n",
"https://scikit-learn.org/1.5/auto_examples/cluster/plot_kmeans_silhouette_analysis.html"
]
},
{
"cell_type": "code",
"execution_count": 144,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1gU1/s28HsbS+8gCAgIFhAN9i7YW+y9xBKNxt5iElNsiZpoikmMxiTfqNEUS6LG2GI30dhi7w1QsWAF6ezuef/gZX4sdZEyC9wfr73cnTkz88zszOyZhzNnFEIIASIiIiIiIiIiIiKiF6SUOwAiIiIiIiIiIiIiKt2YaCYiIiIiIiIiIiKiQmGimYiIiIiIiIiIiIgKhYlmIiIiIiIiIiIiIioUJpqJiIiIiIiIiIiIqFCYaCYiIiIiIiIiIiKiQmGimYiIiIiIiIiIiIgKhYlmIiIiIiIiIiIiIioUJpqJiIiIiIiIiIiIqFCYaCYis7Ny5UooFArplVl4eLg0fNiwYdLwyMhIo2n2799fskGTWZo9e7a0T/j5+ZXosocNGyYtOzw8vNiWc//+fQwfPhxeXl5Qq9XSMjdt2lRsy6TSL7dzaXmR1+8MlV/msl+YSxzmoLDboqxvSznrOURERDlhopmIit2vv/6K9u3bo0KFCtBoNHBwcIC/vz/Cw8MxadIk7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111+Xukfw8fGBj48PbG1tsWzZMty8eRMAUK9ePfTr10+axtnZGQDwyiuv4PTp0wAAOzs7DBw4EN7e3jh06BB27Ng
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8Hu2ZJNseoMUSEJCCc1QpQdEuiBFeo0iSAeRV7FRFFCwgCKI5QMFC0WKiID0KojSO0hooYWWkJ7dPd8fIWM22SQbUibJ3r/rypXdmTMzz8zOzJ559swZSQghQERERERERERERET0hFRKB0BEREREREREREREpRsTzURERERERERERERUIEw0ExEREREREREREVGBMNFMRERERERERERERAXCRDMRERERERERERERFQgTzURERERERERERERUIEw0ExEREREREREREVGBMNFMRERERERERERERAXCRDMRERERERERERERFQgTzURU4ixZsgSSJMl/mbVs2VIePmTIEHn45cuXzabZuXNn8QZNJdLUqVPlfSIoKKhYlz1kyBB52S1btiyy5dy6dQuRkZHw9/eHRqORl7l27doiWyaVfjmdS21Fbt8zZLtKyn5RUuIoCQq6Lcr6tlSynkNERGQJE81EVOR+/vlntGvXDuXKlYNWq4WrqyuCg4PRsmVLjBs3Dps3b1Y6xBLN2iS6rSeObJEQAi+88AKWLFmCGzduwGg0Kh0SAGDnzp1m++ySJUvMxj948AANGzaUx6tUKixcuNDitJIkoUuXLhaXs3nz5mxlue+XDmU9+UNUkmQ9r16+fFnpkAoFzyPKY0MP61y8eBFjxoxBkyZNEBAQAAcHB9jb28Pf3x8dOnTAkiVLSkwdjoiooDRKB0BEZdugQYOwdOlSs2FxcXGIi4vD5cuXsWvXLly5cgXt2rWTxzdo0ABz5swp7lCJClWfPn1Qs2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tuOHTvMyk+ZMkUEBweb7ee//vqrVdN27dpVfv3FF18IIYSIjY0Vzs7OcnyZj5PM5wUhhNi/f7/w8vLKdf13795tNk1x7tctW7bMdVm9e/fOdVtnNm3aNCFJUo7zWrNmjVw2p3Np1u2fce7IkNO5L+t529JfUlJStnO1pb/M833zzTdzLdu8eXMRHx9vFmPW8Vk/b0vxZpZ529SuXVve17LuA1u3bjWbbv369UKj0WQr6+npKZo0aWLxfJCXgh6/+Yk/J/k99xX0+PHw8LD4Pent7S3WrFkjdDpdtnFZv9uz7sfPPPOMxVgaNGhgNl1u+0Vhf39GRUWJ8uXLW9w+HTt2zDGOiRMn5rp97ezsxJYtW+TyeR1vGcf/o0eP8iz77LPPCoPBkOe6mUwm4enpKU/3ww8/yOOaNWsmD69fv748fOXKlfJwFxcXeTmWPpP8nEeyTp9T/XDgwIFWf3aFfYxltWHDBovzzPgbN26cXDa3OmfmabIec4VRR7Gmjpph7dq1uc7X399fnD59OsftnFNdJL/np9xY8z2W+S/r9s6P5ORkcebMGfH888+bzfPEiRNPPE8iopKCXWcQUZGpW7eu/Pru3buoUqUKwsPD0aBBA9SrVw+tWrVCaGhokSx78+bNaNCgAdq1a4cdO3bI/dheuHABa9euRZ8+fQAAu3fvxquvviq3MqxYsSL69u2L+Ph4LF68GImJiYiNjUWPHj1w8eJFuLu7P3FMRqMR3bp1k1sIent7o1+/fvDw8MDmzZuxf/9+pKSkYNCgQahXrx4qVaqEt956C5cvX8bMmTPl+bzyyity9wgVKlRAhQoV4OTkhIULF+LSpUsAgPr166N3797yNB4eHgCAgQMH4ujRowAAZ2dn9OvXDwE
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy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yxZp/OzOt9Tz//Hjx9mO+8ILLwij0ZjtupnNZuHp6SlNt2zZMmlYo0aNpP61a9eW+q9cuVLq7+LiIi3H1j7JyXUk/fSZlQ9ffvllu/ddXp9j6W3YsMHmPFM/o0aNksbNqsyZdpr051xelFHsKaOmWrNmTZbz9fPzE6dOncp0O2dWFsnp9Skr9vyOpf2k3972SN3uXl5e4vbt2zaPWSKioo5NZxBRvqlZs6bUfe/ePVSsWBHh4eGoU6cOatWqhWbNmiEkJCRflr1582bUqVMHrVu3xo4dO6R2bM+dO4c1a9agV69eAIDdu3fjzTfflGoZlitXDr1790ZsbCwWLVqE+Ph4REdHo1u3bjh//jzc3d2fOSaTyYQuXbpINQS9vb3Rp08feHh4YPPmzdi3bx+SkpLQv39/1KpVC+XLl8f777+PS5cuYerUqdJ8Xn/9dal5hLJly6Js2bJwdnbG/PnzcfHiRQBA7dq10bNnT2kaDw8PAMDLL7+MI0eOAAAMBgP69OkDf39/7N27F5s2bYLZbMaYMWNQu3ZtNGzYMNt10ul0eP755xEeHg5PT084OzsjOjoa27Ztw8GDByGEwFtvvYWePXvC0dExw/T379/Hw4cP0b9/f5QpUwbffPONVKtl9uzZ+OCDD6D
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdZ3wUVdvH8d9uyqYHEgglgRASehEBEZAq0kQRRDpSFEGKICoqeitgAZVHBUWxg2JDUFQsIEhTEEWRroDSQekkpJed50XImE0PKZvy/+5nYXbqNbMzs2eunDljMQzDQERERERERERERETkClmdHYCIiIiIiIiIiIiIlG5KNIuIiIiIiIiIiIhIgSjRLCIiIi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d5iYiUdGo6Q0SKTPPmzc3us2fPUrduXZo1a8Y111xDixYt6Ny5MxEREUWy7FWrVnHNNdfQvXt31q1bZ7Zje+DAAT7//HMGDRoEwMaNG7nvvvvMWoY1a9Zk8ODBREdHs3DhQmJjY4mMjKRfv3789ddfVKxY8YpjSklJoW/fvmYNwcqVKzNkyBACAgJYtWoVmzdvJiEhgeHDh9OiRQtq167No48+yuHDh5k1a5Y5n7vvvttsHqFGjRrUqFEDHx8fFixYwMGDBwFo2bIlAwcONKcJCAgA4Pbbb2f79u0A+Pr6MmTIEEJCQti0aRMrV67EbrczZcoUWrZsyXXXXZfrOtlsNlq3bk2zZs0IDAzEx8eHyMhIvv/+e7Zu3YphGNx///0MHDgQT0/PTNOfO3eOCxcuMHz
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wT9f8H8Ndltk33grZAW1p2qWVvyp6C7L2qCDJkCHwVF6ACCj8FBEFwAAIqQ0AREdkoS2TvWfZeLd1N8/n9EXI0bdqmdKTj9eQRern5vsvd5XPvfO5zkhBCgIiIiIiIiIiIiIjoBSlsHQARERERERERERERFW5MNBMRERERERERERFRjjDRTEREREREREREREQ5wkQzEREREREREREREeUIE81ERERERERERERElCNMNBMRERERERERERFRjjDRTEREREREREREREQ5wkQzEREREREREREREeUIE81ERERERERERERElCNMNBNRgbNkyRJIkiS/UmvSpIncf9CgQXL/K1eumE2zc+fO/A2aCqTJkyfL+0RAQEC+LnvQoEHysps0aZJny7lz5w4iIiLg5+cHlUolL3P9+vV5tkwq/DI6lxYXmX3PUPFVUPaLghJHQZDTbVHUt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QUdO7cWa4h6OXlhT59+sDd3R2bN2/G3r17kZiYiAEDBqBGjRooW7Ys3nvvPVy5cgXTpk2T5/PGG2/IzSOULl0apUuXhqOjIxYsWIDLly8DAGrWrImePXvK07i7uwMA+vf
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8HtmW5JNb5ACSUjoxdClhl4FKdIRiCJIB4FPsQEqoPIqIAiCBRRQKQqCCEhHQYogvUNoobeE9LLn+2PJkE02jZRJuX9cezE79Zm6Z56cOSMJIQSIiIiIiIiIiIiIiJ6RrHYARERERERERERERFS0MdFMRERERERERERERLnCRDMRERERERERERER5QoTzURERERERERERESUK0w0ExEREREREREREVGuMNFMRERERERERERERLnCRDMRERERERERERER5QoTzURERERERERERESUK0w0ExEREREREREREVGuMNFMRIXOkiVLIEmS8kmtWbNmSv9BgwYp/S9fvmwxzc6dOws2aCqUpkyZohwT/v7+BbrsQYMGKctu1qxZvi3n1q1bCA0NhY+PD7RarbLMtWvX5tsyqejL6FpaUmT2O0MlV2E5LgpLHIVBbrdFcd+WapZziIiIrGGimYjy3c8//4y2bduiVKlS0Ol0cHJyQkBAAJo1a4YxY8Zg8+bNaodYqGU3iV7SE0clkRACL730EpYsWYIbN24gOTlZ7ZAAADt37rQ4ZpcsWWIx/OHDh6hXr54yXJZlLFiwwOq0kiShc+fOVpezefPmdOPy2C8ainvyh6gwSXtdvXz5stoh5QleR9THih7Zk7asktEnPysmEBEVFK3aARBR8TZgwAAsXbrUol9kZCQiIyNx+fJl7Nq1C1euXEHbtm2V4XXr1sXMmTMLOlSiPNW7d29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N69e4W7u3um6797926LaQryuG7WrFmmy+rVq1em2zq1qVOnCkmSMpzXmjVrlHEzupam3f4p144UGV370l63rX1iY2PTXautfVLP9+2338503CZNmoioqCiLGNMOT7u/rcWbWuptU6NGDeVYS3sMbN261WK69evXC61Wm25cNzc30bBhQ6vXg6zk9vzNSfwZyem1L7fnj6urq9XfSQ8PD7FmzRphMBjSDUv72572OG7RooXVWOrWrWsxXWbHRV7/foaFhYnSpUtb3T4dOnTIMI7x48dnun31er3YsmWLMn5W51vK+f/48eMsx23VqpVISkrKct1MJpNwc3NTplu+fLkyrHHjxkr/OnXqKP1XrVql9Hd0dFSWY22f5OQ6knb6jMqHL7/8crb3XV6fY2lt2LDB6jxTPmPGjFHGzazMmXqatOdcXpRRslNGTbF27dpM5+vj4yNOnTqV4XbOqCyS0+tTZrLzO5b6k3Z759StW7csrmcTJkzI1fyIiAoLNp1BRPmmVq1aSve9e/dQoUIFBAcHo27duqhduzaaN2+OoKCgfFn25s2bUbduXbRt2xY7duxQ2rE9f/481q5di969ewMAdu/ejTfeeEOpZVi2bFn06dMHUVFRWLx4MWJiYhAREYHu3bvjwoULcHFxeeaYkpOT0bVrV6WGoIeHB/r27QtXV1ds3rwZe/fuRXx8PAYMGIDatWujXLlyeOedd3D58mVMnz5dmc/rr7+uNI9QpkwZlClTBvb29liwYAEuXboEAKhTpw569eqlTOPq6goAePnll3HkyBEAgIODA/r27QtfX1/s2bMHmzZtgslkwrhx41CnTh00atQoy3UyGAx4/vnnERwcDDc3N9jb2yMiIgLbtm3DwYMHIYTA+PHj0atXL9ja2qab/v79+3j48CEGDBgAb29vfPPNN0qtljlz5uDdd9+
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tY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ssVsvnXr1gmVSmU1rY+Pj2jQoIHN60FWcnr+Zif+jGT32pfT88fb29vm30k/Pz+xevVqodVqrcZZ/m23PI6bNWtmM5Y6deqYzZfZcZHbfz8vX74sSpYsaXP/tG3bNsM4JkyYkOn+1Wg0YvPmzfL0WZ1vxvP/yZMnWU77wgsviNTU1Cy3Ta/XCx8fH3m+ZcuWyeMaNWokD69du7Y8fOXKlfJwd3d3eT22fpPsXEcs58+ofNivXz+7f7vcPscsrV+/3uYyjZ8xY8bI02ZW5jSdx/Kcy40yij1lVKM1a9ZkutygoCBx+vTpDPdzRmWR7F6fMmPP3zHTj+X+zsy4cePk+dzc3MTu3btFUlKSOHHihChdurQ87rXXXrN7mUREBRWbziCiPFOzZk25+/79+yhfvjwiIiJQp04d1KpVC02bNkV4eHierHvTpk2oU6cOWrVqhe3bt8vt2F64cAFr1qxBr169AAC7du3C+PHj5VqGZcqUQe/evREbG4tFixYhPj4e0dHR6Nq1Ky5evAgvL69njiktLQ2dO3eWawj6+fmhT58+8Pb2xqZNm7B3714kJSWhf//+qFWrFsqWLYu3334bV65cwYwZM+TlvPbaa3LzCKVLl0bp0qXh6uqKBQsW4NKlSwCA2rVro2fPnvI83t7eAIB+/frh6NGjAAA3Nzf06dM
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wT9f8H8Ndltk33gtJCW1r2sGyZBZEle1NAoIogQ4bIV3ExFFD5qSAIiqMooDJkiAjIRkEQ2UuG7L1bupvm8/sjzZE0aZvSkY7X00fkcve5u3cud5fPvfu5z0lCCAEiIiIiIiIiIiIioiekcHQARERERERERERERFS8MdFMRERERERERERERHnCRDMRERERERERERER5QkTzURERERERERERESUJ0w0ExEREREREREREVGeMNFMRERERERERERERHnCRDMRERERERERERER5QkTzURERERERERERESUJ0w0ExEREREREREREVGeMNFMREXOokWLIEmS/DLXsmVLefyQIUPk8RcvXrSYZ8eOHYUbNBVJU6ZMkfeJkJCQQl33kCFD5HW3bNmywNZz8+ZNREdHIzAwECqVSl7nmjVrCmydVPxldS4tLbL7naHSq6jsF0UljqIgr9uipG9LR9ZziIiIbGGimYgK3E8//YR27dqhTJkyUKvV8PDwQGhoKFq2bImxY8di06ZNjg6xSLM3iV7aE0elkRACvXr1wqJFi3D9+nWkp6c7OiQAwI4dOyz22UWLFllMf/DgARo2bChPVygUWLBggc15JUlCly5dbK5n06ZNVmW57xcPJT35Q1SUZD6vXrx40dEh5QueRxyPDT3sl5CQgJkzZ6J+/fpwc3ODk5MTwsPDMWrUKFy5csXR4RER5RuVowMgopJt0KBBWLx4scW4uLg4xMXF4eLFi9i5cycuXbqEdu3aydMbNGiAWbNmFXaoRPmqX79+qFmzJgCgfPnyBbKOy5cvY/fu3fL7Tp06oXnz5lAoFPK6i5o7d+6gTZs2OHLkCABAoVDg66+/RnR0dJbzrF+/HufPn0fFihUtxs+ZM6dAY6WSi78zRMUDj1UqCa5fv45WrVrhzJkzFuP/++8/zJ8/H0uXLsX69evRtGlTB0VIRJR/mGgmogKzceNGiyRzvXr10K5dO7i6uuLOnTs4ePAg/vrrL6v5atSogRo1ahRmqET5rn379mjfvn2BruPSpUsW72fPno2wsLACXWdqaiqEENBqtbme9+bNm2jdujVOnjwJAFAqlfj+++/Rv3//bOczGAyYN28ePvnkE3ncmTNnsHHjxlzHQKVbXFwc3N3d+TtDVEzwWCVb8lIXcYShQ4fKSWa1Wo3o6GiULVsWy5Ytw+nTpxEbG4s+ffrg5MmT8PDwcHC0RER5w64ziKjA/P777/JweHg49u3bh+nTp2PSpEn45JNPsGPHDty5cwcTJ060mC+/boVcvXo1GjduDBcXF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Zk22yw0MDBQnT57McjtnVRfJ7fkpO/b8jpm/Mm/vrOzZs8divhUrVlhM9/f3l6e1bt3armUSERVl7DqDiApM3bp15eG7d++icuXKiIiIQIMGDVCvXj20atUK4eHhBbLuTZs2oUGDBmjXrh22b98u92N79uxZrFmzBv369QMA7Nq1C6+++qrcyrBChQqIiopCfHw8YmJikJiYiNjYWPTs2RPnzp2Dl5fXE8eUnp6O7t27yy0E/fz80L9/f3h7e2PTpk3Ys2cPUlJSMGjQINSrVw8VK1bEW2+9hYsXL2LGjBnycl5++WW5e4Ty5cujfPnycHV1xYIFC3D+/HkAQP369dG3b195Hm9vbwDA888/j8OHDwMA3Nzc0L9/fwQFBWH37t3YuHE
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8Hu2JtkUkpBAEiCEhBaKoSo1FGkiSO8CUQQp0vkUG6ACCq8CgqBYAgIqRaoIkY50BEKXIr33hPSy5/tjs8NudpNsSNmU+5drr0yfZ2ZnJmeenDkjCSEEiIiIiIiIiIiIiIiek8LeARARERERERERERFR4cZEMxERERERERERERHlCBPNRERERERERERERJQjTDQTERERERERERERUY4w0UxEREREREREREREOcJEMxERERERERERERHlCBPNRERERERERERERJQjTDQTERERERERERERUY4w0UxEREREREREREREOcJEMxHZzaJFiyBJkvwx1axZM3n4wIED5eFXrlwxm2fnzp35GzQVSJMnT5aPifLly+frugcOHCivu1mzZnm2njt37iAsLAx+fn5QqVTyOteuXZtn66TCL6NraXGR2d8ZKr4KynFRUOIoCHK6L4r6vrRnOYeIiCg7mGgmolzz22+/oU2bNihVqhTUaj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wccXFxiIqKQteuXXHx4kW4u7s/d0ypqano3LmzXEPQy8sLffr0gYeHByIiIrBv3z4kJiaif//+qFOnDip
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8Hu2ZrPpCYEQIISEXgxVqaEXkS4dgWgEKVLlVWyAUhQ+ERVBsQBSlCJFRIh0pEoLvUrvPSG97Pn+2Oywm90kG1I2Iffvuvba6fPM7MzkzJMzZyQhhAARERERERERERER0TNSODoAIiIiIiIiIiIiIircmGgmIiIiIiIiIiIiohxhopmIiIiIiIiIiIiIcoSJZiIiIiIiIiIiIiLKESaaiYiIiIiIiIiIiChHmGgmIiIiIiIiIiIiohxhopmIiIiIiIiIiIiIcoSJZiIiIiIiIiIiIiLKESaaiYiIiIiIiIiIiChHmGgmIodZsGABJEmSP+aaNm0qDx84cKA8/PLlyxbzbN++PX+DpgJp4sSJ8jFRtmzZfF33wIED5XU3bdo0z9Zz+/ZthIWFwd/fHyqVSl7nmjVr8mydVPhldC0tKjL7O0NFV0E5LgpKHAVBTvfF874vHVnOISIiyg4mmoko1/z2229o06YNihcvDrVaDXd3dwQGBqJp06YYOXIkIiIiHB1igWZvEr2oJ46KIiEEXn31VSxYsAA3b95Eamqqo0MCAGzfvt3imF2wYIHF+EePHqFevXryeIVCgblz59qcV5IkdOzY0eZ6IiIirKblsV84PO/JH6KCJP119fLly44OKVfwOuJ4rOhhn+TkZHz55Zfo27cvKlasCIVCYVdlhNOnT+PDDz9E27Zt4ePjk2nZioiooFM5OgAiej70798fixYtshgWHR2N6OhoXL58GTt27MCVK1fQpk0beXzd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LfZ/Vb27yLMe3+XlWs2ZNodfrLeY5cuRIprFt27bNYvoJEyaIwMBAi+P8jz/+sGvezp07y93ffvutEEKIqKgo4erqKsdnfp6YXxeEEGLPnj3Cx8cn0+3fuXOnxTz5eVw3bdo003X17Nkz031tbtKkSUKSpAyXtXr1annajK6l6fe/6dphktG1L/1129YnPj7e6lpt62O+3Pfffz/TaRs3bixiYmIsYkw/Pv3vbStec+b7pkaNGvKxlv4Y2Lx5s8V869atEyqVympab29v0aBBA5vXg6zk9PzNTvwZye61L6fnj5eXl82/k8WKFROrV68WWq3Walz6v+3pj+PmzZvbjKVu3boW82V2XOT2389Lly6JEiVK2Nw/L7/8coZxjB07NtP9q9FoxKZNm+TpszrfTOf/kydPspy2ZcuWIiUlJcttMxgMwtvbW55vyZIl8rhGjRrJw+vUqSMPX7FihTzczc1NXo+t3yQ715H082dUPnzttdfs/u1y+xxLb/369TaXafqMHDlSnjazMqf5POnPudwoo9hTRjVZs2ZNpsv19/cXp06dynA/Z1QWye71KTP2/B0z/6Tf39lhvm32/k1If9yn/02JiAo6Np1BRDlWq1Ytufv+/fuoUKECQkJCULduXdSuXRvNmjVDcHBwnqw7IiICdevWRZs2bbBt2za5Hdvz589jzZo16NWrFwBg586dGDNmjFzLsEyZMujduzdiYmIwf/58xMXFISoqCt26dcOFCxfg6en5zDGlpqaiS5cucg3BYsWKoU+fPvDy8kJERAT27NmDxMRE9O/fH7Vr10a5cuXwwQcf4PLly5g6daq8nLfeektuHqF06dIoXbo0XFxcMHfuXFy8eBEAUKdOHfTs2VOex8vLCwDw2muvITIyEgDg6uqKPn36oFSpUti9ezc2btwIg8GA0aN
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXR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rlwpT5vdtTTr/jddO0yyu/ZlvW7b+jx8+NDqWm3rY77cd955J8dpmzdvLhITEy1izDo+6/dtK15z5vumdu3a8rGW9RjYtGmTxXxr1qwRKpXKalofHx/RpEkTm9eD3OT3/M1L/NnJ67Uvv+ePt7e3zd9JPz8/sXLlSqHVaq3GZf1tz3oct27d2mYsDRs2tJgvp+OioH8/4+LiRNmyZW3un2effTbbOF5//fUc969GoxEbN26Up8/tfDOd/w8ePMh12rZt24qMjIxct81gMAgfHx95vsWLF8vjmjVrJg9v0KCBPHzZsmXycHd3d3k9tr6TvFxHss6fXfnwxRdftPu7K+hzLKu1a9faXKbpM3r0aHnanMqc5vNkPecKooxiTxnVZNWqVTkuNygoSJw4cSLb/ZxdWSSv16ec2PM7Zv7Jur/zwnzb8vKbYJL1OnD79u3HjoWIqKiw6Qwiyrd69erJ3bdv30aVKlUQERGBhg0bon79+mjVqhXCwsIKZd0bNmxAw4YN0aFDB2zdulVux/bs2bNYtWoV+vTpAwDYsWMHxo0bJ9cyrFChAvr27YvExETMnz8fycnJiI+PR48ePXDu3Dl4eXk9dkx6vR7dunWTawj6+fmhX79+8Pb2xoYNG7B7926kpqZiwIABqF+/PipVqoR3330
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils_clusters import get_clusters_silhouettes\n",
"from visual import draw_silhouettes\n",
"\n",
"\n",
"silhouettes = get_clusters_silhouettes(reduced_data, random_state)\n",
"draw_silhouettes(reduced_data, silhouettes)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}