prophet-rb 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -10
- data/lib/prophet/forecaster.rb +1 -1
- data/lib/prophet/plot.rb +3 -2
- data/lib/prophet/stan_backend.rb +3 -3
- data/lib/prophet/version.rb +1 -1
- metadata +17 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d629f371c45f23517282574f13aef9006938d91fae4717a883e59820bee9ec97
|
4
|
+
data.tar.gz: '09de741683f5d0e34e9bab9fd6da75ad2df3643cabd3bb0b727d5a395d0efff2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6fa5f30d381f2370b88dce0b148d47abd6b5a371a73e0074dbd9cc013dbec6e7a8f6e2ada406a11ac557d4b9de072000e7fa06b59a00d25af2ded187c0e4315
|
7
|
+
data.tar.gz: a24bcade5d2434eea50910be649545f82774ffab9fc5dc22f78c01727253c077e5bf294e32224ffb2adfe500296aa9f42b2be69bacc6f5cc42ee6e6e54c97381
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
3
|
Copyright (c) Facebook, Inc. and its affiliates.
|
4
|
-
Copyright (c) 2020-
|
4
|
+
Copyright (c) 2020-2024 Andrew Kane
|
5
5
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Supports:
|
|
10
10
|
|
11
11
|
And gracefully handles missing data
|
12
12
|
|
13
|
-
[![Build Status](https://github.com/ankane/prophet-ruby/workflows/build/badge.svg
|
13
|
+
[![Build Status](https://github.com/ankane/prophet-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/prophet-ruby/actions)
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -454,15 +454,6 @@ m2 = Prophet.new.fit(df, init: stan_init(m1)) # Adding the last day, warm-starti
|
|
454
454
|
|
455
455
|
- [Forecasting at Scale](https://peerj.com/preprints/3190.pdf)
|
456
456
|
|
457
|
-
## Upgrading
|
458
|
-
|
459
|
-
### 0.2.0
|
460
|
-
|
461
|
-
Prophet now uses [Rover](https://github.com/ankane/rover) instead of Daru. Two changes you may need to make are:
|
462
|
-
|
463
|
-
- `Rover.read_csv` instead of `Daru::DataFrame.from_csv`
|
464
|
-
- `df[["ds", "yhat"]]` instead of `df["ds", "yhat"]`
|
465
|
-
|
466
457
|
## Credits
|
467
458
|
|
468
459
|
This library was ported from the [Prophet Python library](https://github.com/facebook/prophet) and is available under the same license.
|
data/lib/prophet/forecaster.rb
CHANGED
@@ -129,7 +129,7 @@ module Prophet
|
|
129
129
|
reserved_names = [
|
130
130
|
"trend", "additive_terms", "daily", "weekly", "yearly",
|
131
131
|
"holidays", "zeros", "extra_regressors_additive", "yhat",
|
132
|
-
"extra_regressors_multiplicative", "multiplicative_terms"
|
132
|
+
"extra_regressors_multiplicative", "multiplicative_terms"
|
133
133
|
]
|
134
134
|
rn_l = reserved_names.map { |n| "#{n}_lower" }
|
135
135
|
rn_u = reserved_names.map { |n| "#{n}_upper" }
|
data/lib/prophet/plot.rb
CHANGED
@@ -259,7 +259,7 @@ module Prophet
|
|
259
259
|
end
|
260
260
|
ax.grid(true, which: "major", c: "gray", ls: "-", lw: 1, alpha: 0.2)
|
261
261
|
months = dates.MonthLocator.new((1..12).to_a, bymonthday: 1, interval: 2)
|
262
|
-
ax.xaxis.set_major_formatter(ticker.FuncFormatter.new(lambda { |x, pos=nil| dates.num2date(x).strftime("%B %-e") }))
|
262
|
+
ax.xaxis.set_major_formatter(ticker.FuncFormatter.new(lambda { |x, pos = nil| dates.num2date(x).strftime("%B %-e") }))
|
263
263
|
ax.xaxis.set_major_locator(months)
|
264
264
|
ax.set_xlabel("Day of year")
|
265
265
|
ax.set_ylabel(name)
|
@@ -301,7 +301,7 @@ module Prophet
|
|
301
301
|
else
|
302
302
|
fmt_str = "%m/%d"
|
303
303
|
end
|
304
|
-
ax.xaxis.set_major_formatter(ticker.FuncFormatter.new(lambda { |x, pos=nil| dates.num2date(x).strftime(fmt_str) }))
|
304
|
+
ax.xaxis.set_major_formatter(ticker.FuncFormatter.new(lambda { |x, pos = nil| dates.num2date(x).strftime(fmt_str) }))
|
305
305
|
ax.set_xlabel("ds")
|
306
306
|
ax.set_ylabel(name)
|
307
307
|
if @seasonalities[name][:mode] == "multiplicative"
|
@@ -313,6 +313,7 @@ module Prophet
|
|
313
313
|
def set_y_as_percent(ax)
|
314
314
|
yticks = 100 * ax.get_yticks
|
315
315
|
yticklabels = yticks.tolist.map { |y| "%.4g%%" % y }
|
316
|
+
ax.set_yticks(ax.get_yticks.tolist)
|
316
317
|
ax.set_yticklabels(yticklabels)
|
317
318
|
ax
|
318
319
|
end
|
data/lib/prophet/stan_backend.rb
CHANGED
@@ -148,14 +148,14 @@ module Prophet
|
|
148
148
|
def platform
|
149
149
|
if Gem.win_platform?
|
150
150
|
"windows"
|
151
|
-
elsif RbConfig::CONFIG["host_os"]
|
152
|
-
if RbConfig::CONFIG["host_cpu"]
|
151
|
+
elsif RbConfig::CONFIG["host_os"].match?(/darwin/i)
|
152
|
+
if RbConfig::CONFIG["host_cpu"].match?(/arm|aarch64/i)
|
153
153
|
"arm64-darwin"
|
154
154
|
else
|
155
155
|
"x86_64-darwin"
|
156
156
|
end
|
157
157
|
else
|
158
|
-
if RbConfig::CONFIG["host_cpu"]
|
158
|
+
if RbConfig::CONFIG["host_cpu"].match?(/arm|aarch64/i)
|
159
159
|
"aarch64-linux"
|
160
160
|
else
|
161
161
|
"x86_64-linux"
|
data/lib/prophet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prophet-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2024-
|
10
|
+
date: 2024-12-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: cmdstan
|
@@ -24,6 +23,20 @@ dependencies:
|
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '0.2'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: logger
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
27
40
|
- !ruby/object:Gem::Dependency
|
28
41
|
name: numo-narray
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,7 +65,6 @@ dependencies:
|
|
52
65
|
- - ">="
|
53
66
|
- !ruby/object:Gem::Version
|
54
67
|
version: '0'
|
55
|
-
description:
|
56
68
|
email: andrew@ankane.org
|
57
69
|
executables: []
|
58
70
|
extensions: []
|
@@ -151,7 +163,6 @@ homepage: https://github.com/ankane/prophet-ruby
|
|
151
163
|
licenses:
|
152
164
|
- MIT
|
153
165
|
metadata: {}
|
154
|
-
post_install_message:
|
155
166
|
rdoc_options: []
|
156
167
|
require_paths:
|
157
168
|
- lib
|
@@ -166,8 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
177
|
- !ruby/object:Gem::Version
|
167
178
|
version: '0'
|
168
179
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
170
|
-
signing_key:
|
180
|
+
rubygems_version: 3.6.2
|
171
181
|
specification_version: 4
|
172
182
|
summary: Time series forecasting for Ruby
|
173
183
|
test_files: []
|