karl3ļ¼ writeme.com wrote:
> > def EmptyDecisionTree:
> > def __init__(self):
> > pass
> > def perform_work(self):
> > return True
> > def get_score(self):
> > return "score: decision tree is completely empty"
> class EmptyDecisionTreeOfEmptyDecisionTrees:
> def __init__(self, min_number_children, max_number_children):
> nch = int(random.random() * (max_number_children - min_number_children))
> self.children = [EmptyDecisionTree(min(min_number_children//2,0),
> min(max_number_children//2,0)) for x in range(
>
> # hey i noticed (again) a lot of inhibition is associated with implementing
> utility code
> # i'm thinking on how the urgent behaviors that make smidges of result-like
> things are really intense and urgent, and tend to be really comfortable with
> leaving contexts
> # but in computer code we do accumulate utility libraries [.... maybe really
> useful to clarify and reinforce that utility libraries are how to do things
> professionally in computer code. even a baby utility library is helpful
here rand()*(max-min)+min is encapsulated in random.randint() in python.
however, i have changed and i don't remember that readily [anym
--
class EmptyDecisionTreeOfEmptyDecisionTrees:
def __init__(self, min_children, max_children):
nch = random.randint(min_children, max_children)
self.children = [EmptyDecisionTree(min_children//2,max_children//2) for
chidx in range(nch)]
def perform_work(self):
print("all of my subparts are empty i will skip thinking about them right
now")
def get_score(self):
print("i am an empty decision tree i can't have a score")