Git Product home page Git Product logo

echos's Introduction

Hi there, I'm Alex

Economist and Data Scientist with 8+ years of experience in the consulting industry, specializing in data and analytics (D&A) and (AI-based) Integrated Business Planning (IBP) for sales, operations, and financial planning & forecasting. I have a proven track record of creating customized software solutions for large-scale time series forecasting and advanced analytics, improving operational efficiency, accuracy, and data-driven decision-making for 25+ clients across various industries (e.g., pharmaceutical, chemical, manufacturing, retail, and automotive). Proficient in statistics, econometrics, machine learning, programming, and data visualization, with strong, agile project management and communication skills.

Interests

  • ๐Ÿ“ˆ Time Series Analysis and Forecasting
  • ๐Ÿ› ๏ธ Statistics, Econometrics and Machine Learning
  • ๐Ÿ“Š Data Visualization and Reporting
  • ๐ŸŽ“ Data Science Education
  • ๐Ÿ“ฆ R Programming and Package Development
  • ๐Ÿ’ต Financial Planning & Analysis (FP&A) and Integrated Business Planning (IBP)

echos's People

Contributors

ahaeusser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kitkatty

echos's Issues

Missing Values Not Supported (Echo State Network, R)

Hello, great job creating this package for echo state networks in R!

I an trying to use your code for a univariate time series I generated and I am running into some problems relating to "missing values not supported". Could you please take a look at this if you have time?

#load libraries
devtools::install_github("ahaeusser/echos")
devtools::install_github("ahaeusser/tscv")
install.packages("fable")
remotes::install_github("tidyverts/fable")
remotes::install_github("tidyverts/tsibble")

#load libraries
library(echos)
library(tscv)
library(dplyr)
library(tsibble)
library(fabletools)
library(fable)
Sys.setlocale("LC_TIME", "C")
#> [1] "C"

library(lubridate)
library(dplyr)
library(tibble)
library(tsibble)

date_decision_made = seq(as.Date("1800/1/1"), as.Date("2020/1/1"),by="day")

date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d")

property_damages_in_dollars <- rnorm( 80354,100,10)

final_data <- data.frame(date_decision_made, property_damages_in_dollars)

mut = final_data %>%
    mutate(date_decision_made = as.Date(date_decision_made)) %>%
    group_by(week = format(date_decision_made, "%Y-%m")) %>%
    summarise( total = sum(property_damages_in_dollars, na.rm = TRUE))

#pretend the data has been sampled for "training" and "testing"

sample1 <- c("train","test" )

mut$status<- sample(sample1 , 2641 , replace=TRUE, prob=c(0.7, 0.3))
mut$status <- as.factor(mut$status)
mut$Value = mut$total
mut$total = NULL


ym <- function (..., quiet = FALSE, tz = NULL, locale = Sys.getlocale("LC_TIME")) {
    lubridate:::.parse_xxx(..., orders = "ym", quiet = quiet, tz = tz, locale = locale,
                           truncated = 0)
}

mut$week <- ym(mut$week)

tibble <- as.tibble(mut)


z = tibble %>%
    as_tsibble(index = week)

data = z

# Setup for time series cross validation
n_init <- 2400   # size for training window
n_ahead <- 24    # size for testing window (forecast horizon)
mode <- "slide"  # fixed window approach
n_skip <- 23     # skip 23 observations
n_lag <- 0       # no lag

data <- data %>%
  tscv::split_data(
    n_init = n_init,
    n_ahead = n_ahead,
    mode = mode,
    n_skip = n_skip,
    n_lag = n_lag)

Here is the error:

models <- data %>%
  filter(sample == "train") %>%
  model(
    "ESN" = ESN(
      Value,
      inf_crit = "BIC",
      max_lag = 6,
      n_fourier = c(3, 3),
      n_initial = 50,
      n_res = 200,
      scale_inputs = c(-1, 1)),
    "sNaive" = SNAIVE(Value ~ lag("week")))

Warning messages:
1: 11 errors (1 unique) encountered for ESN
[11] cannot coerce type 'closure' to vector of type 'double'
 
2: 11 errors (1 unique) encountered for sNaive
[11] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.

I tried doing as the error message suggested:

data <- data %>% 
     fill_gaps(.full = TRUE)

But the same error happens. This error is preventing me from running the rest of the code:

[models <- data %>%
  filter(sample == "train") %>%
  model(
    "ESN" = ESN(
      Value,
      inf_crit = "BIC",
      max_lag = 6,
      n_fourier = c(3, 3),
      n_initial = 50,
      n_res = 200,
      scale_inputs = c(-1, 1)),
    "sNaive" = SNAIVE(Value ~ lag("week")))

## Detailed report of ESN
models %>%
  select(ESN) %>%
  report()

# Forecast models
fcsts <- models %>%
  forecast(h = n_ahead)

actuals <- data %>%
  filter_index("2019-04-10" ~ .)

fcsts %>%
  autoplot(
    actuals,
    level = NULL,
    size = 1)](url)

Could you please take a look at this if you have time? Perhaps I am doing something wrong and you could kindly show me how to fix this problem?

Thanks you so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.