Method: Nimbus::ClassificationTree#seed
- Defined in:
- lib/nimbus/classification_tree.rb
#seed(all_individuals, individuals_sample, ids_fenotypes) ⇒ Object
Creates the structure of the tree, as a hash of SNP splits and values.
It just initializes the needed variables and then defines the first node of the tree. The rest of the structure of the tree is computed recursively building every node calling build_node
.
30 31 32 33 |
# File 'lib/nimbus/classification_tree.rb', line 30 def seed(all_individuals, individuals_sample, ids_fenotypes) super @structure = build_node individuals_sample, Nimbus::LossFunctions.majority_class(individuals_sample, @id_to_fenotype, @classes) end |