Skip to content

Instantly share code, notes, and snippets.

@sumveds
sumveds / raw_cashew_nut_demand_forecast.py
Last active June 6, 2024 10:12
This Python script provides a comprehensive approach to forecasting cashew nut demand using the SARIMAX (Seasonal AutoRegressive Integrated Moving Average with eXogenous variables) model. The script is tailored for scenarios where seasonal patterns play a significant role in demand fluctuations. The implementation includes the integration of Fou…
import sys # Import sys to access command line arguments
import pandas as pd
import numpy as np
from statsmodels.tsa.statespace.sarimax import SARIMAX
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
def load_data(filepath):
@sumveds
sumveds / Future-retry.scala
Created December 16, 2016 09:19 — forked from viktorklang/Future-retry.scala
Asynchronous retry for Future in Scala
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import akka.pattern.after
import akka.actor.Scheduler
/**
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown,
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure.