GithubHelp home page GithubHelp logo

mads-wsstatec's Introduction

WSSTATEC

This repository is dedicated to the project of time series forecast, done in R langauge. The dataset used for the project is the Delhi daily climate data. Three modesl are used for forecasting, which are autoregressive–moving-average (ARMA), vector autoregression (VAR), and two neural network models, feedforward and long-short-term-memory.

Usage

To view this project, you can look at the HTML rendering of the Rmardkown file. However, since the project includes interactive plots, which are not presentable by clicking on the link, I suggest to clone the repository and then open the HTML file, with following command:

git clone [email protected]:berserkhmdvhb/WSSTATEC.git

Libraries

The libraries required for this project is provided in the renv.lock file. Either use renv when creating a project, or if you haven't, install the renv library, load it, and then use the renv.lock file (by copying it to project's directory) to install the requied packages. Please follow the following commands in the console:

install.packages("renv")
library(renv)
renv::restore()

Interoperability between Python and R

For the LSTM model, as R doesn't have native tensorflow and keras libraries, a python virtual environment is connected to this project so as to use the LSTM model. To connect Rstudio to the virtual environment and incorporate required python libraries in the project, the manner partly explained in website of Tensorflow for R is followed. Some steps are missing website, so a comprehensive guideline is provided in the following:

  1. Install the tensorflow R package as follows:
install.packages("keras")
  1. Install reticulate library as follows:
install.packages("reticulate")
  1. Configure R with a Python installation it can use, like this:
library(reticulate)
path_to_python <- install_python()
virtualenv_create("r-reticulate", python = path_to_python)

Note that if you already have Python installed, you don’t need to call install_python() and instead can just supply an absolute path to the Python executable. So far the python virtual environment with the name r-reticulate should have been created.

  1. Now we intend to install keras on the virtual environment.
library(keras)
install_keras(envname = "r-reticulate")
  1. Although by now the r-reticulate virtual environment contains the required python packages, yet the reticulate won't run Python from this environment and instead will load it from its default path defined in the RETICULATE_PYTHON. The default path in Linux is /usr/bin/python3. To overcome this, we should unset the variable.
Sys.unsetenv("RETICULATE_PYTHON") 
use_virtualenv("~/.virtualenvs/r-reticulate")
  1. Now if we load the keras library, the Python packages are loaded from the virtual evnironment.

mads-wsstatec's People

Contributors

berserkhmdvhb avatar

Watchers

 avatar

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.