README.md in trend-0.1.2 vs README.md in trend-0.2.0
- old
+ new
@@ -1,27 +1,33 @@
-# Trend
+# Trend Ruby
Ruby client for [Trend](https://trendapi.org), the anomaly detection and forecasting API
-[![Build Status](https://travis-ci.org/ankane/trend.svg?branch=master)](https://travis-ci.org/ankane/trend)
+[![Build Status](https://github.com/ankane/trend-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/trend-ruby/actions)
## Installation
Add this line to your application’s Gemfile:
```ruby
-gem 'trend'
+gem "trend"
```
+For the [self-hosted API](https://github.com/ankane/trend-api), create an initializer with:
+
+```ruby
+Trend.url = "http://localhost:8000"
+```
+
## Anomaly Detection
Detect anomalies in a time series
```ruby
# generate series
series = {}
-date = Date.parse("2018-04-01")
+date = Date.parse("2023-04-01")
28.times do
series[date] = rand(100)
date += 1
end
@@ -29,11 +35,11 @@
series[date - 8] = 999
Trend.anomalies(series)
```
-Works great with libraries like [Groupdate](https://github.com/ankane/groupdate)
+Works great with [Groupdate](https://github.com/ankane/groupdate)
```ruby
series = User.group_by_day(:created_at).count
Trend.anomalies(series)
```
@@ -42,11 +48,11 @@
Get future predictions for a time series
```ruby
series = {}
-date = Date.parse("2018-04-01")
+date = Date.parse("2023-04-01")
28.times do
series[date] = date.wday
date += 1
end
@@ -72,36 +78,26 @@
```ruby
Trend.correlation(series, series2)
```
-## Authentication
-
-An API key is needed for more than 1,000 requests per day per IP. [Email us](mailto:hi@trendapi.org) to get one.
-
-If you have one, set `ENV["TREND_API_KEY"]` or use:
-
-```ruby
-Trend.api_key = "secret"
-```
-
## History
-View the [changelog](https://github.com/ankane/trend/blob/master/CHANGELOG.md)
+View the [changelog](https://github.com/ankane/trend-ruby/blob/master/CHANGELOG.md)
## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
-- [Report bugs](https://github.com/ankane/trend/issues)
-- Fix bugs and [submit pull requests](https://github.com/ankane/trend/pulls)
+- [Report bugs](https://github.com/ankane/trend-ruby/issues)
+- Fix bugs and [submit pull requests](https://github.com/ankane/trend-ruby/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features
-To get started with development and testing:
+To get started with development:
```sh
-git clone https://github.com/ankane/trend.git
-cd trend
+git clone https://github.com/ankane/trend-ruby.git
+cd trend-ruby
bundle install
-rake test
+bundle exec rake test
```