-
Notifications
You must be signed in to change notification settings - Fork 22
Installation
install.packages("smooth")if (!require("remotes")) install.packages("remotes")
remotes::install_github("config-i1/smooth")Depends:
- R >= 3.0.2
- greybox >= 2.0.2
Imports:
- Rcpp, nloptr, zoo, pracma, statmod, MASS, xtable, generics, stats, graphics, methods
LinkingTo:
- Rcpp >= 0.12.3
- RcppArmadillo >= 0.8.100.0.0
Linux: No special requirements; BLAS/LAPACK typically pre-installed.
macOS: gfortran is required. Install via:
# Using Homebrew
brew install gcc
# Or download from CRAN
# https://mac.r-project.org/tools/See thecoatlessprofessor.com for detailed macOS instructions.
Windows: Standard R build tools (Rtools) should be sufficient.
Sometimes after upgrading smooth, C++ functions are cached incorrectly. Solutions:
- Restart R session
- If that doesn't work:
remove.packages("smooth") # Delete the "smooth" folder from R packages directory # Restart R install.packages("smooth")
If you see errors about -lgfortran or -lquadmath:
- Install gfortran from CRAN tools or via Homebrew
- Ensure gfortran is in your PATH
- Restart R and retry installation
library(smooth)
packageVersion("smooth")
# Test basic functionality
data <- rnorm(100)
model <- adam(data, model="ANN")
print(model)Note: The package is not on PyPI yet. A different stale package of the same name is there. We are working on it.
# Doesn't work yet:
# pip install smoothPre-built wheels are available on the GitHub Releases page. These do not require a C++ compiler or Armadillo to be installed, since the C++ extensions are already compiled.
-
Go to the latest release and download the
.whlfile matching your platform and Python version. The file names follow this pattern:smooth-<version>-cp<python>-cp<python>-<platform>.whl
For example:
-
smooth-4.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl— Linux x86_64, Python 3.12 -
smooth-4.4.0-cp311-cp311-macosx_14_0_arm64.whl— macOS Apple Silicon, Python 3.11 -
smooth-4.4.0-cp310-cp310-win_amd64.whl— Windows 64-bit, Python 3.10
-
Install the downloaded wheel with pip:
pip install smooth-4.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Replace the filename with the one you downloaded.
Alternatively, you can install directly from the release URL without downloading first:
pip install "https://github.com/config-i1/smooth/releases/download/v4.4.0/smooth-4.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"Important: This package includes C++ extensions that require compilation. You must have a C++ compiler, CMake, and Armadillo installed before running pip install. See System Requirements below.
pip install "git+https://github.com/config-i1/smooth.git@master#subdirectory=python"Python Version:
- Python >= 3.10
Runtime Dependencies:
- numpy
- pandas
- scipy
- nlopt
- statsmodels
- pybind11
Build Dependencies:
- cmake >= 3.25
- scikit-build-core
- ninja
C++ Compiler:
- Linux: g++ (usually pre-installed, or
sudo apt install g++) - macOS: Xcode Command Line Tools (
xcode-select --install) - Windows: Visual Studio Build Tools with C++ workload
Linux (Debian/Ubuntu):
sudo apt update
sudo apt install libblas-dev liblapack-dev libarmadillo-dev cmake ninja-buildLinux (Fedora/RHEL):
sudo dnf install blas-devel lapack-devel armadillo-devel cmake ninja-buildmacOS:
brew install armadillo cmake ninjaWindows: Install Visual Studio Build Tools with C++ workload.
If you get import errors about nlopt:
pip install nloptOn some systems, you may need the system nlopt library:
# Debian/Ubuntu
sudo apt install libnlopt-dev
# macOS
brew install nloptIf compilation fails with Armadillo errors:
- Install Armadillo development headers (see System Requirements)
- Ensure CMake can find Armadillo:
pkg-config --cflags --libs armadillo
import smooth
print(smooth.__version__)
# Test basic functionality
import numpy as np
from smooth import ADAM
data = np.random.randn(100)
model = ADAM(model="ANN")
model.fit(data)
print(model.summary())