<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments on: What&#8217;s the point of inheritance in python ?</title>
	<atom:link href="http://forthescience.org/blog/2009/02/13/whats-the-point-of-inheritance-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://forthescience.org/blog/2009/02/13/whats-the-point-of-inheritance-in-python/</link>
	<description>A blog about science and programming</description>
	<lastBuildDate>Fri, 30 Sep 2011 10:15:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: ilya n</title>
		<link>http://forthescience.org/blog/2009/02/13/whats-the-point-of-inheritance-in-python/comment-page-1/#comment-6067</link>
		<dc:creator>ilya n</dc:creator>
		<pubDate>Mon, 01 Jun 2009 23:28:29 +0000</pubDate>
		<guid isPermaLink="false">http://forthescience.org/blog/?p=64#comment-6067</guid>
		<description>I like your question. Maybe you could post it verbatim on stackoverflow?</description>
		<content:encoded><![CDATA[<p>I like your question. Maybe you could post it verbatim on stackoverflow?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keybo</title>
		<link>http://forthescience.org/blog/2009/02/13/whats-the-point-of-inheritance-in-python/comment-page-1/#comment-3918</link>
		<dc:creator>Keybo</dc:creator>
		<pubDate>Sun, 15 Feb 2009 16:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://forthescience.org/blog/?p=64#comment-3918</guid>
		<description>I have recently had to use inheritance to deal with  running equations  over a data set in python. And it involved running a set of different types of equations over the same set. Therefore almost all of the functions for each of these equation classes were the same (such as extracting the data, setting the test and training sets, calculating precision and recall) of course apart from the main equation.

This probably could have been done another way, but the way I did it was write a &quot;generalEquation &quot; class. And then for each of the &quot;other generalEquation&quot; classes I just overwrote the equation function.

So it went something like this:
Class generalEquation():
      ...
          
          def processData():
               setVariables()
                extractData() 
                normalizeData()
                runEquation()
                CalculatePrecissionRecall()
   ...

Class EquationA(generalEquation):
          def runEquation():
                 equationA()
 
Class EquationB(generalEquation):
          def runEquation():
                 equationB()

EDIT Stefano: fixed typo in comment on poster&#039;s request</description>
		<content:encoded><![CDATA[<p>I have recently had to use inheritance to deal with  running equations  over a data set in python. And it involved running a set of different types of equations over the same set. Therefore almost all of the functions for each of these equation classes were the same (such as extracting the data, setting the test and training sets, calculating precision and recall) of course apart from the main equation.</p>
<p>This probably could have been done another way, but the way I did it was write a &#8220;generalEquation &#8221; class. And then for each of the &#8220;other generalEquation&#8221; classes I just overwrote the equation function.</p>
<p>So it went something like this:<br />
Class generalEquation():<br />
      &#8230;</p>
<p>          def processData():<br />
               setVariables()<br />
                extractData()<br />
                normalizeData()<br />
                runEquation()<br />
                CalculatePrecissionRecall()<br />
   &#8230;</p>
<p>Class EquationA(generalEquation):<br />
          def runEquation():<br />
                 equationA()</p>
<p>Class EquationB(generalEquation):<br />
          def runEquation():<br />
                 equationB()</p>
<p>EDIT Stefano: fixed typo in comment on poster&#8217;s request</p>
]]></content:encoded>
	</item>
</channel>
</rss>

