<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>sushain.com</title>
	<atom:link href="http://sushain.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://sushain.com/blog</link>
	<description>This blog is a revised common placeholder for my vision on having two parallel threads - Random Segments of Code (http://sushain.blogspot.com) and A Unification Effort on the Random Segments (http://unified-integrated-intelligence.blogspot.com/).</description>
	<pubDate>Mon, 12 Oct 2009 22:12:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An extensible Decision-Tree framework in Java</title>
		<link>http://sushain.com/blog/archives/88</link>
		<comments>http://sushain.com/blog/archives/88#comments</comments>
		<pubDate>Thu, 08 Jan 2009 17:26:50 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[decision tree]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=88</guid>
		<description><![CDATA[Problem Description: Decision trees are widely used predictive models in data mining and machine learning domains. This post describes a java-based decision-tree framework that can be worked upon and extended as needed. The implementation is done similar to the C5 library. I would also assume that the user has fundamental knowledge on the classifier and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem Description: </strong>Decision trees are widely used predictive models in data mining and machine learning domains. This post describes a java-based decision-tree framework that can be worked upon and extended as needed. The implementation is done similar to the <a href="http://www.rulequest.com/see5-info.html" target="_blank">C5</a> library. I would also assume that the user has fundamental knowledge on the classifier and won&#8217;t go into explaining what a decision-tree is. More info can be found <a href="http://en.wikipedia.org/wiki/Decision_tree">here.<br />
</a></p>
<p><strong>Framework Description:</strong> The framework essentially comprises 4 parts.</p>
<p><strong><br />
1.) TreeNode and DataPoint classes to hold hold data and define tree nodes: -<br />
</strong></p>
<p>DataPoint contains an attribute array to hold the values for a particular node and is contained within each TreeNode instance. The structures for these classes are as follows.</p>
<p><em>class TreeNode {</em></p>
<p><em>public double entropy;<br />
public Vector data;<br />
public int decompositionAttribute;<br />
public int decompositionValue;<br />
public TreeNode [] children;<br />
public TreeNode parent;</em></p>
<p><em>public TreeNode () {<br />
data = new Vector ();<br />
}<br />
}<br />
</em></p>
<p><em>class DataPoint {</em></p>
<p><em>public int [] attributes;<br />
public String label;</em></p>
<p><em><br />
public DataPoint (final int numattributes) {<br />
attributes = new int [numattributes];<br />
}<br />
}</em></p>
<p><strong>2.) DecisionTree: -</strong></p>
<p>This is the base class for decision-tree implementation and has a containment relation with the TreeNode class. It encapsulates all the implementation details for decision tree creation and entropy calculation. It uses the max-gain criteria for splitting over nodes. Right now, pruning hasn&#8217;t been implemented.</p>
<p>The field-definitions for decision-tree is as follows.</p>
<p><em>public class DecisionTree {</em></p>
<p><em>private int numAttributes;<br />
private String [] attributeNames;<br />
private Vector [] domains;<br />
private TreeNode trainingRoot;<br />
private TreeNode testingRoot;<br />
private String namesFile;<br />
private String trainingDataFile;<br />
private String testingDataFile;<br />
private int correctCount;<br />
private int inCorrectCount;<br />
private boolean debug;<br />
private int maxDepth;<br />
&#8230;.</em></p>
<p><em>}</em></p>
<p>The decision-tree class invokes the InputProcessor (explained below) , which populates the training and testing Roots with input data. After this, it invokes <em>createDecisionTree </em>and <em>induce </em>modules to the create the actual tree.</p>
<p>The overall structure of <em>induce </em>is as follows.</p>
<p><em>public void induce (final TreeNode node) {</em></p>
<p><em>double bestEntropy = 0;<br />
boolean selected = false;<br />
int selectedAttribute = 0;<br />
int numdata = node.data.size ();<br />
int numinputattributes = numAttributes - 1;<br />
node.entropy = calculateEntropy (node.data);<br />
if (node.entropy == 0) {<br />
return;<br />
}</em></p>
<p><em><br />
for (int i = 0; i &lt; numinputattributes; i++) {<br />
int numvalues = domains[i].size ();<br />
if (alreadyUsedToDecompose (node, i)) {<br />
continue;<br />
}</em></p>
<p><em>double averageentropy = 0;</em></p>
<p><em>for (int j = 0; j &lt; numvalues; j++) {<br />
Vector subset = getSubset (node.data, i, j);<br />
if (subset.size () == 0) {<br />
continue;<br />
}</em></p>
<p><em>double subentropy = calculateEntropy (subset);<br />
averageentropy += subentropy *     subset.size ();<br />
}</em></p>
<p><em>averageentropy = averageentropy / numdata;</em></p>
<p><em><br />
if (selected == false) {<br />
selected = true;<br />
bestEntropy = averageentropy;<br />
selectedAttribute = i;<br />
} else {</em></p>
<p><em>if (averageentropy &lt; bestEntropy) {</em></p>
<p><em>selected = true;<br />
bestEntropy = averageentropy;<br />
selectedAttribute = i;<br />
}<br />
}<br />
}</em></p>
<p><em>if (selected == false) {<br />
return;<br />
}</em></p>
<p><em>int numvalues = domains[selectedAttribute].size ();<br />
node.decompositionAttribute = selectedAttribute;<br />
node.children = new TreeNode [numvalues];<br />
for (int j = 0; j &lt; numvalues; j++) {<br />
node.children[j] = new TreeNode ();<br />
node.children[j].parent = node;<br />
node.children[j].data = getSubset (node.data,<br />
selectedAttribute, j);<br />
node.children[j].decompositionValue = j;<br />
}</em></p>
<p><em>for (int j = 0; j &lt; numvalues; j++) {<br />
induce (node.children[j]);<br />
}<br />
node.data = null;<br />
}</em></p>
<p><em><br />
</em></p>
<p>The most important function call within induce is to calculate the entropy and the structure for that is given below.</p>
<p><em> public double calculateEntropy (final Vector data) {</em></p>
<p><em>int numdata = data.size ();<br />
if (numdata == 0) {<br />
return 0;<br />
}</em></p>
<p><em>int attribute = numAttributes - 1;<br />
int numvalues = domains[attribute].size ();<br />
double sum = 0;</em></p>
<p><em> for (int i = 0; i &lt; numvalues; i++) {<br />
int count = 0;<br />
for (int j = 0; j &lt; numdata; j++) {<br />
DataPoint point = (DataPoint) data.elementAt (j);<br />
if (point.attributes[attribute] == i) {<br />
count++;<br />
}<br />
}</em></p>
<p><em>double probability = ((double) count) / numdata;</em></p>
<p><em>if (count &gt; 0) {<br />
sum += -probability * Math.log (probability);<br />
}<br />
}<br />
return sum;<br />
}</em></p>
<p><strong>3.) InputProcessor: -</strong></p>
<p>This is used for all the input processing and in turn, for node data population and is utilized by DecisionTree to get the populated Node Objects from raw input data. This is a fairly complicated class with different modules to read the attributes and the actual data. Besides, it contains the functionality to do a random split between training and test in case only one data-set is provided &amp; to discretize the linear data into bins.</p>
<p>The key module is <em>readDataSets</em>.</p>
<p><em> public int readDataSets (final String fileName, final TreeNode root, final String toSplit) throws Exception {<br />
</em></p>
<p><em> FileInputStream in = null;<br />
/************************************************<br />
* Reading the Training / Testing data set File    *<br />
************************************************/<br />
try {<br />
File inputFile = new File (fileName);<br />
in = new FileInputStream (inputFile);<br />
} catch (Exception e) {<br />
System.err.println (&#8221;Unable to open file: &#8221; + fileName + &#8220;n&#8221; + e);<br />
return -1;<br />
}</em></p>
<p><em>BufferedReader bin = new BufferedReader (new InputStreamReader (in));<br />
String input;<br />
int index = 1;<br />
while (true) {<br />
input = bin.readLine ();<br />
if (input == null) {<br />
break;<br />
} else if (input.startsWith (&#8221;|&#8221;)) {<br />
continue;<br />
} else if (input.contains (&#8221;|&#8221;)) {<br />
input = input.substring (0, input.indexOf (&#8221;|&#8221;));<br />
}<br />
if (input.equals (&#8221;")) {<br />
continue;<br />
}</em></p>
<p><em>StringTokenizer tokenizer = new StringTokenizer (input, &#8220;,&#8221;);<br />
int numtokens = tokenizer.countTokens ();<br />
if (skipCount &gt; -1) {<br />
if (numtokens != numAttributes + 1) {<br />
return -1;<br />
}<br />
} else if (numtokens != numAttributes) {<br />
return -1;<br />
}</em></p>
<p><em>DataPoint point = new DataPoint (numAttributes);<br />
// if there is no label to skip<br />
if (skipCount == -1) {<br />
point.label = &#8220;Example#&#8221; + index;<br />
for (int i = 0; i &lt; numAttributes; i++) {<br />
point.attributes[i] = getSymbolValue (i, tokenizer.nextToken ());<br />
}<br />
} else if (skipCount &gt; -1) {<br />
int attributeIndex = 0;<br />
for (int panditIndex = 0; panditIndex &lt; numAttributes + 1; panditIndex++) {<br />
// assign label to the data point and skip it as an attribute field<br />
if (panditIndex == skipCount) {<br />
point.label = tokenizer.nextToken ();<br />
continue;<br />
}</em></p>
<p><em>point.attributes[attributeIndex] = getSymbolValue (attributeIndex, tokenizer.nextToken ());<br />
attributeIndex = attributeIndex + 1;<br />
}<br />
}</em></p>
<p><em>/************************************************<br />
* Required 2/3-1/3 random data split follows     *<br />
************************************************/<br />
if (toSplit.equals (&#8221;SPLIT&#8221;)) {<br />
double randomNumber = 3 * Math.random ();<br />
if (randomNumber &gt; 2) {<br />
testingRoot.data.addElement (point);<br />
} else {<br />
root.data.addElement (point);<br />
}<br />
} else {<br />
root.data.addElement (point);<br />
}<br />
index = index + 1;<br />
}<br />
in.close ();<br />
bin.close ();<br />
return 1;<br />
}</em><br />
<strong>4.) DisplayProcessor:-</strong></p>
<p>This class provides the key implementation for handling the display functionality. The output formatting is similar to what you see <a href="http://www.rulequest.com/see5-win.html#TREES">here.</a> The key module is <em>displayTree </em>which displays each node-level recursively.<em><br />
</em></p>
<p><em> public void displayTree (final TreeNode node, final String tab, final int numAttributes, final String [] attributeNames, final Vector [] domains, final int depth) {</em></p>
<p><em>int outputattr = numAttributes - 1;<br />
if (node.children == null) {<br />
int [] values = getAllValues (node.data, outputattr, domains);<br />
if (values.length == 1) {<br />
System.out.print (&#8221; &#8221; + domains[outputattr].elementAt (values[0]));<br />
return;<br />
}</em></p>
<p><em>System.out.print (&#8221; {&#8221;);<br />
for (int i = 0; i &lt; values.length; i++) {<br />
System.out.print (&#8221;"&#8221; + domains[outputattr].elementAt (values[i]) + &#8220;&#8221;");<br />
if (i != values.length - 1) {<br />
System.out.print (&#8221; , &#8220;);<br />
}<br />
}</em></p>
<p><em>System.out.print (&#8221; };&#8221;);<br />
return;<br />
}</em></p>
<p><em>int numvalues = node.children.length;<br />
for (int i = 0; i &lt; numvalues; i++) {<br />
System.out.print (&#8221;n&#8221; + tab + attributeNames[node.decompositionAttribute] + &#8221; = &#8221; + domains[node.decompositionAttribute].elementAt (i) + &#8220;:&#8221;);<br />
if (depth &lt;= this.MAX_DEPTH) {<br />
displayTree (node.children[i], tab + &#8220;:   &#8220;, numAttributes, attributeNames, domains, depth + 1);<br />
} else {<br />
System.out.print (&#8221;&#8230;&#8221;);<br />
}</em></p>
<p><em>if (i != numvalues - 1) {<br />
System.out.print (&#8221;t&#8221;);<br />
} else {<br />
System.out.print (&#8221;");<br />
}<br />
}<br />
}<br />
</em></p>
<p>Again, this can be easily modified or extended as needed since the display functionality is cleanly decoupled from decision-tree creation logic and other parts explained above. Finally, in case you require the complete framework implementation alongwith the data-sets and instructions, please drop me a <a href="mailto:sushain.pandit@gmail.com?subject=Decision Tree Framework Required">note</a> explaining the purpose and need for it and I shall get back to you.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=An%20extensible%20Decision-Tree%20framework%20in%20Java&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F88"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/88/feed</wfw:commentRss>
		</item>
		<item>
		<title>Resolving 403 forbidden page error for Wordpress blogs</title>
		<link>http://sushain.com/blog/archives/77</link>
		<comments>http://sushain.com/blog/archives/77#comments</comments>
		<pubDate>Wed, 07 Jan 2009 19:04:57 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Troubleshooting]]></category>

		<category><![CDATA[403]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[error]]></category>

		<category><![CDATA[forbidden]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=77</guid>
		<description><![CDATA[Well, yesterday I moved my blog from blogspot to wordpress using Wordpress&#8217;s awesome Importer tool and this tutorial. The action was mainly driven by the desire to host the blog on my own domain since that gives me a lot more flexibility to customize stuff as I want it to be. Luckily for me, my [...]]]></description>
			<content:encoded><![CDATA[<p>Well, yesterday I moved my <em><a href="http://unified-integrated-intelligence.blogspot.com/">blog</a></em> from blogspot to wordpress using Wordpress&#8217;s awesome <em>Importer</em> tool and <a href="http://www.terencechang.com/2007/06/16/import-blog-from-bloggercom-into-wordpress-free-your-blog-with-freedom/">this</a> tutorial. The action was mainly driven by the desire to host the blog on my own domain since that gives me a lot more flexibility to customize stuff as I want it to be. Luckily for me, my hosting provider (A2hosting.com) has a ready installation package for setting up a wordpress blog and so that part went pretty smooth. However, once I tried to open up the landing page of my blog, I got <em>page forbidden (403)</em> error. Incidentally, it was coming for every single page of the blog, including the wp-admin.</p>
<p>After a lot of hassle, I was finally able to resolve it and everything seems to be working alright since then. Nehow, I thought of putting down my observations here for anyone who may face similar issue with their installations or otherwise.</p>
<p>- The obvious things first - I checked the permissions on the installation folder (for me, <em>&lt;root&gt;/blog</em>) and found it to be perfectly ok (<em>755 for read / execute to world</em>).</p>
<p>- Next I checked the <em>.htaccess</em> in the root and so I found the problem. I had an earlier rails (Ruby on Rails) installation and following lines were present in it: -</p>
<p><em>RewriteEngine on</em></p>
<p><em>RewriteCond %{HTTP_HOST} ^sushain.com$ [OR]<br />
RewriteCond %{HTTP_HOST} ^www.sushain.com$<br />
RewriteRule ^contest http://127.0.0.1:12009%{REQUEST_URI} [P,QSA,L]<br />
DirectoryIndex preload.html index.html<br />
# BEGIN WordPress</em></p>
<p><em># END WordPress</em></p>
<p>I immediately knew that the url rewriting module was causing some issue here, but I didn&#8217;t want to tinker with this since I may want my Ruby app (although dormant for now) to come alive again in future. So, what I did instead was that I changed the .htaccess file in the /blog folder from -</p>
<p><em>DirectoryIndex index.php<br />
AuthUserFile &#8220;/home/sushainp/.htpasswds/public_html/blog/passwd&#8221;</em></p>
<p>to -</p>
<p><em>DirectoryIndex index.php<br />
AuthUserFile &#8220;/home/sushainp/.htpasswds/public_html/blog/passwd&#8221;<br />
# BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /blog/<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /blog/index.php [L]<br />
&lt;/IfModule&gt;</em></p>
<p><em># END WordPress</em></p>
<p>This overrode the url rewriting mechanism for /blog level addresses and thus, solved the issue.</p>
<p>Btw, for those of you interested in knowing more about url rewriting module, more information is available <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">here</a>.</p>
<p>Cheers !</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Resolving%20403%20forbidden%20page%20error%20for%20Wordpress%20blogs&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F77"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/77/feed</wfw:commentRss>
		</item>
		<item>
		<title>On creation of zip-files using PHP</title>
		<link>http://sushain.com/blog/archives/21</link>
		<comments>http://sushain.com/blog/archives/21#comments</comments>
		<pubDate>Fri, 02 Jan 2009 11:37:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[comaprison]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=21</guid>
		<description><![CDATA[Problem: The subject describes the problem and situation quite comprehensively. Just putting down my observations here.
Solution options: Well, I tried out many libraries and finally used none. In any case, here is my experience.
1.) Ziplib  library from phpclasses - Very powerful library, can be used for recursively adding folders to an archive, etc. Just [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> The subject describes the problem and situation quite comprehensively. Just putting down my observations here.</p>
<p><strong>Solution options:</strong> Well, I tried out many libraries and finally used none. In any case, here is my experience.</p>
<p><strong>1.)</strong> <a href="http://www.phpclasses.org/browse/download/targz/package/2088/name/ziplib-2005-08-26.tar.gz">Ziplib </a> library from phpclasses - Very powerful library, can be used for recursively adding folders to an archive, etc. Just seemed to be too complicated for my task.</p>
<p><strong>2.)</strong> <a href="http://www.devco.net/code/zipfile.inc.txt">Lib by devco.net</a> - Simple usage and fairly good lib. This is how I tried using it: -</p>
<p><span style="font-style:italic;">require (&#8221;pclzip.lib.php&#8221;);<br />
$exp = &#8220;63&#8243;;<br />
$zipfile = new PclZip(&#8221;$exp&#8221;.&#8221;_pack.zip&#8221;);<br />
error_reporting(E_ALL);<br />
$output = shell_exec( &#8220;cp index.php 63&#8243; );<br />
$v_list = $zipfile-&gt;create(&#8221;$exp&#8221;);<br />
</span><br />
The issue I had with this one was that it didn&#8217;t allow me to add subdirectory structures selectively, or at least I couldn&#8217;t fig it out rightaway.</p>
<p><strong>3.)</strong> Yet another library, this one was by <a href="http://drupal.org/node/83253">Drupal</a> - Seemed similar to 1.) and again, I just realized mid-way that I needn&#8217;t have that much functionality at all and wanted something simpler.</p>
<p><strong>4.)</strong> Another one by <a href="http://www.granthinkson.com/2005/07/01/create-zip-files-dynamically-using-php/">granthinkson</a> - Neat library, esp if you want to get all dirty with the actual file-creation and understanding process. I just wanted my zip :sigh:.</p>
<p><strong>5.)</strong> Yet another by <a href="http://articles.techrepublic.com.com/5100-10878_11-6125204.html">Techrepublic</a> - Again, simple usage and I would&#8217;ve almost gone with this, but for point (6.) below. But, in any case, fairly easy to use this -</p>
<p><span style="font-style:italic;">$obj = new Archive_Zip(&#8217;63.zip&#8217;);<br />
$files = array(&#8217;63.soft&#8217;,'63.chp&#8217;, &#8216;63.cel&#8217;);<br />
$obj-&gt;create($files);<br />
</span></p>
<p><strong>6.)</strong> Well, dunno why, but I had my usual whim and I suddenly decided not to go with any of these and resorted back to plain old &#8216;jar&#8217; util. So, this is what I did finally, esp since our server is configured with a jre anyways.</p>
<p><span style="font-style:italic;">/* Modified: 1-1-09 | code for zip creation - pandit */<br />
&#8230;..<br />
$zipfilename = &#8220;$exp&#8221;.&#8221;_pack.zip&#8221;;<br />
&#8230;&#8230;<br />
if(!file_exists(&#8221;$tmp_dir/$zipfilename&#8221;)) {<br />
$src = &#8220;$root_dir/ftp/pub/$exp/*&#8221;;<br />
$dest = &#8220;$tmp_dir/$exp&#8221;;<br />
exec( &#8220;cp  $src $dest&#8221; );<br />
exec (&#8221;jar cfM $tmp_dir/$zipfilename -C $dest .&#8221;);<br />
}<br />
&#8230;&#8230;<br />
$zip_link = $base_url . &#8220;/$zipfilename&#8221;;</span></p>
<p>But, thats so trivial, said Watson.. Yup, everything becomes trivial after explanation, sighed Holmes.</p>
<p>Anyhow, I implemented it <a href="http://www.anexdb.org/query/experiment.php?ex=111">here</a></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=On%20creation%20of%20zip-files%20using%20PHP&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F21"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/21/feed</wfw:commentRss>
		</item>
		<item>
		<title>Case analysis - A critique on Turing&#8217;s original refutations</title>
		<link>http://sushain.com/blog/archives/92</link>
		<comments>http://sushain.com/blog/archives/92#comments</comments>
		<pubDate>Tue, 02 Dec 2008 06:03:32 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[games]]></category>

		<category><![CDATA[Imitation]]></category>

		<category><![CDATA[Test]]></category>

		<category><![CDATA[Turing]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=92</guid>
		<description><![CDATA[

In this piece, I try to analyze the refutations (against various arguments) given by Turing in his classic article on the &#8216;Imitation Game&#8217;, and determine what still holds given the present state of AI. The following arguments and analysis are with reference to the original Turing Article located at - http://www.loebner.net/Prizef/TuringArticle.html Towards the end, I [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">In this piece, I try to analyze the refutations (against various arguments) given by Turing in his classic article on the &#8216;Imitation Game&#8217;, and determine what still holds given the present state of AI. The following arguments and analysis are with reference to the original Turing Article located at - <a href="http://www.loebner.net/Prizef/TuringArticle.html"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.loebner.net/Prizef/TuringArticle.html</span></span></a> Towards the end, I present my views on the current state of success at passing the Turing Test and what future warrants on the subject.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">1.) <span style="text-decoration: underline;"><strong>Theological objection</strong></span>: - To me it seems that the theological arguments have always banked on <em>faith</em> rather than being based on logic and reason. However, this objection may still carry some weight to those who can define and clarify the idea of a <em>soul</em> and then be able to link this idea to <em>thinking</em> process. Without these definitions, linking the thinking process with <em>man’s immortal soul </em>is a highly generalized assumption based on the notion that an <em>all-powerful</em> <em>God</em> is able to somehow put this into effect. However, this very assumption is contradicted later on by claiming that the same God can’t put those souls somewhere else, in this instance - machines. Overall, this objection seems too pretentious to carry substantial weight now. Moreover, Turing’s refutations in the original paper seemed to be quite rational to put this case to rest.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">2.) <span style="text-decoration: underline;"><strong>The “Heads in the Sand” objection</strong></span>: - This objection in itself (as stated in the original paper) carries no weight now. However, it is somewhat related to the ethical issues that are now often connected with AI, when we pause considering whether we can develop AI, and ask ourselves - Should we create AI and ponder upon the various implications of advanced / strong AI if it were to co-exist with humankind. But, since the current discussion is about ‘<strong>Can</strong> machines think’, we would rest this case here.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">3.) <span style="text-decoration: underline;"><strong>The Mathematical objection</strong></span>: - Actually, this argument doesn’t really seem like a reason to object the test since it tentatively puts machines only at a disadvantage w.r.t humans and thus this test may be a decent criteria to determine the validity of that objection. Anyhow, as far as computing capacities are concerned, we’ve reached very high orders from what was available back in Turing’s time. Thus, ideally, such machines can be build which would decently respond to the objections in this point.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">4.) <span style="text-decoration: underline;"><strong>The argument from consciousness</strong></span>: - In his original paper, Turing has handled this argument from the perspective of <em>feeling as it relates to thinking </em>and he describes this objection as - ‘whether machines can feel that they are thinking‘. Within this context, his refutations seem valid since he links these objections to solipsism (claim that only <em>self</em> can be verified), which he then claims is noone’s win since it makes idea communication difficult.</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">However, there is a broader context to this argument now, especially after thought experiments like <strong>Chinese Room</strong> by Searle - <a href="http://en.wikipedia.org/wiki/Chinese_Room"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/Chinese_Room</span></span></a> . These experiments broaden the scope of the argument by relating consciousness to mind,  bringing the notion of intentionality &amp; states, and illustrating that machines can’t have minds irrespective of their intelligent behavior.</p>
<p style="margin-bottom: 0in;">One may argue that Turing would have reasoned that even the neurons within human brains aren’t conscious in the sense of understanding what they are doing, and it somehow appears that the overall system as a whole is behaving intelligently and there is nothing more to it than appearance. However, since these ideas are not the part of his original paper, these objections would still hold.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">5.) <span style="text-decoration: underline;"><strong>Arguments from various disabilities</strong></span>: - This argument is essentially a combination of various objections and expectations each of which are discusses below. For many of these, we would require an exact definition of the word to relate it to AI and for this purpose, we would refer this source - <a href="http://www.answers.com/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.answers.com</span></span></a> : -</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being kind, friendly, loving</span>: These are abstract words that require contextual definitions. If these are implied by being <em>helpful and useful</em>, then certainly this objection will not hold since there are many machines, softwares etc, that help people automate their work. Applications of AI to advanced robotics has produced many helpful robots - <a href="http://www.helpfulrobots.com/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.helpfulrobots.com/</span></span></a> .</p>
<p style="margin-bottom: 0in;">However, if we think of kindness, friendship and falling in love from a conscious point of view, then it would again require a mind and intention. It would thus fall into the consciousness argument discussed above.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being resourceful</span>: As per our source, resourceful means - able to act effectively or imaginatively, especially in difficult situations. Clearly, most of the existing softwares meet the criteria of efficiency. There are various agent programs that deal with different situations intelligently as well - <a href="http://en.wikipedia.org/wiki/Windows_Live_Agents"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/Windows_Live_Agents</span></span></a> . Imagination is again dependent on how we define it, but overall this criteria seems to be met now.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being beautiful</span>: If this concerns external beauty, there are certainly beautiful machines created by careful manufacturing, etc. Internal beauty is again abstract and would belong to the consciousness argument, as in being aware of an internal state.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Having initiative</span>:<strong> </strong>Most AI machines or softwares have been created with an ultimate goal to take the initiative from humans and automate processes.</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><strong>- </strong><span style="text-decoration: underline;">Having a sense of humour</span>: There have been some efforts towards artificial comedy - <a href="http://www.clone3d.net/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.clone3d.net/</span></span></a> .</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Telling right from wrong and learning from experience and doing something really new</span>: Machine learning and causalreasoning are two of the core fields in AI research and have been implemented in many systems. Doing something new can be a direct consequence of machine learning or learning from experience. So, this objection doesn’t hold now.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Making mistakes</span>: Since AI programs are written by humans, they can be buggy and hence their actual output can deviate from expected. This can be classified as making mistakes.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Making someone fall in love</span>: This is quite achievable using meticulous and aesthetical design, and giving a pleasing appearance to a useful machine.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Using words properly</span>: NLP and voice recognition programs are a case in point.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Having as much diversity of behavior as a man</span>: This objection still holds and would continue to hold until certainmilestones are reached in brain and mind simulation .</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being the subject of its own thought</span>: Thought requires a clear contextual definition here, but, in general, this could be similar to providing a program source as an input to itself and observe the output. Again, doable and hence the objection doesn’t hold.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">6.) <span style="text-decoration: underline;"><strong>Lady Lovelace&#8217;s Objection</strong></span>: The gist of this objection can be summed up in one sentence - machines can never do anything <em>really </em>new so as to take us (humans) by surprise and Turing gave a classic refutation to this by claiming that this is equivalent to saying that there is nothing new under the sun since every new discovery or invention is linked to some past event or chain of events. So, basically he tried to give a context to what should be considered as <em>really new</em> and within that context, this objection is clearly not true today. There are programs capable of giving surprises as well as creating unique and new scenarios. A case in point is the origin of Butterfly effect - <a href="http://en.wikipedia.org/wiki/Butterfly_effect"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/Butterfly_effect</span></span></a> .</p>
<p><br/></p>
<p style="margin-bottom: 0in;">7.) <span style="text-decoration: underline;"><strong>Argument from Continuity in the Nervous System</strong></span>: This argument needed refutation on grounds of fairness in the original paper at the time Turing wrote it. However, now with neuro-computing models in existence, this argument can be made redundant in principle.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">8.) <span style="text-decoration: underline;"><strong>The Argument from Informality of Behavior</strong></span>: The crux of the argument is - If each man had a definite set of rules of conduct by which he regulated his life, he would be no better than a machine. But there are no such rules, so men cannot be machines. Turing refutation on this still holds since we still haven’t found the absolute laws of behavior that regulate life, something similar to the M-theory, or the theory of everything - <a href="http://en.wikipedia.org/wiki/M-theory"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/M-theory</span></span></a> .</p>
<p><br/></p>
<p style="margin-bottom: 0in;">9.) <span style="text-decoration: underline;"><strong>The Argument from Extrasensory Perception</strong></span>: The argument itself seems pretty weak and containing very less substantiation. There are varied opinions on phenomena like telepathy, precognition, etc, and like the argument the refutation is also pretty weak <!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } -->(<em>telepathy-proof room</em>). Anyhow, some people may still have this objection, however it remains a very subjective issue.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;"><span style="text-decoration: underline;"><strong>New Issues</strong></span>: -</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><span style="text-decoration: underline;"><strong>Inherent problems with the Turing Test and Comprehensive Turing Test</strong></span>:</p>
<p><br/></p>
<p style="margin-bottom: 0in;">With the advancement of AI to fields like machine vision and perception, one may demand a more comprehensive test. This is since humans generally don’t use question-answering as a means to find whether someone is able to ‘<em>think‘</em>. We use more simplistic (or elaborate, if we consider machines) methods like sight, sound of voice, etc and our notion of thinking is implied by many other apparent things than just plain response. A case in point are the systems like CAPTCHA - <a href="http://www.captcha.net/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.captcha.net/</span></span></a> . This brings back the old issue on whether the Turing Test is a real test of intelligence at all. It seems that the inherent problem with the test is that a program can fool an interrogator by playing on his psychology. This task is much more easier and doesn’t definitely require intelligence equivalent to the mind, or thought process. A simple re-use of the question-phrases can be used as an effective way of letting an interrogator know that the program is actually a person belonging to a particular genre. A case in point is Eliza - <a href="http://en.wikipedia.org/wiki/ELIZA"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/ELIZA</span></span></a> . Of late, there have been similar concerns raised over expertise of judges in the Loebner competition. As far as the current state of success with passing the Turing Test is concerned, it may be noted that Loebner is the only official competition for judging this and most of the effort in AI is actually not focused on passing this test. This current state of AI may not have a one-to-one co-relation with the whether this test has been passed or not. However, current state of AI does give us an idea regarding whether this test <em>can</em> be passed if all effort was directed towards it. The 2007 winner for Loebner award was UltraHal, which is basically a software assistant and was re-programmed to enter the competition so that it could specifically fool the judges (ref the interview here - <a href="http://aidreams.co.uk/forum/index.php?page=67"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://aidreams.co.uk/forum/index.php?page=67</span></span></a> ) . So, again the chance of fooling a judge is subjective and dependent on the skill of judge as described above in the case of Eliza bot. It may be argued that the Turing test has already been passed by some programs since they fooled a set of judges in Loebner, but the credibilty of judges would always be in question and so will be the exact rules and regulations under the competition was held. In all, I would say there’s a chance of about 25% for a machine to pass the test, considering strict Turing guidelines and maybe in next 50 years, we would make substantial advances in allied fields of AI to eventually pass the test satisfactorily, however, this again depends on how much effort is put in  actually solving this problem in specific.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Case%20analysis%20-%20A%20critique%20on%20Turing%26%238217%3Bs%20original%20refutations&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F92"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/92/feed</wfw:commentRss>
		</item>
		<item>
		<title>Kick-starting Info 3.0 LinkedIn Group</title>
		<link>http://sushain.com/blog/archives/34</link>
		<comments>http://sushain.com/blog/archives/34#comments</comments>
		<pubDate>Thu, 31 Jul 2008 10:47:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Random Segments]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=34</guid>
		<description><![CDATA[Hello and welcome to the homepage (atleast for now) of Info 3.0 group at LinkedIn.
Managing information is one of the most fundamental activities done in any enterprise, irrespective of the size, scale, or purpose. Thus, it becomes an obvious and essential need to find ways and develop notions &#38; techniques that would make this activity [...]]]></description>
			<content:encoded><![CDATA[<p>Hello and welcome to the <a href="http://info3dot0.blogspot.com/" target="_blank">homepage</a> (atleast for now) of <strong>Info 3.0 group</strong> at <strong>LinkedIn</strong>.</p>
<p>Managing information is one of the most fundamental activities done in any enterprise, irrespective of the size, scale, or purpose. Thus, it becomes an obvious and essential need to find ways and develop notions &amp; techniques that would make this activity easier, intelligible, coherent and accessible. There are scores of issues that come under the information management umbrella, right from generation / aggregation through transformation to consumption / presentation. In essence, Info N.0 tries to capture and in turn define information management using contemporary XXX N.0 technologies, like Web N.0, Enterprise N.0, RSS N.0.</p>
<p>Now, Info 3.0 group is meant to explore the notions, possibilities and issues related to the next generation of information management, encompassing Web 3.0 / 2.0 technologies, Enterprise 2.0 and the role that Artificial Intelligence may play in the eventual evolution of Info N.0. It would be pertinent to quote that right now the definitions for this are very fuzzy, specifications are absent and thats why the purpose of this group is to evolve a framework, through a series of blog-posts and retrospection, such that one could look at it and get an idea on the scope and possibilities of Info N.0</p>
<p>I always believe that a shared-blog or a wiki is the perfect place to evolve ideas; so let us come up with whatever thoughts, ideas, or prior experience we have had related to Information Management in general, or specifically related to Info N.0. As is the case with any community, I won&#8217;t be posting here all the time, so just drop me a note at - sushain.pandit@gmail.com and I would be more than glad to add you to the author&#8217;s list.</p>
<p>Lastly, pl let me know in case you&#8217;ve any comments or sugg on how this should be done in a better way, (for instance start a wiki instead of a blog et al). So, once again welcome to the group and rock on !</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Kick-starting%20Info%203.0%20LinkedIn%20Group&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F34"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/34/feed</wfw:commentRss>
		</item>
		<item>
		<title>Case Analysis - Cuil</title>
		<link>http://sushain.com/blog/archives/20</link>
		<comments>http://sushain.com/blog/archives/20#comments</comments>
		<pubDate>Fri, 25 Jul 2008 13:43:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[cuil]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=20</guid>
		<description><![CDATA[We&#8217;ve had a new entrant in internet-search spaces, called Cuil, which, as per popular fiction, is supposedly out there to compete with Google. Anyhow, I spend some time playing around and reading accessible literature on it and here are my observations: -
- Indexing: Most hyped is the size of its massive index (~120 billion pages), [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had a new entrant in internet-search spaces, called Cuil, which, as per popular fiction, is supposedly out there to compete with Google. Anyhow, I spend some time playing around and reading accessible literature on it and here are my observations: -</p>
<p>- <strong>Indexing:</strong> Most hyped is the size of its massive index (~120 billion pages), as also quoted in their <a href="http://www.cuil.com/info/">info page</a> - &#8220;Cuil searches more pages on the Web than anyone else—three times as many as Google and ten times as many as Microsoft&#8221;. However, I didn&#8217;t find any conclusive proof for this in that Google still listed more total hits on most of my test-searches. [Example SearchKey = 'Sushain': Cuil - 662 | Google - 929]</p>
<p>Now, this may still improve with time, so we&#8217;ll let this one pass.</p>
<p>- <strong>Renewal rate:</strong> Now, they might have indexed more pages than Google but their index still doesn&#8217;t contain recent links. Indexing recent content is really critical to search engines and again, they should improve on this front with time.</p>
<p>- <strong>Page ranking:</strong> The <a href="http://www.cuil.com/info/">info page</a> also says - &#8220;Rather than rely on superficial popularity metrics, Cuil searches for and ranks pages based on their content and relevance. When we find a page with your keywords, we stay on that page and analyze the rest of its content, its concepts, their inter-relationships and the page’s coherency.&#8221;</p>
<p>The issue I found was that sometimes the searches listed &#8216;not-so-important&#8217; results before more-relevant ones. For instance, listing the pages linked to someone&#8217;s friend (via a social network) before actually putting the person&#8217;s site-listing etc. In my case, it shows my name being present in my friend&#8217;s HiFi n/w, before pointing anything relevant to me (and I haven&#8217;t put a robots.txt file on my website yet to stop crawlers :-)).</p>
<p>- <strong>Infrastructure:</strong> Many a times, during my experimentation, Cuil would just give a &#8216;We&#8217;ll be back&#8217; message, or wouldn&#8217;t repeat the results that were generated for the same query, some time ago. Again, there&#8217;s room for improvement and they would do well to evolve with time.</p>
<p>- <strong>Layout:</strong> I&#8217;ve personal hots for dark (energy-saving) backgrounds and Cuil scores there. Even otherwise, the results are laid out in a better way and are easy to spot, but again, I think I&#8217;ve seen this before on proprietary search-engines.</p>
<p>- <strong>Privacy:</strong> Cuil does claim to be the good-boy search engine n not track the data et al, but the bottom-line still is how good the search capability is.</p>
<p><strong>Final verdict:</strong> Well, I&#8217;m pretty much in favor of any new-comer into a partially monopolized domain (Though I love Google as much as anyone :-)). The only issue I&#8217;ve is that they really could&#8217;ve done some more ground-work before making this live (Links on Info and Privacy weren&#8217;t working till yesterday) since the first impression really goes a long way. All in all, I think, we need to give more time to Cuil; No enterprise gets build in a day and Cuil should be appreciated to have at least taken an initiative in an otherwise one-firm show.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Case%20Analysis%20-%20Cuil&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F20"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/20/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Javascript Framework for Building Hierarchical Layouts</title>
		<link>http://sushain.com/blog/archives/19</link>
		<comments>http://sushain.com/blog/archives/19#comments</comments>
		<pubDate>Tue, 22 Jul 2008 06:58:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[hierarchical]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[layout]]></category>

		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=19</guid>
		<description><![CDATA[Abstract: Layouts play a key role in any UI-based application requiring even marginal display formatting. The idea is to encapsulate the screen-level details into a library and to completely decouple the rendering knowledge from the actual business / enterprise logic details. This would then allow a UI-specialist team to work in tandem with business analysts, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Abstract:</strong> Layouts play a key role in any UI-based application requiring even marginal display formatting. The idea is to encapsulate the screen-level details into a library and to completely decouple the rendering knowledge from the actual business / enterprise logic details. This would then allow a UI-specialist team to work in tandem with business analysts, or core product-development teams without getting too much up-close and personal with the underlying product-level details. Alternatively, a properly designed layout library could be used off-the-shelf by a development team. The framework discussed here relates to either of these scenarios and many more.</p>
<p><strong>Description:</strong> The framework is developed as a javascript service that defines vertical / horizontal hierarchical layout method handlers. There are different handlers  based on whether one wants to organize divisions (div tags), separate nodes, or node hierarchies. Apart from the structuring logic, the file also includes the rendering logic that paints the node(s) and their associated relations to build the actual hierarchy.</p>
<p>Now, the layouts are provided out of the box and all one requires is a nodelist (supporting composite pattern), which will then be consumed to draw the actual hierarchy. Such hierarchies can be utilized for a particular filtered view within a social networking graph.</p>
<p>The node definition(s) should comply to the following generic template to be able to fed and subsequently consumed properly by the framework: -</p>
<p><span style="font-style:italic;">var Node = function(id) {<br />
this.id = id;<br />
this.coords;<br />
this.shape;<br />
this.text;<br />
this.group;<br />
this.childList = new dojox.collections.ArrayList();<br />
}<br />
</span></p>
<p>Illustration: -</p>
<p>- Get a hierarchy object (pass the ultimate parent of the node hierarchy and specify the alignment [horizontal / vertical]: -</p>
<p><span style="font-style:italic;">HierarchyLayout newLayout = new HierarchyLayout (document, ultimateParent, alignment);</span></p>
<p>- Invoke addNodeHierarchy: -</p>
<p><span style="font-style:italic;">newLayout.addNodeHierarchy (ultimateParent, &#8220;&#8221;); // 2nd argument is yet to be utilized</span></p>
<p>This invocation would assign a value to the node coordinates (node.coords.x, node.coords.y) for each node in the hierarchy according to the passed alignment.</p>
<p>- Invoke renderHierarchy on a node: -</p>
<p><span style="font-style:italic;">node.renderHierarchy ();</span></p>
<p>This invocation would render the immediate child nodes considering &#8220;node&#8221; as the parent.</p>
<p>The library can be downloaded from - <a href="http://sushain.com/sonet/resources/Layout.js">Layout Lib</a></p>
<p>You can see a demo-usage @ <a href="http://sushain.com/sonet/index.html">SoNet home</a> under &#8220;Demo&#8221; &#8211;&gt; &#8220;Layout service demo&#8221;.</p>
<p>Please feel free to drop a note in case you&#8217;ve comments / feedback.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=A%20Javascript%20Framework%20for%20Building%20Hierarchical%20Layouts&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F19"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/19/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Framework Description for Dynamic Generation of XMLs</title>
		<link>http://sushain.com/blog/archives/14</link>
		<comments>http://sushain.com/blog/archives/14#comments</comments>
		<pubDate>Tue, 15 Jul 2008 10:27:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[dynamic]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=14</guid>
		<description><![CDATA[Problem Statement: XML is an oft-used specification in enterprise-level application frameworks for specifying input/output sources. Many a times, there arises a need to extend or adorn the existing access end-points, for instance by placing a wrapper over the original frameworks or middle-ware. Such scenarios should be handled without the loss of generality and the key [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem Statement:</strong> XML is an oft-used specification in enterprise-level application frameworks for specifying input/output sources. Many a times, there arises a need to extend or adorn the existing access end-points, for instance by placing a wrapper over the original frameworks or middle-ware. Such scenarios should be handled without the loss of generality and the key requirement is seamless matching with the input specification (XML) of the existing framework. In such cases, it becomes a tedious task for the writers of the wrapper to statically code the XMLs that are to be fed into the existing framework, while simultaneously conforming to the existing schema definitions (xsds / dtds).</p>
<p>Thus, a generic XML-generation framework is desirable that could return precise XML files by consuming a schema definition(specifying generic XML structure) and an input configuration (containing information specific to a particular XML-generation instance).</p>
<p><strong>Input(s) to the framework:</strong> Schema Definition (xsd), Configuration (.xml), Input Parameters (HashMap ), Resource Specification [Specifies the system-specific entity for which the xml is to be generated].</p>
<p><strong>Solution Design:</strong> The core idea is pretty straight-forward and comprises of the following steps: -</p>
<p>[1]. Create an in-memory parse-tree out of the given .xsd</p>
<p>[2]. Use the resource specification to refer the configuration and find out &#8216;the information&#8217; specific to that particular XML-generation instance</p>
<p>[3]. Use the above &#8216;information&#8217; to find out the scope of the current instance of xml generation from within the entire parse-tree</p>
<p>[4]. Adorn that scope with the input parameters and recursively apply &#8216;the information&#8217; to generate the actual XML file</p>
<p><strong>Description:</strong></p>
<p><strong>[1]</strong>. Create an in-memory parse-tree out of the given .xsd - For this, one can either go with any of the open-source xml-parsers, or write from scratch. Writing from scratch would generally require Element, Node, Attribute and ComplexType  classes along with their respective handlers. Then, you would&#8217;ve a Schema Parser, which would utilize instances of those classes and generate the final tree object.</p>
<p>I won&#8217;t elaborate further on this here; if required, please drop me a note. In essence, the only contract to be followed is that the return object should contain a parse-tree structure.</p>
<p><strong>[2, 3 &amp; 4]</strong>. To understand these, let us delve a bit into the source.</p>
<p>Our generator would generally need to follow something similar to the following contract: -</p>
<p><span style="font-style: italic;">/**<br />
* IXMLGenerator represents the contract that all XML generators must adhere to<br />
* in order to support the default logic of XML genertion. Default XML generation<br />
* contract is based on the consumption of the starting XML <code>element</code><br />
* and the <code>consolidatedMap</code> of input and configuration parameters to<br />
* generate the populated response XML for that particular element.<br />
*<br />
* @author sushain<br />
*<br />
* @version 1.0<br />
*/</span></p>
<p>public interface IXMLGenerator<br />
{ /**<br />
* This method takes a resource name, corresponding method and a<br />
* parameter map and builds a request xml<br />
* which can be consumed by the a request handler.<br />
*<br />
* @param resource<br />
* @param method<br />
* @param paramMap<br />
*<br />
* @return Generated request xml<br />
*/</p>
<p>public static String generateXml(final String resource,<br />
final String method, final HashMap paramMap)<br />
throws SchemaParsingException;<br />
}</p>
<p>Here, generateXml would be the main method, inherently calling the tree-creation module, and effectively completing step (1). This method would utilize the input-parameter map (HashMap containing the name-value pairs for the elements to be populated in the xml), resource (the entity for which the xml is desired) and method (the type of xml desired {system-specific}) by referring the &#8216;Configuration&#8217; in the following manner: -</p>
<p>Now, I&#8217;ve repeatedly referred to a &#8216;Configuration&#8217; above, lets see how that actually looks like: -</p>
<p>&lt;configuration&gt;<br />
&lt;resource name=&#8221;&lt;system-defined name&gt;&#8221;&gt;<br />
&lt;method name=&#8221;&lt;resource access method / CRUD operation&gt;&#8221;&gt;</p>
<p>&lt;param name = &#8220;aaa&#8221; value=&#8221;val1&#8243; /&gt;</p>
<p>&lt;param name = &#8220;bbb&#8221; value=&#8221;val2&#8243; /&gt;</p>
<p>&lt;param name = &#8220;ccc&#8221; value=&#8221;val3&#8243; /&gt;</p>
<p>&lt;!&#8211;param name = &#8220;&lt;complex_aaa&gt;&#8221; value=&#8221;&lt;attr_val1&gt;,&lt;attr_val2&gt;&#8221; /&#8211;&gt;</p>
<p>&lt;!&#8211;param name = &#8220;&lt;complex_bbb&gt;&#8221; value=&#8221;&lt;attr_val3&gt;,&lt;attr_val4&gt;&#8221; /&#8211;&gt;</p>
<p>&lt;/method&gt;</p>
<p>.<br />
.<br />
.</p>
<p>Some key-points about the above conf are: -</p>
<p>- Each resource-name has a list of parameters associated with it that would define what exactly its associated XML would consist of.</p>
<p>- In case of complex-type params, the value consists of a list of comma-separated attributes.</p>
<p>- Such a definition is readable, easily extensible and configurable.</p>
<p>We would also have a corresponding Config class to read the above XML configuration into a Document (org.w3c.dom.Document) and build a hashMap out of it.</p>
<p>The structure of such a class would be similar to: -</p>
<p><span style="font-style:italic;">public class Configuration {</span></p>
<p>private File configFile;</p>
<p>private Document configDoc;</p>
<p>private String resultNodeName;</p>
<p>public Configuration(String configText){</p>
<p>this.configFile = new File (configText);</p>
<p>this.configDoc = getConfigDocument();<br />
}</p>
<p>public Document getConfigDocument() {</p>
<p>Document XMLDoc = XMLutils.getXMLDocument(configFile);</p>
<p>if (XMLDoc == null) {</p>
<p>System.out.println(&#8221;XMLDoc null&#8221;);</p>
<p>System.exit(-1);<br />
}</p>
<p>String query = &#8220;/configuration&#8221;;</p>
<p>NodeList nl = (NodeList) XMLutils.runXPathQuery(XMLDoc, query);</p>
<p>if(nl.getLength() !=1 ) {</p>
<p>return null;<br />
}</p>
<p>Document responseObject = XMLutils.getNodeAsDocumentRoot(nl.item(0));</p>
<p>return (responseObject == null) ? null : responseObject;<br />
}</p>
<p>public String getResultNodeName() {</p>
<p>return resultNodeName;<br />
}</p>
<p>public HashMap getConfigurationMap (final String resourceName, final String methodName) {</p>
<p>HashMap  configObject = new HashMap  ();</p>
<p>Node temp = this.configDoc.getDocumentElement().getFirstChild();</p>
<p>while(temp != null) {</p>
<p>if(temp.getNodeType() == Node.ELEMENT_NODE) {</p>
<p>if (temp.getAttributes().item(0).getNodeValue().trim().equals(resourceName)) {</p>
<p>NodeList methodList = temp.getChildNodes();</p>
<p>int methodListIndex = 0;</p>
<p>while (methodListIndex &lt; methodList.getLength()) {</p>
<p>if (methodList.item (methodListIndex).getAttributes() == null) {</p>
<p>methodListIndex = methodListIndex + 1;</p>
<p>continue;<br />
}</p>
<p>if (methodList.item (methodListIndex).getAttributes().item(0).getNodeValue().trim().equals(methodName)) {</p>
<p>NodeList paramList = methodList.item(methodListIndex).getChildNodes();</p>
<p>int paramListIndex = 0;</p>
<p>while (paramListIndex &lt; paramList.getLength()) {</p>
<p>if (paramList.item(paramListIndex).getAttributes() == null) {</p>
<p>paramListIndex = paramListIndex + 1;</p>
<p>continue;<br />
}</p>
<p>configObject.put(paramList.item(paramListIndex).getAttributes().item(0).getNodeValue().trim(),<br />
paramList.item(paramListIndex).getAttributes().item(1).getNodeValue().trim());</p>
<p>paramListIndex = paramListIndex + 1;<br />
}<br />
}</p>
<p>methodListIndex = methodListIndex + 1;<br />
}<br />
}<br />
}</p>
<p>temp = temp.getNextSibling();<br />
}</p>
<p>return configObject;<br />
}</p>
<p>}</p>
<p>- Once such a setup is in place, the generateXml method would then build a &#8216;Consolidated Map&#8217; by appending ParamMap to HashMap.</p>
<p>- It would then read the xsd definition and get the in-memory parse tree ready using the module discussed in step (1).</p>
<p>- After that the actual xml generation logic would be invoked, passing the above built Consolidated Map and the resource specifiction.</p>
<p>- The generation logic would iterate through the tree, until it locates the resource spec</p>
<p>- It would then start building the XML, simultaneously referring the Consolidated Map and populating elements whenever it finds a corresponding entry in the Map. The population logic would be written in the corresponding handlers for &#8217;simple&#8217; as well as &#8216;complex&#8217; type nodes.</p>
<p>This would be something similar to: -</p>
<p><span style="font-style:italic;">if(attList.size() &gt; 0) {</span></p>
<p>XSDAttribute att = (XSDAttribute)attList.get(0);</p>
<p>if (consolidatedMap.containsKey(getName())) {</p>
<p>attributeString = consolidatedMap.get(getName()).toString();</p>
<p>StringTokenizer stok = new StringTokenizer (attributeString, &#8220;,&#8221;);</p>
<p>while (stok.hasMoreTokens()) {</p>
<p>buffer.append(&#8221;&lt;&#8221;);</p>
<p>buffer.append (getName() + &#8221; &#8220;);</p>
<p>buffer.append (att.getName());</p>
<p>buffer.append(&#8221;=&#8221;);</p>
<p>buffer.append(&#8221;"&#8221; + stok.nextToken() + &#8220;&#8221;");</p>
<p>buffer.append(&#8221;&gt;&#8221;);</p>
<p>if (consolidatedMap.containsKey(att.getName())) {</p>
<p>buffer.append (consolidatedMap.get(att.getName()));<br />
}</p>
<p>buffer.append(&#8221;<!--");</p-->
<p>buffer.append(getName());</p>
<p>buffer.append(&#8221;&gt;&#8221;);<br />
}</p>
<p>}</p>
<p>return buffer;</p>
<p>Finally, this XML would be returned to the caller and subsequently consumed by the original framework. For extension purposes, the only file to be modified later would be the configuration, which could be easily achieved due to the uniformity and structured nature of the definition. Due to a generic contract specification that only mandates an input parameter-map with name-value pairs of population-parameters, such a framework could be utilized in applications with a consuming UI-front as well as headless command-based apps. We thus saw how an effective configuration-design simplifies a seemingly difficult extension &amp; integration problem.</p>
<p>If you have any suggestions, please drop a note / post.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=A%20Framework%20Description%20for%20Dynamic%20Generation%20of%20XMLs&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F14"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/14/feed</wfw:commentRss>
		</item>
		<item>
		<title>Aggregation, Mashup Creation and Assembly Services</title>
		<link>http://sushain.com/blog/archives/13</link>
		<comments>http://sushain.com/blog/archives/13#comments</comments>
		<pubDate>Mon, 07 Jul 2008 14:09:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[alphaworks]]></category>

		<category><![CDATA[ibm]]></category>

		<category><![CDATA[Mashup]]></category>

		<category><![CDATA[services]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=13</guid>
		<description><![CDATA[Another one of those all-exploratory, info-posts. In case you&#8217;re looking for a Mashup service solution for your enterprise, check these out: -
- alphaworks.ibm.com/tech/mashuphub
- services.alphaworks.ibm.com/damia
- services.alphaworks.ibm.com/qedwiki
^ Excellent assembly canvasses and services to create holistic aggregations and their respective interface components, and in turn giving us yet another instance of an effort towards the unification of the [...]]]></description>
			<content:encoded><![CDATA[<p>Another one of those all-exploratory, info-posts. In case you&#8217;re looking for a Mashup service solution for your enterprise, check these out: -</p>
<p>- <a href="http://www.alphaworks.ibm.com/tech/mashuphub">alphaworks.ibm.com/tech/mashuphub</a></p>
<p>- <a href="http://services.alphaworks.ibm.com/damia/">services.alphaworks.ibm.com/damia</a></p>
<p>- <a href="http://services.alphaworks.ibm.com/qedwiki/">services.alphaworks.ibm.com/qedwiki</a></p>
<p>^ Excellent assembly canvasses and services to create holistic aggregations and their respective interface components, and in turn giving us yet another instance of an effort towards the unification of the random segments.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Aggregation%2C%20Mashup%20Creation%20and%20Assembly%20Services&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F13"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/13/feed</wfw:commentRss>
		</item>
		<item>
		<title>Technical Disclosure</title>
		<link>http://sushain.com/blog/archives/12</link>
		<comments>http://sushain.com/blog/archives/12#comments</comments>
		<pubDate>Wed, 02 Jul 2008 11:57:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[classification]]></category>

		<category><![CDATA[neural networks]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=12</guid>
		<description><![CDATA[You can read the related story here - RSOC Post
Title: A classification approach exploiting the rectangular topology of a floor-plan to determine the location of a mobile user inside premises using only 2 access points.
Detail: This disclosure contains two related ideas. One is the concept that tries to reduce the problem complexity by exploiting the [...]]]></description>
			<content:encoded><![CDATA[<p>You can read the related story here - <a href="http://sushain.blogspot.com/2008/06/anecdote-on-technical-disclosures-and.html">RSOC Post</a></p>
<p><strong>Title:</strong> A classification approach exploiting the rectangular topology of a floor-plan to determine the location of a mobile user inside premises using only 2 access points.</p>
<p><strong>Detail:</strong> This disclosure contains two related ideas. One is the concept that tries to reduce the problem complexity by exploiting the underlying problem domain and the other provides an associated implementation with a classification approach using ANN (Artificial Neural-Networks).</p>
<p>The known solutions to these problems make use of a minimum 3 access-points to determine the location using triangulation. These solutions exploit the fact that the Signal strengths from an access point vary radially, i.e., the signal strength along an imaginary circle of radius &#8216;r&#8217; from the location of the access point (assumed as the focus or center) is constant, say SS(r1), and decreases as we go radially away from the focus. So, if three such access points (APs) are placed randomly, then since 3 different circles can uniquely determine a point in 2-d space, we can locate a test-user based on his relative signal strengths w.r.t those 3 APs. [Refer Fig. 1]</p>
<p><a href="http://bp3.blogger.com/_heXLUxxvwKc/SH3i8w6tC3I/AAAAAAAAASg/Xts9kDSS8Js/s1600-h/1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5223580676370795378" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_heXLUxxvwKc/SH3i8w6tC3I/AAAAAAAAASg/Xts9kDSS8Js/s320/1.JPG" border="0" alt="" /></a></p>
<p>Figure 1. Case when APs are randomly placed (Triangulation).</p>
<p>We try to take advantage of the fact that majority of physical structures, like buildings, organizations, etc, are rectangular in shape (top-view). Now, it is a fact that there is a near complete loss of signal strength when there is an obstruction thicker than 3cm, which is minimum wall thickness in almost all concrete buildings into which such a system may be installed. In theory, the signal strengths from an access point always vary radially and are constant along the circumference of signal strength circles. So, if we place the access-point on a corner, those circles reduce to quadrants (1/4th of a circle), because the other 3/4 of the circle is cut-off by the test-area walls.</p>
<p>Thus, by placing two access points at two of the adjacent corners in such rectangular structures, the &#8220;signal-strength circles&#8221; can be reduced to &#8220;Signal-Strength Quadrants&#8221; as shown in the figure. And thus, we can locate the test-user at the intersection of those two quadrants because any point in the 2d-plane of the building or test-lab can be represented by the set of Signal Strengths from the two Access Points. [Refer Fig. 2]</p>
<p><a href="http://bp2.blogger.com/_heXLUxxvwKc/SH3kAJcfWtI/AAAAAAAAASw/HJwNXfkusZY/s1600-h/1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5223581834006190802" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_heXLUxxvwKc/SH3kAJcfWtI/AAAAAAAAASw/HJwNXfkusZY/s320/1.JPG" border="0" alt="" /></a></p>
<p>Figure 2. Case when APs are places at the adjacent corners of a rectangular test area.</p>
<p>The figure above shows the access point placement at the two &#8216;adjacent&#8217; corners. Now, this figure is meant to portray that, theoretically, in a rectangular test-area, there is a possible arrangement of 2 access points, which would yield a unique intersection of signal strengths and this can serve as a possible premise for any further implementation.</p>
<p>Now, this premise serves as a foundation to prove that an implementation based on this can lead to decent results since, theoretically, we can see that unique points exist for any signal strength pair (SS1, SS2).</p>
<p>In most existing work on the problem of location determination with ‘n’ APs, such a foundation is existent for n &gt;=3, since triangulation comes into picture in those cases. But, that foundation isn&#8217;t obvious when n = 2 when triangulation won’t apply. Most papers describe training their algorithms for different access points (varying from 2 onwards), which is bound to give some results. But, in most cases those results aren’t considerable when we talk of 2 access points, case of a single access points being highly improbable to yield even remotely precise results.</p>
<p><strong>Implementation:</strong> Let us assume that the floor plan of a test building installed with two APs is as shown in Fig. 2. The methodology for determining the location of any Wi-Fi enabled device inside the test premises can then be covered in following phases: -</p>
<p>Phase 1: A set of ‘n’ locations (brown dots) is selected in the building and training data is collected at each of those n points. For each point, a value tuple of the form [SS1, SS2, x, y, Location No], is inserted in the training database, where, SS1 = Signal Strength from AP1, SS2 is signal strength from AP2 &amp; x, y is the abscissa and ordinate respectively considering rectangular coordinate system with reference at the left-bottom of the figure. Here, we may try and filter out null or negative signal strength values. So, we have a database that can later be queried to get the signal strength from each access point at each training position. This process is called data-collection phase and is fairly common in any of the ANN techniques. This data is later used to train the Neural-model as explained below.</p>
<p>Phase 2: In this phase, we try to build a mathematical model for the test area using neural networks. Consider an equation of the form below: -</p>
<p>C = W0 * S1 + W1 * S2 + W2, &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- (I), where C is the Class, W0, W1, W2 are the constant weights (initially they are unknown) and S1, S2 are the variable signal strengths from the two access points. Here [W0, W1, W2] is called the weight matrix and F [S1, S2] is a representation for a function of S1 and S2.</p>
<p>The above equation is a starting assumption that we make in any neural-modeling approach. Now, from phase 1 above, we would have ‘n’ cases (1 for each test-location), where we know the Signal strengths (S1, S2) as well as the class (since we know the location of those 12 training points). So, using these 12 cases, we can try to obtain the value of the Weight matrix in Equation (I). This process is called training of a neural model and this may be thought of as being equivalent to solving 12 simultaneous equations to arrive at the values of 3 variables W0, W1 and W2.</p>
<p>After this training phase, we would get some values of [W0, W1, W2] which would satisfy all the ‘n’ points, i.e., given any signal strength pair (S1, S2), it would locate it properly in the correct class. Then we reason from the fact that since our model is trained enough to classify points in the lab in question, so given a signal strength value pair from any other point as well (different from those ‘n’ training points), it would still locate it correctly in the appropriate class. This approach essentially tries to find and exploit any pattern that is present in the signal strength distribution for this particular test-lab.</p>
<p>Now, we divide the floor plan into topological regular classes (rectangular, hexagonal, etc). Let me explain these models a bit in detail. Consider Fig. 3.</p>
<p><a href="http://bp3.blogger.com/_heXLUxxvwKc/SH3li_f1z3I/AAAAAAAAAS4/9UeP7i9qEhM/s1600-h/1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5223583532142940018" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_heXLUxxvwKc/SH3li_f1z3I/AAAAAAAAAS4/9UeP7i9qEhM/s320/1.JPG" border="0" alt="" /></a></p>
<p>Figure 3. Basic classification model</p>
<p>As shown, let us assume that our first model (M1) is such that it classifies the test-floor into three classes (Class1, Class2 and Class3). Now, let us consider a test-point P. For this point, we would compute the signal strength tuple (SS1, SS2). Now, substituting these in the corresponding equation (like the one described in (I) above) for this model (M1), we will get a value for the Class, ‘C’. For this point, lets assume the class comes out as Class1 as shown in the figure. So, this way the floor-area in classes - Class2 and Class3 is eliminated and we can now focus on area under Class1.</p>
<p>Now, let us consider a second model (M2) being superimposed over M1, which is as shown in fig. 4.</p>
<p><a href="http://bp0.blogger.com/_heXLUxxvwKc/SH3l-kDf8SI/AAAAAAAAATA/vPlzk57yFUQ/s1600-h/1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5223584005812646178" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_heXLUxxvwKc/SH3l-kDf8SI/AAAAAAAAATA/vPlzk57yFUQ/s320/1.JPG" border="0" alt="" /></a></p>
<p>Figure 4. Superimposed classification models</p>
<p>This model classifies the test-floor in a different way as shown by the class-names in red. So, by feeding the signal strength value pair for the test-point P, we would get the class as Class 3. So, our investigations can further reduce to the intersection of Class 3 of model 2 and Class 1 of model 1, i.e., essentially the shaded region. Going on applying 2-3 more models, we can pin point the location of the test-point (P) to a very narrow corridor within an acceptable error-margin.</p>
<p>So, the idea is to have these models, i.e., these equations (of form (I)) prepared in phase 2 and then just use the appropriate or all models for a test-point to narrow down its location. This overall approach was found to locate a test-user within a 3-meter error-margin in the average case with only 2 access points placed as indicated in Fig. 2.</p>
<p>You can view this on ip.com @ <a href="http://www.priorartdatabase.com/IPCOM/000168722/"> IPCOM000168722</a></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Technical%20Disclosure&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F12"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/12/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
