Welcome to the world of functime, where we harness the power of machine learning for production-ready global forecasting and time-series feature extraction on large panel datasets. This Python library is an essential tool for anyone working with time-series data, providing everything from preprocessing to advanced forecasting techniques.
Why Choose Functime?
- Fast: Capable of forecasting and extracting features across 100,000 time series in seconds on your laptop.
- Efficient: Utilizes the Polars library for embarrassingly parallel feature engineering.
- Battle-tested: Proven algorithms that deliver real business impact.
- Exogenous features: Supported by every forecaster.
- Backtesting: Features expanding and sliding window splitters.
- Automated tuning: Leverage FLAML for hyperparameter tuning.
Getting Started
Installing functime is a breeze. Simply use the following command via the pip package manager:
pip install functime
For advanced features such as large-language model (LLM) and LightGBM, add these options:
pip install functime[llm,lgb]
Forecasting Made Easy
Imagine you are the captain of a ship navigating through turbulent waters (your dataset). You have a map (your forecast) and tools to measure various oceanic conditions (your features). With functime, you can seamlessly plot the course of your ship using sophisticated techniques.
Example Forecasting Code
import polars as pl
from functime.cross_validation import train_test_split
from functime.forecasting import linear_model
from functime.metrics import mase
# Load commodities price data
y = pl.read_parquet('https://github.com/functime-org/functime/raw/main/data/commodities.parquet')
entity_col, time_col = y.columns[:2]
# Time series split
y_train, y_test = y.pipe(train_test_split(test_size=3))
# Fit-predict
forecaster = linear_model(freq='1mo', lags=24)
forecaster.fit(y=y_train)
y_pred = forecaster.predict(fh=3)
# Score forecasts in parallel
scores = mase(y_true=y_test, y_pred=y_pred, y_train=y_train)
Feature Extraction
Feature extraction is akin to mining precious gems out of rough rock. Each feature extracted adds value to your model, enabling it to perform better and make more accurate predictions.
Example Feature Extraction Code
from functime.feature_extractors import FeatureExtractor, binned_entropy
# Load commodities price data again
y = pl.read_parquet('https://github.com/functime-org/functime/raw/main/data/commodities.parquet')
# Extract a single feature from a single time-series
binned_entropy_value = binned_entropy(pl.Series(np.random.normal(0, 1, size=10)), bin_count=10)
# Extract features fast on many time-series using group_by
features = y.group_by(entity_col).agg(
binned_entropy=pl.col(value_col).ts.binned_entropy(bin_count=10)
)
Troubleshooting
If you encounter any issues while using functime, here are some troubleshooting tips:
- Ensure that all required libraries, such as Polars, are installed and updated to their latest versions.
- Verify the dataset paths; make sure they are correctly written and accessible.
- Examine any error messages for clues on what may be wrong. They often contain detailed information about the issue.
- For extensive support, feel free to join our Discord community.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.