Class: LogAnalysis
- Inherits:
-
Object
- Object
- LogAnalysis
- Defined in:
- lib/log_analysis.rb,
lib/log_analysis/version.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
'0.1.5'.freeze
- TRANSFORM_DATA_PATH =
"transform_data_#{Time.now.strftime('%Y%m%d')}.txt".freeze
- RULE_FILE_PATH =
"output_#{Time.now.strftime('%Y%m%d')}.txt".freeze
- MAP_URI_FILE_PATH =
"map_uri_#{Time.now.strftime('%Y%m%d')}.txt".freeze
- JAR_FILE_PATH =
File.join(File.dirname(__FILE__), './files/spmf.jar')
- DATA_PATH =
File.('data/log_analysis', '~')
Instance Attribute Summary collapse
-
#conf ⇒ Object
Your code goes here…
-
#match_uri ⇒ Object
Your code goes here…
-
#origin_data ⇒ Object
Your code goes here…
-
#path ⇒ Object
Your code goes here…
-
#sup ⇒ Object
Your code goes here…
-
#type ⇒ Object
Your code goes here…
Instance Method Summary collapse
- #data_mining ⇒ Object
-
#initialize(path, type = nil) ⇒ LogAnalysis
constructor
A new instance of LogAnalysis.
- #intepretation ⇒ Object
- #preprocessing_data ⇒ Object
- #selecting_data ⇒ Object
- #transformation ⇒ Object
Constructor Details
#initialize(path, type = nil) ⇒ LogAnalysis
Returns a new instance of LogAnalysis.
16 17 18 19 20 |
# File 'lib/log_analysis.rb', line 16 def initialize(path, type = nil) @path = path @type = type @origin_data = LoadingData.input(path, type) end |
Instance Attribute Details
#conf ⇒ Object
Your code goes here…
14 15 16 |
# File 'lib/log_analysis.rb', line 14 def conf @conf end |
#match_uri ⇒ Object
Your code goes here…
14 15 16 |
# File 'lib/log_analysis.rb', line 14 def match_uri @match_uri end |
#origin_data ⇒ Object
Your code goes here…
14 15 16 |
# File 'lib/log_analysis.rb', line 14 def origin_data @origin_data end |
#path ⇒ Object
Your code goes here…
14 15 16 |
# File 'lib/log_analysis.rb', line 14 def path @path end |
#sup ⇒ Object
Your code goes here…
14 15 16 |
# File 'lib/log_analysis.rb', line 14 def sup @sup end |
#type ⇒ Object
Your code goes here…
14 15 16 |
# File 'lib/log_analysis.rb', line 14 def type @type end |
Instance Method Details
#data_mining ⇒ Object
39 40 41 42 43 |
# File 'lib/log_analysis.rb', line 39 def data_mining @conf ||= 0.5 @sup ||= 60 DataMining.execute(transformation, @conf, @sup) end |
#intepretation ⇒ Object
45 46 47 |
# File 'lib/log_analysis.rb', line 45 def intepretation Intepretation.execute(data_mining) end |
#preprocessing_data ⇒ Object
28 29 30 31 32 33 |
# File 'lib/log_analysis.rb', line 28 def preprocessing_data filter = selecting_data.select { |record| record.status_200? && record.method_get? && record.uri_without_data && !record.robot? } user = UserIdentification.execute(filter) session = SessionIdentification.execute(user) session end |
#selecting_data ⇒ Object
22 23 24 25 26 |
# File 'lib/log_analysis.rb', line 22 def selecting_data return @origin_data if @match_uri.nil? @origin_data.select { |record| record.uri.match?(@match_uri) } end |
#transformation ⇒ Object
35 36 37 |
# File 'lib/log_analysis.rb', line 35 def transformation Transformation.execute(preprocessing_data) end |