<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 12, 2016 at 11:38 PM, James Aylett <span dir="ltr"><<a href="mailto:james-xapian@tartarus.org" target="_blank">james-xapian@tartarus.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Sat, Mar 12, 2016 at 04:27:55PM +0530, Richhiey Thomas wrote:<br><br>
</span>Hi, Richhiey. Thanks for putting this together ahead of the formal<br>
start of applications, and sharing it with us -- and it's really not<br>
too long! Project proposals for something that will last the summer<br>
are naturally going to be long and get into a lot of detail, so don't<br>
shy away from that.<br>
<span class=""><br></span></blockquote><div>Thanks for the quick reply James! </div><div>I'll try to answer all your questions in the best way possible by me and send across a better version of this proposal as soon as possible, fitting the Xapian GSOC application template properly (As you mentioned about the project motivation part) :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'd like to ask a few questions about the paper, which hopefully you<br>
can answer, because I'm a little confused by it in places.<br>
<br>
For instance, in equation (3) it looks to me like a measure with two<br>
free variables (i and j) is being defined in terms of two free<br>
variables (j and m) and one bound one (i). Is the summation actually<br>
supposed to be over m? (Then within the summation x_i is a dw<br>
dimensional vector, as is c_j, ie they're both feature vectors, one<br>
representing a single item and one representing a cluster centroid.)<br>
<br>
I may be misreading something fundamentally here, because aspects of<br>
the combined algorithm just don't make sense to me. It doesn't help my<br>
understanding that the paper seems to use overlapping references for<br>
the particle positions and clusters (eg in (3), (4) and I think (5)),<br>
and the cluster centres that are being used as particle data (at the<br>
bottom of p207). I think rewriting it with different variables might<br>
make this a lot clearer. (That may be the main source of my confusion,<br>
in fact!)<br></blockquote><div>The way the paper has been written I guess is the main source of your confusion. Let me provide a paper that explains this same concept in a way that is easier to understand. I was confused by eq (3) that you mentioned too. Here it is :</div><div><a href="http://www.sau.ac.in/~vivek/softcomp/clustering%20PSO+K-means.pdf">http://www.sau.ac.in/~vivek/softcomp/clustering%20PSO+K-means.pdf</a></div><div>The whole point of this approach is to use global search of PSO and fast convergence of K-means together.</div><div>So we take every particle and assign it k randomly initialized cluster centroids. Hence, every particle can be seen as X={C1,C2,..,CK}. Now for each particle, in every iteration we have to calculate a fitness value for which we use the equation that you mentioned above that tricked you :)</div><div>For every particle, we consider the cluster centroids that we have assigned to that particle and assign all other documents to the closest of these cluster centroids. Through this, we can obtain a fitness value which is calculated by finding the summation of distance between all the documents and all cluster centroids and taking its reciprocal or making some other fitness function that we can define to suit or needs better. Using this fitness function, the next location can be found for the particle.</div><div>The combined algorithm uses overlapping references such as cluster centroids as particle data because we are using PSO to optimize this. Every particle can be thought of as a candidate solution for the initial centroids and PSO, being a method used to optimize the candidate solutions iteratively by moving particles around the search space, helps in finding a good initial centroid configuration. By the end of the maximum number of iterations, we arrive at either a sub-optimal or optimal solution of initial centroids which can then be fed as seed to the K-means algorithm to provide better clustering results.</div><div>I don't know whether I have adequately answered your questions so you can fire me if I've gone wrong or not been clear anywhere!</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
As I understand it, though, there are still some parameters to this<br>
algorithm: the maximum iterations, the inertia weight and two<br>
'gravity' constants for the velocity calculation in (1), and K. Is<br>
that correct? Is there anything we can do to predict a useful value<br>
for any of them? </blockquote><div>I dont know of any ways to predict an optimum value for any of these parameters though I'm sure there will be some mathematical way to do so. But I think since we know how each of these parameters would affect the clustering, we can find the correct values that work well when we test this algorithm against the kinds of datasets this algorithm will deal with later on. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You mean that you're using the term lists of each document to generate<br>
the particle's position vector in a term-based feature space? (The<br>
initial centroids for K means and the particle cluster centers are all<br>
randomly initialised, correct?)<br>
(That's what I'm expecting, I just want to be sure I'm understanding<br>
both the paper and what you've written well enough!)</blockquote><div>Yes thats exactly what I meant!</div><div>  Project Timeline:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
> April 22 - May 22 (Before coding period starts) : Finish any more research<br>
> required by talking to the mentors and any other resources. Have a clear<br>
> idea of how to go about the project before the coding period<br>
<br>
</span>It would be good to identify if there is specific work required during<br>
this period. What further research do you think is required? Is there<br>
anything else you need beyond the cited paper in order to implement<br>
their algorithm?</blockquote><div>During this period, the essential goal would be to finalize the particulars that we will need in the project, For example, finalizing the fitness measure that will be used for PSO, deciding values for the parameters that we need for the mixed algorithm or finding a way to predict the optimum value of each of those parameters if possible, and any other detail that may be of concern before starting to implement the project </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
> May 23 - June 6 (Official coding period starts now) :<br>
> Define all the classes and functions that will be necessary for the<br>
> implementation of the project<br>
<br>
</span>Why is this going to take two weeks? It sounds from your discussion as<br>
if you have a good grasp of how to map this into classes<br>
already. Remember that we really recommend having timeline sections<br>
of no more than a week. The more you force yourself to break it down,<br>
the more planning you have to do up front, which generally results in<br>
a smoother project!<br></blockquote><div>Actually James, the problem is I will be having my university exams in this period and hence, the amount of time I will be able to devote to the project will be kind of restricted during these two weeks. That's the only reason I let this part go slow. It still shouldn't take that much time, but just incase it does, the project wont lag behind. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> June 7 - June 20 :<br>
> Implement and test the first phase which is a part dealing with the PSO<br>
> algorithm<br>
<br>
</span>Is there a way you can break this into smaller pieces? For instance,<br>
are there datasets for PSO out there which you could use to build test<br>
cases, ahead of implementing the algorithm itself? If not, you'll have<br>
to generate your own, calculating the outcome for some data sets by<br>
some other method. (You should be able to use a different<br>
implementation to calculate the test data, because most<br>
implementations won't have license conditions which restrict the<br>
subsequent distribution of output of the implementation.)<br>
<br>
With step 6 of the algorithm, it looks to me like the K-means part<br>
that is interwoven with PSO can affect the PSO part, by modifying<br>
pgd. Does it make sense to tackle things in this way (PSO then<br>
K-means), or would it make more sense to break it down as steps of the<br>
algorithm, with each calculation tested separately? (It's probably<br>
easier to write the tests that way.)<br>
<span class=""><br></span></blockquote><div>I think the way you suggested is a much better way to look at things because the two algorithms are tightly coupled and cannot be implemented independently and tested the way I thought about it.</div><div>To break things down further, we can look at things like this</div><div>June 7-June 10</div><div>Create a class to represent particles and write code to initialize each particle in the dataset with cluster-centroids</div><div>June 11 - June 16:</div><div>Implement code to find the fitness value for each particle and finding the new location of the particle.</div><div>June 17-June 20:</div><div>Test the code against any dataset which contains documents so that we can see how the code will be finding the initial centroids and so that we can tweak the initial parameters to get good performance.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
> June 21 - June 27 :<br>
> Making further changes to the code to improve functionality, exception<br>
> handling and bug removal<br>
<br>
</span>Exception handling is really something you should do as you go<br>
along. I'm also not clear what 'improve functionality' means in this<br>
context. Are you concerned that the previous two weeks won't be enough<br>
time to complete the PSO algorithm? If so, you definitely want to<br>
break it down into smaller pieces; three weeks is generally too long<br>
for a single stretch of work (because it's difficult to tell two weeks<br>
in if it's going well or not).<br></blockquote><div>Improve functionality was just meant to say that incase there were portions that werent implemented completely during the above phase, it can be completed now. If not, this period can be completely devoted to writing test cases, or taking care of exception handling and bug removal, to make sure the code written is in good shape,</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> June 28 - July 10 :<br>
> Implement and test the second phase which deals with the K-means being<br>
> actually used for clustering.<br>
<br>
</span>Again, hopefully you can break this down further.<br></blockquote><div>Similar to what I did above, we will just go ahead with implementing the second phase of the algorithm which now includes incorporating the K-means algorithm with the seed cluster centroids.</div><div>June 28 - July 4:</div><div>Using cluster centroid vectors from PSO and implement assigning documents to the closest centroids.</div><div><br></div><div>July 4 - July 12:</div><div>Reassigning cluster centroids and finishing up whatever is left in the complete implementation of the algorithtm </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> July 11 - July 18:<br>
> Making further changes to the code to improve functionality, exception<br>
> handling and bug removal<br>
<br>
</span>And again, breaking down the previous block should mean you don't need<br>
a 'catch up' period. Don't worry if your estimates go up when you<br>
break something down further (so something that you thought would take<br>
about two weeks, when broken into smaller pieces, might look like<br>
three or even four weeks).<br></blockquote><div>I think this period will be essential for writing some test cases, concentrating on making sure no bugs creep in and on keeping the code indented and clean and exception free. Also, incase of a delay, this could be time to level up. By this time, the implementation of the project should be complete. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> July 17 - July 28 :<br>
> Implement or use a concrete measure to test the performance of the newly<br>
> implemented clustering algorithm against the previously implemented one in<br>
> terms of speed and accuracy<br>
<br>
</span>Do you have an idea of what measure to use for accuracy? The paper you<br>
cited uses between and within cluster measures, but there may be other<br>
techniques. (Also, I don't know if you have access to any<br>
pre-clustered test data, which would allow you to calculate a<br>
precision rate.)<br>
<br>
It's also going to be important to carefully choose the test data you<br>
use for this. Is there anything in the TREC collections that would be<br>
suitable?<br></blockquote><div>The new paper that I have referred to uses TREC-5, TREC-6, TREC-7 and so these datasets can be used. Using entropy and within cluster frequency i feel would be good indicators of the quality of clustering that we have got</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> July 28 - August 1:<br>
> Find out drawbacks that may come out while testing the proposed solution<br>
> and tackle it during this time by changing some parts of the code that may<br>
> increase speed or efficiency.<br>
<br>
</span>It's good to have a period to incorporate learning from the evaluation<br>
phase. Is a week enough? (This would be one area where I might<br>
consider having a longer period, and to be prepared to plan that while<br>
or just after conducting the evaluation, based on what you learn.)<br>
<span class=""><br>
> August 2 - August 16:<br>
> Cleaning the written code, improving the documentation or writing<br>
> documentation afresh, identifying any bugs that may come out and writing<br>
> test before the final submissions<br>
<br>
</span>GSoC has a slightly unfortunately habit of suggesting in their own<br>
timeline that you work on documentation and tests at the end. We<br>
strongly recommend that you work on them as you are writing the code<br>
(with tests in particular, it's much easier to be confident with where<br>
you are if you have tests as you go, but it's also easier to write<br>
documentation for something you're working on right now, rather than<br>
something you coded a month or two previously).<br>
<br>
We generally recommend that you include some 'stretch' goals in your<br>
project, for if everything goes particularly well and you have more<br>
time at the end. So it would be good to have a think about what else<br>
could fit within this project. But don't worry if you can't think of<br>
any; I think with the evaluation phase and then working based on what<br>
you learn from there that you should have enough to do!<br>
<div class=""><div class="h5"><br></div></div></blockquote><div>I've tried to breakdown the timeline out here but I'm sure that this is still not perfect enough. So I'd love it if you could tell me where I am going wrong and what more detail I could provide so I can think about it and get back to you.</div><div>Also, as of now I'm not able to think of any stretch goals with the project but I'll let you know if I come up with something worth the while!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
J<br>
<br>
--<br>
  James Aylett, occasional trouble-maker<br>
  <a href="http://xapian.org" rel="noreferrer" target="_blank">xapian.org</a><br>
<br>
</div></div></blockquote></div><br></div></div>