-
Notifications
You must be signed in to change notification settings - Fork 0
/
gene.py
28 lines (21 loc) · 853 Bytes
/
gene.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import random
class Gene:
def __init__( self, col_by_tree, subsample, min_child_weight, max_depth, n_estimators,
learning_rate, way, n_neighbors ):
self.col_by_tree = col_by_tree
self.subsample = subsample
self.min_child_weight = min_child_weight
self.max_depth = max_depth
self.n_estimators = n_estimators
self.learning_rate = learning_rate
self.way = way
self.n_neighbors = n_neighbors
self.level = None
def to_str( self ):
print( "gene: \ncbt: " + str( self.col_by_tree ) + " -- subs" + str( self.subsample )
+ " -- mcw" + str( self.min_child_weight ) + "-- max_depth: "
+ str( self.max_depth )
+ "-- nest " + str( self.n_estimators ) + "-- way: " + str( self.way )
+ "-- neighbs " + str( self.n_neighbors ) + "; level: " + str( self.level ) )
def set_fitness_level( self, l ):
self.level = l