(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 28157, 688] NotebookOptionsPosition[ 27081, 660] NotebookOutlinePosition[ 27484, 676] CellTagsIndexPosition[ 27441, 673] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Weighted k - means algorithm\t\t", "Subsection", CellChangeTimes->{{3.525616360604874*^9, 3.5256163644892807`*^9}, 3.5256170782217345`*^9, 3.5262058902050314`*^9, 3.5262060212488317`*^9, 3.526206146804221*^9, {3.5262146495319996`*^9, 3.526214660301216*^9}, { 3.526268235603675*^9, 3.5262682603453183`*^9}, {3.526271497881405*^9, 3.526271504183816*^9}, {3.526272345602494*^9, 3.526272371124139*^9}, { 3.526272761748825*^9, 3.5262727798448563`*^9}, {3.5262733652982845`*^9, 3.5262734414576187`*^9}, {3.526273604665105*^9, 3.5262736247735405`*^9}, 3.526289526950795*^9, {3.5712988897963448`*^9, 3.5712989095705805`*^9}, { 3.5713006259192133`*^9, 3.5713007138277683`*^9}, {3.5713007531946383`*^9, 3.571300771948871*^9}, {3.5713008158719487`*^9, 3.5713008213017583`*^9}, { 3.5713010538319693`*^9, 3.571301059058978*^9}, {3.5713026879974575`*^9, 3.5713027468205614`*^9}, {3.571302831529111*^9, 3.571302841748129*^9}, { 3.5713028969822264`*^9, 3.571302908216246*^9}, {3.571303208091176*^9, 3.571303209541979*^9}, {3.5713032974143333`*^9, 3.5713033007069397`*^9}, { 3.5713034979916883`*^9, 3.5713034993176904`*^9}, {3.571303581655036*^9, 3.5713035867260447`*^9}, {3.571304578139395*^9, 3.5713046065042453`*^9}, { 3.571304657245535*^9, 3.571304680884577*^9}, {3.571310017656273*^9, 3.571310032448099*^9}, {3.571310291879758*^9, 3.571310305546382*^9}, { 3.5713118990221987`*^9, 3.5713118994433994`*^9}, {3.5713119570019007`*^9, 3.5713119573451014`*^9}, 3.5713122470594134`*^9, 3.571365674705989*^9, { 3.57136576008634*^9, 3.57136582210345*^9}, 3.5713658564929104`*^9, { 3.571365903925994*^9, 3.5713659117592077`*^9}, {3.571365953060481*^9, 3.571365988119743*^9}, 3.571366114458166*^9, {3.5713663292159452`*^9, 3.5713664037264786`*^9}, {3.5713664475247555`*^9, 3.5713664652181873`*^9}, {3.583463667516041*^9, 3.5834636763476562`*^9}, { 3.5834637448145776`*^9, 3.5834638126820984`*^9}, {3.583463928036507*^9, 3.583463936587322*^9}, {3.5834640002474346`*^9, 3.5834640785287733`*^9}, { 3.583464283239937*^9, 3.583464301667569*^9}, {3.583464610199915*^9, 3.5834646193279314`*^9}, {3.58346479905805*^9, 3.58346481041787*^9}, { 3.5845924958427024`*^9, 3.584592509620527*^9}, {3.585384188395161*^9, 3.585384194558172*^9}, {3.5853842286668324`*^9, 3.5853842303828354`*^9}, { 3.5853904610529246`*^9, 3.5853905905625544`*^9}, {3.585390754049445*^9, 3.585390759806855*^9}, {3.585390809549743*^9, 3.5853908141215515`*^9}, { 3.5853908518494177`*^9, 3.585390872960255*^9}, {3.585390921657941*^9, 3.5853909252001476`*^9}, {3.585390970713428*^9, 3.585390982041048*^9}, { 3.5853911246397*^9, 3.5853911371851225`*^9}, {3.5853912967752047`*^9, 3.5853913671453285`*^9}, {3.585391510369982*^9, 3.5853915141461887`*^9}, { 3.5853916673824606`*^9, 3.5853916997117176`*^9}, {3.5853917298881707`*^9, 3.585391759222223*^9}, 3.5853919038976784`*^9, {3.585392081138392*^9, 3.585392094275615*^9}, {3.5853921646925397`*^9, 3.5853921652385406`*^9}, { 3.5853922544282985`*^9, 3.5853922707645273`*^9}, 3.5853926411463823`*^9, { 3.585392743689764*^9, 3.5853927724466143`*^9}, {3.585392821861902*^9, 3.585392892625027*^9}, {3.585392980566783*^9, 3.5853929924560037`*^9}, { 3.585393022648057*^9, 3.5853930568971176`*^9}, {3.585393089367775*^9, 3.585393089882576*^9}, {3.585393512453127*^9, 3.5853935139839296`*^9}, { 3.5853940508786793`*^9, 3.585394204396752*^9}, {3.5853942383172116`*^9, 3.5853942783236823`*^9}, {3.585394313274744*^9, 3.5853943259761667`*^9}, { 3.5853974538852997`*^9, 3.5853975400466523`*^9}, {3.585397570571306*^9, 3.585397570884307*^9}, {3.5853976141687837`*^9, 3.58539765707786*^9}, { 3.585398300135197*^9, 3.5853983391120663`*^9}, {3.585398538675419*^9, 3.585398561316059*^9}, {3.5853988501949697`*^9, 3.5853989417095327`*^9}, { 3.5853990606827426`*^9, 3.585399182486558*^9}, {3.5853994070305552`*^9, 3.585399461906852*^9}, {3.585399572267847*^9, 3.5853995737810497`*^9}, { 3.5853999723233557`*^9, 3.585400002031808*^9}, {3.585400050261493*^9, 3.5854000549113016`*^9}, {3.5854000992373805`*^9, 3.5854001568446827`*^9}, {3.5854012476180143`*^9, 3.5854012947234974`*^9}, {3.5854014618211927`*^9, 3.585401501578063*^9}, { 3.5854022421005745`*^9, 3.5854022449407797`*^9}, {3.5854023168251066`*^9, 3.585402336141941*^9}, {3.5854024165714836`*^9, 3.585402484833604*^9}, { 3.585408314941718*^9, 3.5854083322551494`*^9}, {3.5854083697334156`*^9, 3.585408392125257*^9}, {3.5854084715109262`*^9, 3.5854084897045584`*^9}, { 3.585408900137684*^9, 3.5854089006368847`*^9}, {3.5854090232785025`*^9, 3.5854090238401036`*^9}, {3.5854091870407925`*^9, 3.585409229653468*^9}, { 3.5854097244021454`*^9, 3.585409746340784*^9}, {3.5856371040607595`*^9, 3.5856371057309628`*^9}, 3.588251133089259*^9, 3.588654178816718*^9, { 3.649209957073268*^9, 3.6492099581496696`*^9}, {3.821013213528505*^9, 3.821013216871851*^9}},ExpressionUUID->"0c7c2b10-4042-417d-ac6f-\ 29889d5fff8e"], Cell[BoxData[ RowBox[{ RowBox[{"WKMeans", "[", RowBox[{"w_", ",", "A_", ",", "z_", ",", RowBox[{"Ind_:", "0"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"m", "=", RowBox[{"Length", "[", "A", "]"}]}], ",", RowBox[{"k", "=", RowBox[{"Length", "[", "z", "]"}]}], ",", "c0", ",", "Pod", ",", "imin", ",", "tab", ",", "PI", ",", RowBox[{"It", "=", "0"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Pod", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"c0", "=", "z"}], ";", " ", "\[IndentingNewLine]", RowBox[{"PI", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "k"}], "}"}]}], "]"}]}], ";", " ", "\[IndentingNewLine]", "\t\t\t", RowBox[{"(*", " ", RowBox[{"Minimal", " ", "distance", " ", "principle"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"tab", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{"Pod", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"c0", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"imin", "=", RowBox[{ RowBox[{"Ordering", "[", RowBox[{"tab", ",", "1"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", "imin", "]"}], "]"}], "=", RowBox[{"Append", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", "imin", "]"}], "]"}], ",", RowBox[{"Pod", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"PI", "=", RowBox[{"DeleteCases", "[", RowBox[{"PI", ",", RowBox[{"{", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"k", "=", RowBox[{"Length", "[", "PI", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Ind", "\[NotEqual]", " ", "0"}], ",", RowBox[{"Print", "[", RowBox[{"It", ",", "\"\<: F = \>\"", ",", RowBox[{"WF", "[", "PI", "]"}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", "\t\t\t\t\t\t", RowBox[{"(*", " ", RowBox[{"New", " ", "centers"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"While", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"c", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Mean", "[", RowBox[{"WeightedData", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "2"}], "]"}], "]"}], ",", RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "1"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "PI", "]"}]}], "}"}]}], "]"}]}], ";", " ", "\[IndentingNewLine]", "\t\t", RowBox[{"(*", " ", RowBox[{ RowBox[{ "The", " ", "case", " ", "of", " ", "reducing", " ", "the", " ", "number", " ", "of", " ", "clusters", " ", "in", " ", "a", " ", "partition", "\[IndentingNewLine]", "\t\t\t\t", "in", " ", "the", " ", "case", " ", "n"}], "=", RowBox[{"2", " ", "-", " ", RowBox[{ "can", " ", "be", " ", "extended", " ", "to", " ", "an", " ", "arbitrary", " ", "n"}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", "c", "]"}], "<", RowBox[{"Length", "[", "c0", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{ "\"\\"", ",", RowBox[{"Length", "[", "c0", "]"}], ",", "\"\< -> \>\"", ",", RowBox[{"Length", "[", "c", "]"}], ",", "\"\<}\\nTry with a new initial centers\>\""}], "]"}], ";"}]}], "\[IndentingNewLine]", "\t", "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"Chop", "[", RowBox[{"Norm", "[", RowBox[{"c", "-", "c0"}], "]"}], "]"}], "\[NotEqual]", "0"}]}], ",", RowBox[{ RowBox[{"c0", "=", "c"}], ";", RowBox[{"It", "=", RowBox[{"It", "+", "1"}]}], ";", "\[IndentingNewLine]", "\t\t\t\t", RowBox[{"(*", " ", RowBox[{"New", " ", "partition"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"PI", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "k"}], "}"}]}], "]"}]}], ";", " ", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"tab", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{"Pod", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"c0", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"imin", "=", RowBox[{ RowBox[{"Ordering", "[", RowBox[{"tab", ",", "1"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", "imin", "]"}], "]"}], "=", RowBox[{"Append", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", "imin", "]"}], "]"}], ",", RowBox[{"Pod", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"PI", "=", RowBox[{"DeleteCases", "[", RowBox[{"PI", ",", RowBox[{"{", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"k", "=", RowBox[{"Length", "[", "PI", "]"}]}], ";", " ", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Ind", "\[NotEqual]", " ", "0"}], ",", RowBox[{"Print", "[", RowBox[{"It", ",", "\"\<: F = \>\"", ",", RowBox[{"WF", "[", "PI", "]"}]}], "]"}]}], "]"}], ";"}]}], "\[IndentingNewLine]", " ", "]"}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"PI", ",", "c0", ",", RowBox[{"WF", "[", "PI", "]"}], ",", "It"}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.827114567512955*^9, 3.8271146294897485`*^9}, { 3.8271147440375824`*^9, 3.8271147470680733`*^9}, 3.8271157617443647`*^9, { 3.8271158884091043`*^9, 3.827115931076314*^9}, {3.827117308614561*^9, 3.827117310329851*^9}, {3.827118673169304*^9, 3.827118678510786*^9}, { 3.872650864087328*^9, 3.872650865336426*^9}},ExpressionUUID->"9ffbb91a-afb1-46f9-8fb7-\ c143ccc22570"], Cell[CellGroupData[{ Cell["Example", "Subsubsection", CellChangeTimes->{{3.8271189384981847`*^9, 3.8271189503270173`*^9}},ExpressionUUID->"87da2658-1dd3-42f2-ba82-\ c4fe943713af"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{"Call", " ", "Submodule", " ", RowBox[{"WF", "[", "]"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"A", "=", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "7"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "6"}], "}"}]}], "}"}], "//", "N"}]}], ";", " ", RowBox[{"w", "=", RowBox[{"Table", "[", RowBox[{"1", ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "A", "]"}]}], "}"}]}], "]"}]}], ";", " ", " ", RowBox[{"z0", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "7"}], "}"}]}], "}"}]}], ";"}], " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"slpod2", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"{", RowBox[{"A", ",", "z0"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"PointSize", "[", ".05", "]"}], "}"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"GridLines", "\[Rule]", "Automatic"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"time", "=", RowBox[{"Timing", "[", RowBox[{"sol", "=", RowBox[{"WKMeans", "[", RowBox[{"w", ",", "A", ",", "z0"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{ RowBox[{"WF", "[", RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}], "//", "N"}], ",", " ", "\"\<; G= \>\"", ",", RowBox[{ RowBox[{"WG", "[", RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}], "//", "N"}], ",", "\"\<; CPU=\>\"", ",", RowBox[{"time", "[", RowBox[{"[", "1", "]"}], "]"}], ",", " ", "\"\<; It = \>\"", ",", RowBox[{"sol", "[", RowBox[{"[", "4", "]"}], "]"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", "Figures", " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{ "\"\\"", ",", "z0"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"slc", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], ",", RowBox[{"PlotMarkers", "\[Rule]", RowBox[{"{", RowBox[{"\"\<\[SixPointedStar]\>\"", ",", "20"}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Gray", ",", RowBox[{"PointSize", "[", ".025", "]"}], ",", RowBox[{"Opacity", "[", ".7", "]"}]}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"slPI", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"sol", "[", RowBox[{"[", RowBox[{"1", ",", "j", ",", "All", ",", "2"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", ".05", "]"}], ",", RowBox[{"Hue", "[", RowBox[{"j", "/", "k"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", StyleBox[ RowBox[{ RowBox[{"sl3", "=", RowBox[{"Show", "[", RowBox[{"slPI", ",", "slc", ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}]}], ";"}], FontColor->GrayLevel[0]], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"GraphicsGrid", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"slpod2", ",", "sl3"}], "}"}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "Medium"}]}], "]"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.8271173569246078`*^9, 3.8271174198761387`*^9}, { 3.827118902598764*^9, 3.827118963619529*^9}, {3.8288768529208317`*^9, 3.8288768703621836`*^9}}, CellLabel-> "In[159]:=",ExpressionUUID->"231b6d6d-f122-441d-943f-3def75a49a75"], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"F= \"\>", "\[InvisibleSpace]", "13.75`", "\[InvisibleSpace]", "\<\"; G= \"\>", "\[InvisibleSpace]", "99.16666666666666`", "\[InvisibleSpace]", "\<\"; CPU=\"\>", "\[InvisibleSpace]", "0.`", "\[InvisibleSpace]", "\<\"; It = \"\>", "\[InvisibleSpace]", "3"}], SequenceForm[ "F= ", 13.75, "; G= ", 99.16666666666666, "; CPU=", 0., "; It = ", 3], Editable->False]], "Print", CellChangeTimes->{ 3.8271174214956503`*^9, 3.827118615381153*^9, {3.827118903687455*^9, 3.8271189120802937`*^9}, {3.8271189533643274`*^9, 3.8271189644574695`*^9}, 3.8288767792789173`*^9, 3.8288768888653307`*^9}, CellLabel-> "During evaluation of \ In[159]:=",ExpressionUUID->"9b93d47b-9fab-4a8c-90ce-46ff46b963c6"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"k-means reconstruction for selected centers z0: \"\>", "\[InvisibleSpace]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "7"}], "}"}]}], "}"}]}], SequenceForm[ "k-means reconstruction for selected centers z0: ", {{3, 3}, {2, 2}, {5, 7}}], Editable->False]], "Print", CellChangeTimes->{ 3.8271174214956503`*^9, 3.827118615381153*^9, {3.827118903687455*^9, 3.8271189120802937`*^9}, {3.8271189533643274`*^9, 3.8271189644574695`*^9}, 3.8288767792789173`*^9, 3.8288768888702908`*^9}, CellLabel-> "During evaluation of \ In[159]:=",ExpressionUUID->"c750fc91-d533-4f60-8870-794366f77b6a"], Cell[BoxData[ GraphicsBox[{{}, {InsetBox[ GraphicsBox[{{}, {{ {RGBColor[0.368417, 0.506779, 0.709798], PointSize[0.05], AbsoluteThickness[1.6], PointBox[{{1., 5.}, {2., 4.}, {3., 6.}, {2., 7.}, {2., 1.}, {3., 2.}, {4., 1.}, {3., 1.}, {6., 5.}, {8., 5.}, {7., 4.}, {7., 6.}}]}, {RGBColor[0.880722, 0.611041, 0.142051], PointSize[0.05], AbsoluteThickness[1.6], PointBox[{{3., 3.}, {2., 2.}, {5., 7.}}]}}, { {RGBColor[0.368417, 0.506779, 0.709798], PointSize[0.05], AbsoluteThickness[1.6]}, {RGBColor[0.880722, 0.611041, 0.142051], PointSize[0.05], AbsoluteThickness[1.6]}, {}, {}, {}}, { {RGBColor[0.368417, 0.506779, 0.709798], PointSize[0.05], AbsoluteThickness[1.6]}, {RGBColor[0.880722, 0.611041, 0.142051], PointSize[0.05], AbsoluteThickness[1.6]}, {}, {}, {}}}, {{}, {}}}, Axes->{True, True}, AxesLabel->{None, None}, AxesOrigin->{0, 0}, DisplayFunction->Identity, Frame->{{False, False}, {False, False}}, FrameLabel->{{None, None}, {None, None}}, FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}}, GridLines->{Automatic, Automatic}, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]], ImagePadding->{{1.867346938775512, 1.5000000000000568`}, { 10.557603686636014`, 0.4999999999999716}}, Method->{ "OptimizePlotMarkers" -> True, "CoordinatesToolOptions" -> {"DisplayFunction" -> ({ (Identity[#]& )[ Part[#, 1]], (Identity[#]& )[ Part[#, 2]]}& ), "CopiedValueFunction" -> ({ (Identity[#]& )[ Part[#, 1]], (Identity[#]& )[ Part[#, 2]]}& )}}, PlotRange->{{0, 8.}, {0, 7.}}, PlotRangeClipping->True, PlotRangePadding->{{ Scaled[0.02], Scaled[0.02]}, { Scaled[0.02], Scaled[0.05]}}, Ticks->{Automatic, Automatic}], {192., -165.375}, ImageScaled[{0.5, 0.5}], {360., 315.}], InsetBox[ GraphicsBox[{{{}, {{ {Hue[ NCache[ Rational[1, 5], 0.2], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6], PointBox[{{1., 5.}, {2., 4.}, {3., 6.}, {2., 7.}}]}, {Hue[ NCache[ Rational[2, 5], 0.4], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6], PointBox[{{2., 1.}, {3., 2.}, {4., 1.}, {3., 1.}}]}, {Hue[ NCache[ Rational[3, 5], 0.6], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6], PointBox[{{6., 5.}, {8., 5.}, {7., 4.}, {7., 6.}}]}}, { {Hue[ NCache[ Rational[1, 5], 0.2], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6]}, {Hue[ NCache[ Rational[2, 5], 0.4], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6]}, {Hue[ NCache[ Rational[3, 5], 0.6], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6]}, {}, {}, {}, {}, {}, {}, {}}, { {Hue[ NCache[ Rational[1, 5], 0.2], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6]}, {Hue[ NCache[ Rational[2, 5], 0.4], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6]}, {Hue[ NCache[ Rational[3, 5], 0.6], 1, 1], PointSize[0.05], AbsoluteThickness[ 1.6]}, {}, {}, {}, {}, {}, {}, {}}}, {{}, {}}}, {{}, { {GrayLevel[0.5], PointSize[0.025], AbsoluteThickness[1.6], Opacity[ 0.7], GeometricTransformationBox[InsetBox[ StyleBox["\<\"\[SixPointedStar]\"\>", StripOnInput->False, FontSize->20], {0., 0.}], {{{2., 5.5}}, {{3., 1.25}}, {{7., 5.}}}]}, { {GrayLevel[0.5], PointSize[0.025], AbsoluteThickness[1.6], Opacity[ 0.7]}, {}}, { {GrayLevel[0.5], PointSize[0.025], AbsoluteThickness[1.6], Opacity[ 0.7]}, {}}}, {{}, {}}}}, AspectRatio->Automatic, Axes->{True, True}, AxesLabel->{None, None}, AxesOrigin->{0, 0}, DisplayFunction->Identity, Frame->{{False, False}, {False, False}}, FrameLabel->{{None, None}, {None, None}}, FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}}, GridLines->{None, None}, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]], ImagePadding->{{1.867346938775512, 1.5000000000000568`}, { 10.557603686636014`, 0.4999999999999716}}, Method->{ "OptimizePlotMarkers" -> True, "CoordinatesToolOptions" -> {"DisplayFunction" -> ({ (Identity[#]& )[ Part[#, 1]], (Identity[#]& )[ Part[#, 2]]}& ), "CopiedValueFunction" -> ({ (Identity[#]& )[ Part[#, 1]], (Identity[#]& )[ Part[#, 2]]}& )}}, PlotRange->{{0, 8.}, {0, 7.}}, PlotRangeClipping->True, PlotRangePadding->{{ Scaled[0.02], Scaled[0.02]}, { Scaled[0.02], Scaled[0.05]}}, Ticks->{Automatic, Automatic}], {576., -165.375}, ImageScaled[{0.5, 0.5}], {360., 315.}]}, {}}, ContentSelectable->True, ImageSize->Medium, PlotRangePadding->{6, 5}]], "Print", CellChangeTimes->{ 3.8271174214956503`*^9, 3.827118615381153*^9, {3.827118903687455*^9, 3.8271189120802937`*^9}, {3.8271189533643274`*^9, 3.8271189644574695`*^9}, 3.8288767792789173`*^9, 3.8288768892332783`*^9}, CellLabel-> "During evaluation of \ In[159]:=",ExpressionUUID->"bdc9a652-1694-46fd-a2cb-bdde114a791a"] }, Open ]] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{754, 778}, WindowMargins->{{-765, Automatic}, {Automatic, 1}}, TaggingRules->{"SlideshowSettings" -> {"Toolbar" -> True}}, FrontEndVersion->"12.0 for Microsoft Windows (64-bit) (April 8, 2019)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 5070, 68, 53, "Subsection",ExpressionUUID->"0c7c2b10-4042-417d-ac6f-29889d5fff8e"], Cell[5653, 92, 8296, 210, 694, "Input",ExpressionUUID->"9ffbb91a-afb1-46f9-8fb7-c143ccc22570"], Cell[CellGroupData[{ Cell[13974, 306, 162, 3, 44, "Subsubsection",ExpressionUUID->"87da2658-1dd3-42f2-ba82-c4fe943713af"], Cell[CellGroupData[{ Cell[14161, 313, 5548, 157, 314, "Input",ExpressionUUID->"231b6d6d-f122-441d-943f-3def75a49a75"], Cell[CellGroupData[{ Cell[19734, 474, 771, 16, 22, "Print",ExpressionUUID->"9b93d47b-9fab-4a8c-90ce-46ff46b963c6"], Cell[20508, 492, 813, 22, 22, "Print",ExpressionUUID->"c750fc91-d533-4f60-8870-794366f77b6a"], Cell[21324, 516, 5705, 138, 173, "Print",ExpressionUUID->"bdc9a652-1694-46fd-a2cb-bdde114a791a"] }, Open ]] }, Open ]] }, Open ]] }, Open ]] } ] *)