statsample-glm 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/History.md +4 -0
- data/README.md +2 -2
- data/lib/statsample-glm/version.rb +1 -1
- data/spec/logistic_spec.rb +2 -0
- data/spec/normal_spec.rb +2 -2
- data/spec/probit_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37980f21ccbc50f8209e87f6e8a43d9d892f2875
|
4
|
+
data.tar.gz: c5854b2c3373ec2cb2f762e113c5d8f9b50f4604
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102e56937c6fe6f7f0420a3ced748de3500a9bf2e680f19f8eb42e0d5da87c6fcbd1e7c3fd40450c8cb4be177624d003e70c053fbfa99955f10598ef3192692c
|
7
|
+
data.tar.gz: 5adc91192f07d76892ea16fef13d5a8b88025f1747b8423697eaef252ccd0a45e2c72bd62898af4e757f4e46b1af4d3ef19fdd3d77b85114aed578e96fd44d68
|
data/.travis.yml
CHANGED
data/History.md
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Statsample-glm includes the following Generalized Linear Models:
|
|
20
20
|
* Probit Regression
|
21
21
|
* Normal Regression
|
22
22
|
|
23
|
-
Statsample-GLM was created by Ankur Goel as part of Google's Summer of Code 2013. It is the part of
|
23
|
+
Statsample-GLM was created by Ankur Goel as part of Google's Summer of Code 2013. It is the part of [the SciRuby Project](http://sciruby.com).
|
24
24
|
|
25
25
|
## Installation
|
26
26
|
|
@@ -43,7 +43,7 @@ To use the library
|
|
43
43
|
|
44
44
|
## Documentation
|
45
45
|
|
46
|
-
The API doc is
|
46
|
+
The API doc is [online](http://rubygems.org/gems/statsample-glm). For more code examples see also the spec files in the source tree.
|
47
47
|
|
48
48
|
## Project home page
|
49
49
|
|
data/spec/logistic_spec.rb
CHANGED
@@ -4,6 +4,7 @@ describe Statsample::GLM::Logistic do
|
|
4
4
|
context "IRLS algorithm" do
|
5
5
|
before do
|
6
6
|
@data_set = Daru::DataFrame.from_csv "spec/data/logistic.csv"
|
7
|
+
@data_set.vectors = Daru::Index.new([:x1,:x2,:y])
|
7
8
|
@glm = Statsample::GLM.compute @data_set, :y, :logistic, {constant: 1}
|
8
9
|
end
|
9
10
|
|
@@ -22,6 +23,7 @@ describe Statsample::GLM::Logistic do
|
|
22
23
|
context "MLE algorithm" do
|
23
24
|
before do
|
24
25
|
@data_set = Daru::DataFrame.from_csv("spec/data/logistic_mle.csv")
|
26
|
+
@data_set.vectors = Daru::Index.new([:a,:b,:c,:y])
|
25
27
|
@glm = Statsample::GLM.compute @data_set,:y, :logistic, {constant: 1, algorithm: :mle}
|
26
28
|
end
|
27
29
|
|
data/spec/normal_spec.rb
CHANGED
@@ -3,11 +3,11 @@ describe Statsample::GLM::Normal do
|
|
3
3
|
before do
|
4
4
|
# Below data set taken from http://dl.dropbox.com/u/10246536/Web/RTutorialSeries/dataset_multipleRegression.csv
|
5
5
|
@ds = Daru::DataFrame.from_csv "spec/data/normal.csv",
|
6
|
-
order: [
|
6
|
+
order: ['ROLL', 'UNEM', 'HGRAD', 'INC']
|
7
7
|
end
|
8
8
|
|
9
9
|
it "reports correct values as an array", focus: true do
|
10
|
-
@glm = Statsample::GLM.compute @ds,
|
10
|
+
@glm = Statsample::GLM.compute @ds, 'ROLL', :normal, {algorithm: :mle}
|
11
11
|
|
12
12
|
expect_similar_vector @glm.coefficients, [450.12450365911894,
|
13
13
|
0.4064837278023981, 4.27485769721736,-9153.254462671905]
|
data/spec/probit_spec.rb
CHANGED
@@ -6,6 +6,7 @@ describe Statsample::GLM::Probit do
|
|
6
6
|
context "MLE algorithm" do
|
7
7
|
before do
|
8
8
|
@data_set = Daru::DataFrame.from_csv 'spec/data/logistic_mle.csv'
|
9
|
+
@data_set.vectors = Daru::Index.new([:a,:b,:c,:y])
|
9
10
|
@glm = Statsample::GLM.compute @data_set, :y, :probit,
|
10
11
|
{algorithm: :mle, constant: 1}
|
11
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsample-glm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ankur Goel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: daru
|