Skip to content

Commit

Permalink
gradient_boosted_model data - styling
Browse files Browse the repository at this point in the history
  • Loading branch information
asaf schers committed Feb 9, 2018
1 parent f16f220 commit 38fe7a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/scoruby/models/gradient_boosted_model/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def continuous_features
end

def categorical_features
puts target
@categorical_features ||= fetch_categorical_features
end

Expand All @@ -41,17 +40,18 @@ def fetch_continuous_features

def fetch_categorical_features
@xml.xpath('//DataField')
.select { |xml| xml.attr('optype') == 'categorical' }
.reject { |xml| xml.attr('name') == target }
.each_with_object(Hash.new([])) do |xml, res|
res[xml.attr('name').to_sym] = xml.xpath('Value').map { |xml| xml.attr('value') }
.select { |xml| xml.attr('optype') == 'categorical' }
.reject { |xml| xml.attr('name') == target }
.each_with_object(Hash.new([])) do |xml, res|
res[xml.attr('name').to_sym] = xml.xpath('Value')
.map { |xml| xml.attr('value') }
end
end

def target
@target ||= @xml.xpath('//MiningField')
.find { |xml| xml.attr('usageType') == 'target' }
.attr('name').to_s
.find { |xml| xml.attr('usageType') == 'target' }
.attr('name').to_s
end

def const_by_version
Expand Down

0 comments on commit 38fe7a9

Please sign in to comment.