movieDB 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/movieDB.rb +8 -9
- data/lib/movieDB/base.rb +1 -1
- data/lib/movieDB/data_analysis.rb +127 -0
- data/lib/movieDB/version.rb +1 -1
- data/movieDB.gemspec +2 -3
- data/spec/movieDB_spec.rb +0 -1
- data/spec/spec_helper.rb +4 -6
- metadata +6 -23
- data/lib/movieDB/business_intelligence.rb +0 -16
- data/lib/movieDB/confirmatory_data_analysis.rb +0 -16
- data/lib/movieDB/data_mining.rb +0 -48
- data/lib/movieDB/descriptive_statistic.rb +0 -0
- data/lib/movieDB/exploratory_data_analysis.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47a6b5c9b4e330fe911c6e9e1374767c5dc26208
|
4
|
+
data.tar.gz: aba7b9074ec6759e349e4bf49379725903107c9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c44775435f1b8eda891c8b9a484cd49fc9ca0d7423acc3fa3a1018251d785e2c2d8f771006595e659602ebd2cc867fe4a385c5f969f2c26807f6f5d7245c7961
|
7
|
+
data.tar.gz: f36907d783dbd939bf01171b2b797cb9196d8d5d44eafeafba2209838e9d4d33cdb6d18783dfcf1cda673c963156afa7077e6cabc78326615a3c0dc683dffa4b
|
data/README.md
CHANGED
@@ -2,13 +2,11 @@
|
|
2
2
|
|
3
3
|
## Description
|
4
4
|
|
5
|
-
|
5
|
+
Although the name may suggest a datastore gem, MovieDB is rather a ruby wrapper that inspects, cleans, transform and model imdb data and provides useful information, suggesting conclusion.
|
6
6
|
The objective is to help movie/film producers make decisions based on archival data.
|
7
7
|
|
8
8
|
Basic functions and Data Analysis:
|
9
|
-
* Data
|
10
|
-
* Business Intelligence
|
11
|
-
* Descriptive Satistics
|
9
|
+
* Data Analysis
|
12
10
|
* Exploratory Data Analysis
|
13
11
|
* Confirmatory Data Analysis
|
14
12
|
|
data/lib/movieDB.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require 'time'
|
4
|
-
require 'MovieDB/base'
|
1
|
+
require "rubygems"
|
2
|
+
require "time"
|
5
3
|
require "open-uri"
|
6
|
-
require
|
4
|
+
require "nokogiri"
|
7
5
|
require "imdb"
|
8
|
-
require "
|
9
|
-
require "
|
6
|
+
require "spreadsheet"
|
7
|
+
require "MovieDB/base"
|
8
|
+
require "MovieDB/data_analysis"
|
10
9
|
|
11
10
|
##
|
12
11
|
# Create a new movie record. The values are stored in the key-value data store.
|
@@ -29,7 +28,7 @@ unless defined? MovieDB::Movie
|
|
29
28
|
|
30
29
|
const_set("MovieError", Class.new(StandardError))
|
31
30
|
|
32
|
-
attr_accessor :title, :cast, :director, :released_date, :
|
31
|
+
attr_accessor :title, :cast, :director, :released_date, :film_release, :writer,
|
33
32
|
:unique_id, :genre, :academy_award_nomination, :academy_award_wins, :golden_globe_nominations, :golden_globe_wins,
|
34
33
|
:bafta_nomination, :bafta_wins, :worldwide_gross
|
35
34
|
alias :released? :film_release
|
@@ -51,7 +50,7 @@ unless defined? MovieDB::Movie
|
|
51
50
|
DEFAULT_WORLDWIDE_GROSS = "$9750 Million"
|
52
51
|
|
53
52
|
def initialize(attributes = {})
|
54
|
-
movie_attr = %w(title cast director
|
53
|
+
movie_attr = %w(title cast director re leased_date film_release writer unique_id
|
55
54
|
genre academy_award_nomination academy_award_wins golden_globe_nominations
|
56
55
|
golden_globe_wins bafta_nomination bafta_wins worldwide_gross)
|
57
56
|
movie_attr.each do |attr|
|
data/lib/movieDB/base.rb
CHANGED
@@ -3,7 +3,7 @@ require 'MovieDB/status_checker'
|
|
3
3
|
require 'MovieDB/movie_error'
|
4
4
|
|
5
5
|
module MovieDB #:nodoc
|
6
|
-
# MoviesDB v0.1.
|
6
|
+
# MoviesDB v0.1.x is not a datastore gem. Rather is performs mathematical computations for analyzing film data from imdb. can manage the data store of pre-production, production and final film releases.
|
7
7
|
# Its a solution to the common problem of building a multi-database that utilizes both SQL and NoSQL
|
8
8
|
# combined features to increase speed and performance for reading records.
|
9
9
|
class Base
|
@@ -0,0 +1,127 @@
|
|
1
|
+
module MovieDB
|
2
|
+
|
3
|
+
##
|
4
|
+
# Analysing, inspecting, cleaning, transforming and modeling data.
|
5
|
+
|
6
|
+
class DataAnalysis
|
7
|
+
module AnalysisOfVariance
|
8
|
+
module LeastSquares
|
9
|
+
module Coefficient_Of_Determination; end
|
10
|
+
module Discrete_Least_Squares_Meshless_Method; end
|
11
|
+
module Explained_Sum_Of_Squares; end
|
12
|
+
module Fraction_Of_Variance_Unexplained; end
|
13
|
+
module Gauss_Newton_Algorithm; end
|
14
|
+
module Iteratively_Reweighted_Least_Squares; end
|
15
|
+
module Lack_Of_Fit_Sum_Of_Squares; end
|
16
|
+
module Least_Squares_Support_Vector_Machine; end
|
17
|
+
module Mean_Squared_Error; end
|
18
|
+
module Moving_Least_Squares; end
|
19
|
+
module Non_Linear_Iterative_Partial_Least_Squares; end
|
20
|
+
module Non_Linear_Least_Squares; end
|
21
|
+
module Ordinary_Least_Squares; end
|
22
|
+
module Partial_Least_Squares_Regression; end
|
23
|
+
module Partition_Of_Sums_Of_Squares; end
|
24
|
+
module Proofs_Involving_Ordinary_Least_Squares; end
|
25
|
+
module Residual_Sum_Of_Squares; end
|
26
|
+
module Total_Least_Squares; end
|
27
|
+
module Total_Sum_Of_Squares; end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module EstimationOfDensit
|
32
|
+
module Cluster_Weighted_Modeling; end
|
33
|
+
module Density_Estimation; end
|
34
|
+
module Discretization_Of_Continuous_Features; end
|
35
|
+
module Mean_Integrated_Squared_Error; end
|
36
|
+
module Multivariate_Kernel_Density_Estimation; end
|
37
|
+
module Variable_Kernel_Density_Estimation; end
|
38
|
+
end
|
39
|
+
|
40
|
+
##
|
41
|
+
# primarily EDA is for seeing what the data can
|
42
|
+
# tell us beyond the formal modeling or hypothesis testing task
|
43
|
+
# The output will be a visual material
|
44
|
+
|
45
|
+
module ExploratoryDataAnalysis
|
46
|
+
module Data_Reduction; end
|
47
|
+
module Table_Diagonalization; end
|
48
|
+
module Configural_Frequency_Analysis; end
|
49
|
+
module Median_Polish; end
|
50
|
+
module Stem_And_Leaf_Display; end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
module Data_Mining
|
55
|
+
module Applied_DataMining; end
|
56
|
+
module Cluster_Analysis; end
|
57
|
+
module Dimension_Reduction; end
|
58
|
+
module Applied_DataMining; end
|
59
|
+
end
|
60
|
+
|
61
|
+
module RegressionAnalysis
|
62
|
+
module Choice_Modelling; end
|
63
|
+
|
64
|
+
module Generalized_Linear_Model
|
65
|
+
module Binomial_Regression; end
|
66
|
+
module Generalized_Additive_Model; end
|
67
|
+
module Linear_Probability_Model; end
|
68
|
+
module Poisson_Regression; end
|
69
|
+
module Zero_Inflated_Model; end
|
70
|
+
end
|
71
|
+
|
72
|
+
module Nonparametric_Regression; end
|
73
|
+
module Statistical_Outliers; end
|
74
|
+
module Regression_And_Curve_Fitting_Software; end
|
75
|
+
module Regression_Diagnostics; end
|
76
|
+
module Regression_Variable_Selection; end
|
77
|
+
module Regression_With_Time_Series_Structure; end
|
78
|
+
module Robust_Regression; end
|
79
|
+
module Choice_Modeling; end
|
80
|
+
end
|
81
|
+
|
82
|
+
module Resampling
|
83
|
+
module Bootstrapping_Population; end
|
84
|
+
end
|
85
|
+
|
86
|
+
module Sensitivity_Analysis
|
87
|
+
module Variance_Based_Sensitivity_Analysis; end
|
88
|
+
module Elementary_Effects_Method; end
|
89
|
+
module Experimental_Uncertainty_Analysis; end
|
90
|
+
module Fourier_Amplitude_Sensitivity_Testing; end
|
91
|
+
module Hyperparameter; end
|
92
|
+
end
|
93
|
+
|
94
|
+
module Time_series_Analysis
|
95
|
+
module Frequency_Deviation; end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
#TODO: Add all more analysis
|
101
|
+
class ExportData
|
102
|
+
def printout (data, data_analysis_name)
|
103
|
+
|
104
|
+
begin data_analysis.is_a? String
|
105
|
+
data_analysis_name = data_analysis_name.split.join.gsub('_', ' ').downcase.to_s
|
106
|
+
|
107
|
+
case data_analysis_name
|
108
|
+
when "coefficient of determination"
|
109
|
+
book = Spreadsheet::Workbook.new
|
110
|
+
sheet1 = book.create_worksheet name: "Data Analysis: #{data_analysis_name}"
|
111
|
+
sheet1.row(0).concat %w{title released_date worldwide_gross}
|
112
|
+
|
113
|
+
# Loop through the data to collect all values.
|
114
|
+
# Then values into array
|
115
|
+
|
116
|
+
data.each_with_index do |value, index|
|
117
|
+
sheet1[1, index] = "#{value}"
|
118
|
+
end
|
119
|
+
when "discrete least squares meshless method"
|
120
|
+
else
|
121
|
+
end
|
122
|
+
rescue
|
123
|
+
raise ArgumentError, 'invalid attribute'
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
data/lib/movieDB/version.rb
CHANGED
data/movieDB.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = MovieDB::VERSION
|
9
9
|
spec.authors = ["Albert_McKeever"]
|
10
10
|
spec.email = ["kotn_ep1@hotmail.com"]
|
11
|
-
spec.description = %q{Collect Movie Information. Perform Data Analysis}
|
11
|
+
spec.description = %q{Collect Movie Information. Perform Confirmatory and Exploratory Data Analysis}
|
12
12
|
spec.summary = %q{Movie Statistic and Data Analysis}
|
13
13
|
spec.homepage = "https://github.com/keeperofthenecklace/movieDB"
|
14
14
|
spec.license = "MIT"
|
@@ -23,8 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "rspec"
|
24
24
|
spec.add_development_dependency 'imdb'
|
25
25
|
spec.add_development_dependency 'highline'
|
26
|
-
spec.add_development_dependency 'yaml'
|
27
26
|
spec.add_development_dependency 'fakeweb'
|
28
27
|
spec.add_dependency "activesupport", ">= 4.0.0"
|
29
|
-
spec.add_dependency "
|
28
|
+
spec.add_dependency "spreadsheet"
|
30
29
|
end
|
data/spec/movieDB_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
$:.unshift File.expand_path('..', __FILE__)
|
2
2
|
$:.unshift File.expand_path('../../lib/', __FILE__)
|
3
|
-
|
3
|
+
require 'movieDB'
|
4
4
|
require 'MovieDB/base'
|
5
|
+
require "MovieDB/person"
|
5
6
|
require 'MovieDB/status_checker'
|
6
7
|
require 'MovieDB/movie_error'
|
7
|
-
require
|
8
|
-
require 'movieDB'
|
9
|
-
|
10
|
-
require 'simple_bdd'
|
8
|
+
require "MovieDB/data_analysis"
|
11
9
|
|
12
10
|
RSpec.configure do |config|
|
13
|
-
config.include SimpleBdd
|
11
|
+
# config.include SimpleBdd
|
14
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: movieDB
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Albert_McKeever
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: yaml
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: fakeweb
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,7 +109,7 @@ dependencies:
|
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: 4.0.0
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: spreadsheet
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - ">="
|
@@ -136,7 +122,8 @@ dependencies:
|
|
136
122
|
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
|
-
description: Collect Movie Information. Perform Data
|
125
|
+
description: Collect Movie Information. Perform Confirmatory and Exploratory Data
|
126
|
+
Analysis
|
140
127
|
email:
|
141
128
|
- kotn_ep1@hotmail.com
|
142
129
|
executables: []
|
@@ -150,11 +137,7 @@ files:
|
|
150
137
|
- Rakefile
|
151
138
|
- lib/movieDB.rb
|
152
139
|
- lib/movieDB/base.rb
|
153
|
-
- lib/movieDB/
|
154
|
-
- lib/movieDB/confirmatory_data_analysis.rb
|
155
|
-
- lib/movieDB/data_mining.rb
|
156
|
-
- lib/movieDB/descriptive_statistic.rb
|
157
|
-
- lib/movieDB/exploratory_data_analysis.rb
|
140
|
+
- lib/movieDB/data_analysis.rb
|
158
141
|
- lib/movieDB/genre_parser.rb
|
159
142
|
- lib/movieDB/genres/en.txt
|
160
143
|
- lib/movieDB/movie_error.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
##
|
3
|
-
#TODO:Work-In_Porgress
|
4
|
-
|
5
|
-
module MovieDB
|
6
|
-
|
7
|
-
class BusinessIntelligence
|
8
|
-
attr_accessor :movie_id1, :movie_id2
|
9
|
-
|
10
|
-
def initialize(movie_id1 = nil, movie_id2 = nil)
|
11
|
-
@movie_id1 = Imdb::Movie.new(movie_id1)
|
12
|
-
@movie_id2 = Imdb::Movie.new(movie_id2)
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
##
|
3
|
-
#TODO:Work-In_Porgress
|
4
|
-
|
5
|
-
module MovieDB
|
6
|
-
|
7
|
-
class ConfirmatoryDataAnalysis
|
8
|
-
attr_accessor :movie_id1, :movie_id2
|
9
|
-
|
10
|
-
def initialize(movie_id1 = nil, movie_id2 = nil)
|
11
|
-
@movie_id1 = Imdb::Movie.new(movie_id1)
|
12
|
-
@movie_id2 = Imdb::Movie.new(movie_id2)
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
data/lib/movieDB/data_mining.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
|
2
|
-
## Reference imdb gem
|
3
|
-
#TODO:Work-In_Porgress
|
4
|
-
|
5
|
-
module MovieDB
|
6
|
-
|
7
|
-
class DataMining
|
8
|
-
attr_accessor :movie_id1, :movie_id2
|
9
|
-
|
10
|
-
def initialize(movie_id1 = nil, movie_id2 = nil)
|
11
|
-
@movie_id1 = Imdb::Movie.new(movie_id1)
|
12
|
-
@movie_id2 = Imdb::Movie.new(movie_id2)
|
13
|
-
end
|
14
|
-
|
15
|
-
def series(value)
|
16
|
-
if value is_a? Integer
|
17
|
-
begin
|
18
|
-
@serie = Imdb::Serie.new(value.to_s)
|
19
|
-
|
20
|
-
rescue
|
21
|
-
end
|
22
|
-
else
|
23
|
-
raise ArgumentError, "value is not an integer"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def analyse_title
|
28
|
-
@episode.title
|
29
|
-
end
|
30
|
-
|
31
|
-
def analyse_season_number(season_num, episode_integer)
|
32
|
-
@season = @serie.seasons.first
|
33
|
-
@episode = @season.episode(integer)
|
34
|
-
end
|
35
|
-
|
36
|
-
def analyse_episode_number
|
37
|
-
@episode.episode
|
38
|
-
end
|
39
|
-
|
40
|
-
def analyse_plot
|
41
|
-
@episode.plot
|
42
|
-
end
|
43
|
-
|
44
|
-
def analyse_air_date
|
45
|
-
@episode.air_date
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
File without changes
|
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
##
|
3
|
-
#TODO:Work-In_Porgress
|
4
|
-
|
5
|
-
module MovieDB
|
6
|
-
|
7
|
-
class ExploratoryDataAnalysis
|
8
|
-
attr_accessor :movie_id1, :movie_id2
|
9
|
-
|
10
|
-
def initialize(movie_id1 = nil, movie_id2 = nil)
|
11
|
-
@movie_id1 = Imdb::Movie.new(movie_id1)
|
12
|
-
@movie_id2 = Imdb::Movie.new(movie_id2)
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|