Skip to content

Techtonique/techtonique-cli

Repository files navigation

CLI for Techtonique

This a Command Line Interface (CLI) for Techtonique's API. Working on all operating systems (Windows, MacOS, Linux). You may find these resources useful:

1 - Installation

In a virtual environment, run the following command:

pip install techtonique_cli

First, get a token from techtonique.net/token. If you want to avoid providing a token each time you run the CLI, you can set the TECHTONIQUE_API_TOKEN environment variable (for 30 minutes). That is, either:

  • set the TECHTONIQUE_API_TOKEN environment variable by replacing the TOKEN value below with your token.
export TECHTONIQUE_API_TOKEN=TOKEN
  • put the token in a .env file in the current directory, as TECHTONIQUE_API_TOKEN=TOKEN.

All the datasets used in the examples below are available in Techtonique/datasets repository.

xxx

2 - Examples

2 - 1 - General usage

At the command line, type:

techtonique --help

techtonique forecasting --help

techtonique forecasting univariate --help

techtonique ml --help

techtonique ml classification --help

techtonique reserving --help

techtonique survival --help

#  Univariate forecasting
techtonique forecasting univariate /Users/t/Documents/datasets/time_series/univariate/a10.csv --base_model RidgeCV --h 3

# Multivariate forecasting
techtonique forecasting multivariate /Users/t/Documents/datasets/time_series/multivariate/ice_cream_vs_heater.csv --lags 25 --h 10

# Regression
techtonique ml regression /Users/t/Documents/datasets/tabular/regression/mtcars2.csv --base_model ElasticNet

# Survival Analysis
techtonique survival /Users/t/Documents/datasets/tabular/survival/kidney.csv --model coxph

2 - 2 - Interacting with output files

Then, either:

  • provide the token as a command line argument.
  • set the TECHTONIQUE_API_TOKEN environment variable by replacing the TOKEN value below with your token.
export TECHTONIQUE_API_TOKEN=TOKEN
  • put the token in a .env file in the current directory.

Here's how to export results to a JSON file:

techtonique forecasting univariate /Users/t/Documents/datasets/time_series/univariate/a10.csv --base_model RidgeCV --h 10 > forecast.json

Here's how to export results to a CSV file with selected columns:

techtonique forecasting univariate /Users/t/Documents/datasets/time_series/univariate/a10.csv --base_model RidgeCV --h 10 --select "lower, upper, mean" --to-csv forecast.csv

2 - 3 - Plotting

# Display plot interactively
techtonique forecasting univariate /Users/t/Documents/datasets/time_series/univariate/a10.csv --h 10 --plot

# Create forecast and save plot
techtonique forecasting univariate /Users/t/Documents/datasets/time_series/univariate/a10.csv --h 10 --plot-file forecast.png

About

Techtonique CLI (Command Line Interface)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published