<br><div>Quine-McCluskey isn't too bad to do once or twice by hand, but if you change even one row in your dataset, you'll have to repeat the ENTIRE Q-M algorithm. It gets very tedious. For your application, I'd just use a hash table. You dont need the reduced form of your data, you just need a look-up table. It's a bit tedious to do by hand, but it will be much easier to change later.... for example, if (a,b,c,d,e,f) represents the 6 parameters as a tuple, then:</div>
<div><br></div><div># my_decision_tree.py - a module that gives a decision based on these data....</div><div># Decision table encoded</div><div>datarow = {}</div><div><div>datarow[(0,0,0,0,0,0)] = 0</div><div><div>datarow[(0,0,0,0,0,1)] = 1</div>
<div><div>datarow[(0,0,0,0,1,0)] = 0</div><div><div>datarow[(0,0,0,0,1,1)] = 1</div><div><div>datarow[(0,0,0,1,0,0)] = 1</div><div># .....</div></div></div></div></div></div><div>def get_decision(a,b,c,d,e,f):</div><div>
# Helper-function </div><div> return datarow[(a,b,c,d,e,f)]</div><div><br></div><div>Or you could assign functions:</div><div><div><div><div>datarow[(0,0,0,0,0,0)] = function1</div><div><div>datarow[(0,0,0,0,0,0)] = function7</div>
<div><br class="webkit-block-placeholder"></div></div></div><div>or lists</div><div><div>datarow[(0,0,0,0,0,1)] = [ True, False, "Andrew Jackson" ]</div><div><div><br></div><div><div>or whatever value you really want to return based on the input.</div>
<div><br class="webkit-block-placeholder"></div><div>You could create a Python script that would generate the 64 lines so all you have to do is manually set what each line evaluates to.... Again, this seems easier than trying to do Q-M by hand!</div>
<div><br class="webkit-block-placeholder"></div><div>Jared</div><div><br class="webkit-block-placeholder"></div><div></div></div></div></div></div></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><div>
On 5 Feb 2008, at 06:31, Robin Becker wrote:</div><blockquote type="cite">Diez B. Roggisch wrote:<br><blockquote type="cite">Robin Becker wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
.......<br></blockquote><blockquote type="cite"><blockquote type="cite">terms or something, but perhaps I am daft.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Triggered this in some deep-rootet parts of my brain stem:<br>
</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="http://en.wikipedia.org/wiki/Quine-McCluskey_algorithm">http://en.wikipedia.org/wiki/Quine-McCluskey_algorithm</a><br></blockquote>.....<br>
seems like the sort of thing I can deal with though at least for this small case.<br>-- <br>Robin Becker<br><br>-- <br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a></blockquote>
<div><br class="webkit-block-placeholder"></div></span></div>