मैं मार्कोव क्लस्टरिंग एल्गोरिथ्म के विवरण के निम्न उदाहरण के माध्यम से काम कर रहा है:मार्कोव एल्गोरिथ्म क्लस्टरिंग
http://www.cs.ucsb.edu/~xyan/classes/CS595D-2009winter/MCL_Presentation2.pdf
मैं जैसे मैं सही ढंग से एल्गोरिथ्म का प्रतिनिधित्व किया है लग रहा है, लेकिन मैं एक ही परिणाम नहीं मिल रहा है कि कम से कम, यह गाइड उस इनपुट के लिए हो रहा था।
वर्तमान कोड है पर: मैं http://jsfiddle.net/methodin/CtGJ9/
यकीन नहीं करता है, तो शायद मैं सिर्फ एक छोटा सा तथ्य चूक कर रहा हूँ या सिर्फ इस बात के लिए कहीं न कहीं एक छोटे से ट्वीक जरूरत है, लेकिन मैं सहित कुछ रूपों की कोशिश की है:
- मुद्रास्फीति की दर/विस्तार
- एक सटीक
- सामान्य (के बाद से मूल गाइड यह आवश्यकता नहीं किया था निकाला जा रहा है के आधार पर समानता के लिए जाँच हो रही है गमागमन, हालांकि आधिकारिक एमसीएल घ ocumentation राज्य प्रत्येक पास पर मैट्रिक्स को सामान्य करने के लिए राज्यों)
इन सभी ने एक ही परिणाम लौटा दिया है - नोड केवल खुद को प्रभावित करता है।
मैं भी वीबी में एक समान एल्गोरिथ्म कार्यान्वयन पाया है: http://mcl.codeplex.com/SourceControl/changeset/changes/17748#MCL%2fMCL%2fMatrix.vb
और मेरे कोड उनकी नंबरिंग (600 - उदाहरण के लिए दूरी) के अपवाद के साथ मेल खाते हैं लगता है।
इस विस्तार समारोह
// Take the (power)th power of the matrix effectively multiplying it with
// itself pow times
this.matrixExpand = function(matrix, pow) {
var resultMatrix = [];
for(var row=0;row<matrix.length;row++) {
resultMatrix[row] = [];
for(var col=0;col<matrix.length;col++) {
var result = 0;
for(var c=0;c<matrix.length;c++)
result += matrix[row][c] * matrix[c][col];
resultMatrix[row][col] = result;
}
}
return resultMatrix;
};
है और यह मुद्रास्फीति समारोह
// Applies a power of X to each item in the matrix
this.matrixInflate = function(matrix, pow) {
for(var row=0;row<matrix.length;row++)
for(var col=0;col<matrix.length;col++)
matrix[row][col] = Math.pow(matrix[row][col], pow);
};
और अंत में मुख्य passthru समारोह है
// Girvan–Newman algorithm
this.getMarkovCluster = function(power, inflation) {
var lastMatrix = [];
var currentMatrix = this.getAssociatedMatrix();
this.print(currentMatrix);
this.normalize(currentMatrix);
currentMatrix = this.matrixExpand(currentMatrix, power);
this.matrixInflate(currentMatrix, inflation);
this.normalize(currentMatrix);
while(!this.equals(currentMatrix,lastMatrix)) {
lastMatrix = currentMatrix.slice(0);
currentMatrix = this.matrixExpand(currentMatrix, power);
this.matrixInflate(currentMatrix, inflation);
this.normalize(currentMatrix);
}
return currentMatrix;
};
jsfiddle लिंक टूटा हुआ प्रतीत होता है, क्या आपका कार्यान्वयन अभी भी कहीं भी उपलब्ध है? धन्यवाद! – skyork
अजीब। मुझे आश्चर्य है कि यह कहाँ चला गया? यहां कोड के साथ एक गलती है: https://gist.github.com/methodin/1573728 – methodin
यहां एक कोडपेन है: http://codepen.io/Xeoncross/pen/NqWqWe?editors=101 – Xeoncross