diff --git a/labs/lab3-k-means/README.md b/labs/lab3-k-means/README.md new file mode 100755 index 0000000000000000000000000000000000000000..0bf5dba903c77b8711cc5ab65fae12c7348c6b7e --- /dev/null +++ b/labs/lab3-k-means/README.md @@ -0,0 +1,265 @@ +# K-Means + +Use the following commands to make a fresh clone of your repository: + +``` +git clone -b kmeans git@gitlab.epfl.ch:lamp/student-repositories-s21/cs206-GASPAR.git cs206-kmeans +``` + +## Useful links + + * [A guide to the Scala parallel collections](https://docs.scala-lang.org/overviews/parallel-collections/overview.html) + * [The API documentation of the Scala parallel collections](https://www.javadoc.io/doc/org.scala-lang.modules/scala-parallel-collections_2.13/latest/scala/collection/index.html) + * [The API documentation of the Scala standard library](https://www.scala-lang.org/files/archive/api/2.13.4) + * [The API documentation of the Java standard library](https://docs.oracle.com/en/java/javase/15/docs/api/index.html) + +**If you have issues with the IDE, try [reimporting the +build](https://gitlab.epfl.ch/lamp/cs206/-/blob/master/labs/example-lab.md#ide-features-like-type-on-hover-or-go-to-definition-do-not-work), +if you still have problems, use `compile` in sbt instead.** + +## Introduction + +In this assignment, you will implement the K-means algorithm for cluster +detection, which is used to partition *n* vectors into *k* clusters. +Here, vectors are separated into clusters based on their mutual similarity -- +vectors that are closer to each other in space are more likely to end up in the +same cluster, and the distant vectors are likely to be in different clusters. +K-means has many applications: it is used in data mining, image filtering and +signal processing. + +Here is a simple example -- let's say that we have a set of vectors in 2D space, +as shown in the following figure: + + + +As a human, you can visually distinguish the three clusters of points in the +image: + + + +When the number of clusters, dimensions and vectors grows, it becomes difficult +and even impossible to manually determine the clusters. +K-means is a simple algorithm that takes a set of vectors (called *points*) and +outputs as set of clusters as follows: + +1. Pick `k` points called *means*. This is called *initialization*. +2. Associate each input point with the *mean* that is closest to it. + We obtain `k` *clusters* of points, and we refer to this process as + *classifying* the points. +3. Update each mean to have the average value of the corresponding cluster. +4. If the `k` means have significantly changed, go back to step 2. + If they did not, we say that the algorithm *converged*. +5. The `k` means represent different clusters -- every point is in the cluster + corresponding to the closest mean. + +Above, two steps need additional discussion. +First, how do we pick the initial `k` means? +The initialization step can be done in many different ways -- we will just +randomly pick some of the input vectors. +Second, how do we know that the algorithm converged? +We will check that, for each mean, the square distance between the old value of +the mean and the new value of the mean is less than or equal to some value +`eta`. + +For a better illustration, here are a few steps of the K-means algorithm. +Initially, we pick a random set of means, shown with "X" in the figure: + + + +Then, we classify the points according to the closest mean ("X"). +The means divide the space into regions, where each point is closer to the +corresponding mean than any other mean -- in the figure, the dotted line depicts +the borders of different regions: + + + +All the points in the same region form one cluster. After having classified the +points, we can update the mean values to the average of all the points in the +cluster: + + + +Each of the means was significantly updated. +This is a good indication that the algorithm did not yet converge, +so we repeat the steps again -- we first classify all the points: + + + +And then we update the means again: + + + +One of the means did not change at all in the last step. +Still, other means have changed so we continue this process until the change +in the position of each point drops below the `eta` value. + +At each iteration of K-means, we can associate multiple points to clusters, +and compute the average of the `k` clusters, in parallel. +Note that the association of a point to its cluster is independent of the +other points in the input, and similarly, the computation of the average of a cluster +is independent of the other clusters. +Once all parallel tasks of the current iteration complete, +the algorithm can proceed to the next iteration. + +K-means is an example of a *bulk synchronous parallel* algorithm (BSP). +BSP algorithms are composed from a sequence of supersteps, each of which +contains: + +- *parallel computation*, in which processes independently perform local + computations and produce some values +- *communication*, in which processes exchange data +- *barrier synchronisation*, during which processes wait until every process + finishes + +Data-parallel programming models are typically a good fit for BSP algorithms, +as each bulk synchronous phase can correspond to some number of data-parallel +operations. + + +## Classifying the points + +In the first part of this assignment, you will classify the input points +according to the square distance to the means. +Input points are described with the following `Point` data-type: + + class Point(val x: Double, val y: Double, val z: Double) + +You will start by implementing the `classify` method: + + def classify(points: ParSeq[Point], means: ParSeq[Point]): ParMap[Point, ParSeq[Point]] + +This method take a sequence of points and a sequence of means, and return +a map collection, which maps each mean to the sequence of points in the corresponding +cluster. + +Hint: Use `groupBy` and the `findClosest` method, which is already defined for +you. After that, make sure that all the means are in the resulting map, even if their +sequences are empty. + + +## Updating the means + +In the second part of this assignment, you will update the means corresponding +to different clusters. + +Implement the method `update`, which takes the map of classified points produced +in the previous step, and the sequence of previous means. +The method returns the new sequence of means: + + def update(classified: ParMap[Point, ParSeq[Point]], oldMeans: ParSeq[Point]): ParSeq[Point] + +Take care to preserve order in the resulting sequence -- the mean `i` in +the resulting sequence must correspond to the mean `i` from `oldMeans`. + +Hint: Make sure you use the `findAverage` method that is predefined for you. + + +## Detecting convergence + +Finally, you will implement convergence detection. +The convergence detection method takes a sequence of old +means and the sequence of updated means, and returns a boolean indicating if the +algorithm converged or not. +Given an `eta` parameter, `oldMeans` and `newMeans`, it returns `true` if the +algorithm converged, and `false` otherwise: + + def converged(eta: Double, oldMeans: ParSeq[Point], newMeans: ParSeq[Point]) + +The algorithm converged iff the square distance between the old and the new mean is less +than or equal to `eta`, for all means. + +Note: the means in the two lists are ordered -- the mean at `i` in `oldMeans` +is the previous value of the mean at `i` in `newMeans`. + +Implement `converged`! + + +## Running the algorithm + +We now have everything we need to run the K-means algorithm. +We only need to combine the previously defined methods in the right way. + +The tail-recursive `kMeans` method takes a sequence of +points `points`, previously computed sequence of means `means`, and the `eta` +value: + + @tailrec final def kMeans(points: ParSeq[Point], + means: ParSeq[Point], eta: Double): ParSeq[Point] + +The `kMeans` method should return the sequence of means, +each corresponding to a specific cluster. + +Hint: `kMeans` implements the steps 2-4 from the K-means pseudocode. + +You can use the following command from within `sbt` to benchmark your code, the +parallel time shoul be significantly faster than the sequential time if your +computer has more than one core: + + > runMain kmeans.KMeansRunner + + +## Use cases + +And now for the fun part -- the K-means algorithm has a lot of use-cases! + +In image processing applications, it can be used to reduce the size of the +color palette, thus compressing the image. This is done by turning a +[true color image](http://en.wikipedia.org/wiki/Color_depth), where each pixel +is encoded into 32 bits, into [indexed color](http://en.wikipedia.org/wiki/Indexed_color), +where each pixel can be encoded with just a few bits. This is done by using k-means to +"cluster" the important colors in the image, thus reducing its palette from +24-bit (`2^24` colors) to just 32 indexed colors, chosen from the 24-bit palette. +Here, pixels from the image are the input vectors, +and their coordinates are the different color channels. + +This is the original true color (24-bit) image: + + + +And this is the indexed color (32 colors) version of it: + + + +So, thanks to your k-means implementation, ScalaShop can now compress images! +You can start ScalaShop by invoking from `sbt`: + + > runMain kmeans.fun.ScalaShop + +The k-means algorithm is very sensitive to the initial choice of means. There +are three choice strategies implemented in ScalaShop: + +* `Uniform Choice` is the simplest strategy. It chooses `n` colors uniformly in +the entire color space, regardless of the colors used in the image. If the image +has a dominant color, the means created by this strategy will likely be very far +away from the clusters formed by this dominant color. You can try setting the +`Uniform Choice` strategy with 1, 10 and 30 steps. You will notice the initial +choice is quite bad, but the quality improves as the k-means algorithm is applied +in more steps. +* `Random Sampling` is another simple strategy, but with better results. For the +initial means, it randomly samples `n` colors from the image. This yields good +results if the image has few dominant colors, but it cannot handle subtle nuances +in the image. Again, if you try this strategy with 1, 10 and 30 k-means iteration +steps, you will notice improvements as the k-means algorithm is ran more. +* `Uniform Random` is the most complex strategy to pick means, but it also produces +the best results. It works by uniformly splitting the color space in sub-spaces. +It then counts the number of pixels that have colors belonging to that sub-space. +Based on this number, it chooses a proportional number of means in the sub-space, +by randomly sampling from the pixels in that sub-space. Therefore, if your image +has dominant colors, this strategy will drop a proportional number of means for +each dominant color, thus allowing the k-means algorithm to capture fine nuances. + +In the EPFL image now available in ScalaShop, the mountains are a good way to see +how well each initial choice of means fares. You also have different strategies +for deciding convergence: + +* `Steps` allows to run a fixed number of steps. After this, the k-means algorithm +is stopped. +* `Eta` corresponds to the means stability, as we showed earlier: if the +means did not move much since the last iteration, the result is considered stable. +* `Sound-to-noise` ratio is a more refined convergence strategy, which does not settle +for stability but tries to minimize the difference between the true color image +and the index color one. This strategy goes beyond `Eta`, but high Sound-to-noise +ratios will prevent the k-means algorithm from finishing! + +With this in mind, enjoy ScalaShop, the ultimate image manipulation tool and +the nice, warm, sunny photo of EPFL! diff --git a/labs/lab3-k-means/clusters.png b/labs/lab3-k-means/clusters.png new file mode 100755 index 0000000000000000000000000000000000000000..1f3bdf3729d54356d8040e2d1e561da35c980ece Binary files /dev/null and b/labs/lab3-k-means/clusters.png differ diff --git a/labs/lab3-k-means/clusters.svg b/labs/lab3-k-means/clusters.svg new file mode 100755 index 0000000000000000000000000000000000000000..c615e29752918ff7d747daa4706fb5f9a7e5ec8b --- /dev/null +++ b/labs/lab3-k-means/clusters.svg @@ -0,0 +1,290 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="clusters.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient7516"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7518" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop7520" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7522" + cx="208.57138" + cy="248.07649" + fx="208.57138" + fy="248.07649" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(19.192898,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7524" + cx="204.28568" + cy="378.07651" + fx="204.28568" + fy="378.07651" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-16.162441,-5.0507627)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7526" + cx="171.42856" + cy="326.64792" + fx="171.42856" + fy="326.64792" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(67.680221,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7528" + cx="128.57144" + cy="382.36221" + fx="128.57144" + fy="382.36221" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(173.74624,-79.802054)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7530" + cx="98.571434" + cy="316.64792" + fx="98.571434" + fy="316.64792" + r="11.25" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:url(#radialGradient7530);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7528);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:url(#radialGradient7526);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7524);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:url(#radialGradient7522);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <ellipse + style="fill:none;fill-opacity:0.29677417;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:7.5,2.5;stroke-dashoffset:0;stroke-opacity:1" + id="path7554" + cx="210.61681" + cy="311.41531" + rx="177.28177" + ry="122.73354" /> + <ellipse + ry="122.91036" + rx="130.4865" + cy="191.20717" + cx="534.37073" + id="ellipse7556" + style="fill:none;fill-opacity:0.29677417;stroke:#000000;stroke-width:2.14636397;stroke-miterlimit:4;stroke-dasharray:6.43909181, 2.14636394;stroke-dashoffset:0;stroke-opacity:1" /> + <ellipse + style="fill:none;fill-opacity:0.29677417;stroke:#000000;stroke-width:1.89697337;stroke-miterlimit:4;stroke-dasharray:5.69092025, 1.89697342;stroke-dashoffset:0;stroke-opacity:1" + id="ellipse7558" + cx="520.73364" + cy="473.03973" + rx="101.82184" + ry="123.03506" /> + </g> +</svg> diff --git a/labs/lab3-k-means/points.png b/labs/lab3-k-means/points.png new file mode 100755 index 0000000000000000000000000000000000000000..5584dba6d2bae31eb6e5627089acaed405fbf130 Binary files /dev/null and b/labs/lab3-k-means/points.png differ diff --git a/labs/lab3-k-means/points.svg b/labs/lab3-k-means/points.svg new file mode 100755 index 0000000000000000000000000000000000000000..f9ae8e6c80581c5c5055979e9e0af77531036843 --- /dev/null +++ b/labs/lab3-k-means/points.svg @@ -0,0 +1,270 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\points.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="points.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient7516"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7518" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop7520" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7522" + cx="208.57138" + cy="248.07649" + fx="208.57138" + fy="248.07649" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(19.192898,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7524" + cx="204.28568" + cy="378.07651" + fx="204.28568" + fy="378.07651" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-16.162441,-5.0507627)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7526" + cx="171.42856" + cy="326.64792" + fx="171.42856" + fy="326.64792" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(67.680221,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7528" + cx="128.57144" + cy="382.36221" + fx="128.57144" + fy="382.36221" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(173.74624,-79.802054)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7530" + cx="98.571434" + cy="316.64792" + fx="98.571434" + fy="316.64792" + r="11.25" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:url(#radialGradient7530);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7528);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:url(#radialGradient7526);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7524);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:url(#radialGradient7522);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + </g> +</svg> diff --git a/labs/lab3-k-means/start.png b/labs/lab3-k-means/start.png new file mode 100644 index 0000000000000000000000000000000000000000..2201ffd533d0848deb569862a90a871d9e9f6d8c Binary files /dev/null and b/labs/lab3-k-means/start.png differ diff --git a/labs/lab3-k-means/step0.png b/labs/lab3-k-means/step0.png new file mode 100755 index 0000000000000000000000000000000000000000..97668674d5d95b560abcd018225499e141747edc Binary files /dev/null and b/labs/lab3-k-means/step0.png differ diff --git a/labs/lab3-k-means/step0.svg b/labs/lab3-k-means/step0.svg new file mode 100755 index 0000000000000000000000000000000000000000..c73a7130473f6498f7405a223fcce1edd3995891 --- /dev/null +++ b/labs/lab3-k-means/step0.svg @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step0.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875067px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="196.82574" + y="608.31287" + id="text7568" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7570" + x="196.82574" + y="608.31287">X</tspan></text> + <text + transform="scale(1.1239557,0.8897148)" + sodipodi:linespacing="125%" + id="text7572" + y="424.38351" + x="521.27362" + style="font-style:normal;font-weight:bold;font-size:35.58875047px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + xml:space="preserve"><tspan + y="424.38351" + x="521.27362" + id="tspan7574" + sodipodi:role="line">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875084px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="321.75165" + y="257.48459" + id="text7576" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7578" + x="321.75165" + y="257.48459">X</tspan></text> + </g> +</svg> diff --git a/labs/lab3-k-means/step1.png b/labs/lab3-k-means/step1.png new file mode 100755 index 0000000000000000000000000000000000000000..8ce72d8c0c36d2aa84a222e570cdd9582f4dfc8a Binary files /dev/null and b/labs/lab3-k-means/step1.png differ diff --git a/labs/lab3-k-means/step1.svg b/labs/lab3-k-means/step1.svg new file mode 100755 index 0000000000000000000000000000000000000000..e210b991b67e1f4a226ff3769bd30339de18b0b7 --- /dev/null +++ b/labs/lab3-k-means/step1.svg @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step1.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875067px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="196.82574" + y="608.31287" + id="text7568" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7570" + x="196.82574" + y="608.31287">X</tspan></text> + <text + transform="scale(1.1239557,0.8897148)" + sodipodi:linespacing="125%" + id="text7572" + y="424.38351" + x="521.27362" + style="font-style:normal;font-weight:bold;font-size:35.58875047px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + xml:space="preserve"><tspan + y="424.38351" + x="521.27362" + id="tspan7574" + sodipodi:role="line">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875084px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="321.75165" + y="257.48459" + id="text7576" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7578" + x="321.75165" + y="257.48459">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 29.294424,236.15895 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88842,387.68183 535.38085,689.71744" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88843,389.70213 622.25396,144.23507" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + </g> +</svg> diff --git a/labs/lab3-k-means/step2.png b/labs/lab3-k-means/step2.png new file mode 100755 index 0000000000000000000000000000000000000000..6cdc2c8e9732a38680b5642ac817b8539815b06f Binary files /dev/null and b/labs/lab3-k-means/step2.png differ diff --git a/labs/lab3-k-means/step2.svg b/labs/lab3-k-means/step2.svg new file mode 100755 index 0000000000000000000000000000000000000000..db6e99dac1722683bc4c5f76439fbbdbe8088027 --- /dev/null +++ b/labs/lab3-k-means/step2.svg @@ -0,0 +1,408 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step2.svg"> + <defs + id="defs4"> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker10709" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path10711" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker9251" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path9253" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4153" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4165" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker8251" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path8253" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient8215"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop8217" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop8219" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend" + inkscape:collect="always"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8215" + id="linearGradient8221" + x1="119.05175" + y1="385.33261" + x2="145.39577" + y2="385.33261" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.67277217" + inkscape:cx="372.04724" + inkscape:cy="526.1811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875067px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="196.82574" + y="608.31287" + id="text7568" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7570" + x="196.82574" + y="608.31287">X</tspan></text> + <text + transform="scale(1.1239557,0.8897148)" + sodipodi:linespacing="125%" + id="text7572" + y="424.38351" + x="521.27362" + style="font-style:normal;font-weight:bold;font-size:35.58875047px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + xml:space="preserve"><tspan + y="424.38351" + x="521.27362" + id="tspan7574" + sodipodi:role="line">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875084px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="321.75165" + y="257.48459" + id="text7576" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7578" + x="321.75165" + y="257.48459">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 29.294424,236.15895 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88842,387.68183 535.38085,689.71744" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88843,389.70213 622.25396,144.23507" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8211" + y="385.78098" + x="145.59712" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="385.78098" + x="145.59712" + id="tspan8213" + sodipodi:role="line" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="363.9928" + y="221.1528" + id="text8235" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1" + sodipodi:role="line" + id="tspan8237" + x="363.9928" + y="221.1528">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8239" + y="556.086" + x="465.5513" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="556.086" + x="465.5513" + id="tspan8241" + sodipodi:role="line" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:12, 6;stroke-opacity:1;marker-end:url(#Arrow1Mend);stroke-dashoffset:0" + d="M 188.36461,528.28085 C 127.91334,484.20672 112.42805,448.37274 158.00235,365.76166" + id="path8243" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path9249" + d="M 377.1358,198.30287 C 333.03479,124.501 411.1919,113.9356 415.14736,162.1266" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:12, 6;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker9251)" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path10707" + d="m 617.93054,393.01961 c 22.78642,45.10911 13.24668,80.62172 -58.60362,88.68026" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:12, 6;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker10709)" /> + </g> +</svg> diff --git a/labs/lab3-k-means/step3.png b/labs/lab3-k-means/step3.png new file mode 100755 index 0000000000000000000000000000000000000000..a0f1e2f4e887a1b4aa6b7d785bdfa7334171de4e Binary files /dev/null and b/labs/lab3-k-means/step3.png differ diff --git a/labs/lab3-k-means/step3.svg b/labs/lab3-k-means/step3.svg new file mode 100755 index 0000000000000000000000000000000000000000..b4a9fec9e230fa8cf73bc23b12e26d9b9541465b --- /dev/null +++ b/labs/lab3-k-means/step3.svg @@ -0,0 +1,353 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\step3.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step3.svg"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4153" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker10709" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path10711" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker9251" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path9253" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4165" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker8251" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path8253" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient8215"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop8217" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop8219" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend" + inkscape:collect="always"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8215" + id="linearGradient8221" + x1="119.05175" + y1="385.33261" + x2="145.39577" + y2="385.33261" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.67277217" + inkscape:cx="372.04724" + inkscape:cy="526.1811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 189.82425,65.224411 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="m 386.88842,387.68183 -171.08084,349.6" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 386.88843,389.70213 736.70578,221.52721" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8211" + y="385.78098" + x="145.59712" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="385.78098" + x="145.59712" + id="tspan8213" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + x="363.9928" + y="221.1528" + id="text8235" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;" + sodipodi:role="line" + id="tspan8237" + x="363.9928" + y="221.1528">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8239" + y="556.086" + x="465.5513" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="556.086" + x="465.5513" + id="tspan8241" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + </g> +</svg> diff --git a/labs/lab3-k-means/step4.png b/labs/lab3-k-means/step4.png new file mode 100755 index 0000000000000000000000000000000000000000..2eafaa4e26f7c97028692716d9474ab3a8ab2482 Binary files /dev/null and b/labs/lab3-k-means/step4.png differ diff --git a/labs/lab3-k-means/step4.svg b/labs/lab3-k-means/step4.svg new file mode 100755 index 0000000000000000000000000000000000000000..ad37ce85883bf092146048dcfe45c430968e4afd --- /dev/null +++ b/labs/lab3-k-means/step4.svg @@ -0,0 +1,441 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\step4.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step4.svg"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker12915" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path12917" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker12465" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend" + inkscape:collect="always"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path12467" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker11619" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path11621" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4153" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker10709" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path10711" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker9251" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path9253" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4165" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker8251" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path8253" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient8215"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop8217" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop8219" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend" + inkscape:collect="always"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8215" + id="linearGradient8221" + x1="119.05175" + y1="385.33261" + x2="145.39577" + y2="385.33261" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.67277217" + inkscape:cx="372.04724" + inkscape:cy="526.1811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 189.82425,65.224411 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="m 386.88842,387.68183 -171.08084,349.6" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 386.88843,389.70213 736.70578,221.52721" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8211" + y="385.78098" + x="145.59712" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="385.78098" + x="145.59712" + id="tspan8213" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + x="363.9928" + y="221.1528" + id="text8235" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;" + sodipodi:role="line" + id="tspan8237" + x="363.9928" + y="221.1528">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8239" + y="556.086" + x="465.5513" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="556.086" + x="465.5513" + id="tspan8241" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + x="182.62602" + y="355.70956" + id="text11603" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1;" + sodipodi:role="line" + id="tspan11605" + x="182.62602" + y="355.70956">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text11607" + y="240.43587" + x="449.76309" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="240.43587" + x="449.76309" + id="tspan11609" + sodipodi:role="line" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 9;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker11619)" + d="M 164.98899,315.1141 C 138.7091,262.04866 179.31776,214.18838 206.60783,282.41357" + id="path11617" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path12463" + d="m 434.02509,162.0162 c 16.82534,-48.60627 60.40678,-45.92938 87.69685,22.2958" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 9;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker12465)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 9;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker12915)" + d="m 558.88163,474.15753 c 52.49863,-20.36492 73.78426,46.22663 -1.48639,19.32302" + id="path12913" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + </g> +</svg> diff --git a/labs/lab3-k-means/uniform-random-30steps.png b/labs/lab3-k-means/uniform-random-30steps.png new file mode 100644 index 0000000000000000000000000000000000000000..3ab1db8db80df4174f75cdd51c0385bce3370dad Binary files /dev/null and b/labs/lab3-k-means/uniform-random-30steps.png differ