Tangent Databricks Python Package
The TangentWorks library serves as a central interface for advanced time-series forecasting, anomaly detection, and insights extraction. It simplifies complex data operations, enabling users to build models, make predictions, detect anomalies, and gain insights efficiently.
Class Overview
The TangentWorks
class acts as the main entry point to the library, exposing APIs for:
Forecasting
Anomaly Detection
Insights
Each of these APIs comes with specialized methods to perform their respective operations.
Initialization
To start using the TangentWorks library, initialize the main class:
from tangent_works import TangentWorks
tw = TangentWorks()
This initializes the following components:
forecasting
: An instance ofForecastingAPI
for time-series forecasting tasks.anomaly_detection
: An instance ofAnomalyDetectionAPI
for identifying and analyzing anomalies.insights
: An instance ofInsights
for interpreting model outputs and gaining data-driven insights.
Attributes and Methods
1. Forecasting
Provides a robust set of tools for building forecasting models, making predictions, performing root cause analysis (RCA), and automating the forecasting process.
Available Methods
build_model
: Constructs a forecasting model using a configuration and dataset.predict
: Generates forecasts using a pre-built model.rca
: Identifies the root causes of anomalies or variations in time-series data.auto_forecast
: Builds a model and generates predictions in a single automated step.
Example Usage
# Build a forecasting model
model = tw.forecasting.build_model(configuration=config, dataset=data)
# Generate predictions
predictions = tw.forecasting.predict(configuration=config, dataset=data, model=model)
# Perform Root Cause Analysis (RCA)
rca_results = tw.forecasting.rca(configuration=config, dataset=data, model=model)
# Automate forecasting
auto_result = tw.forecasting.auto_forecast(configuration=config, dataset=data)
2. AnomalyDetection
Facilitates the detection of anomalies in datasets through model building, anomaly detection, and root cause analysis (RCA).
Available Methods
build_model
: Creates an anomaly detection model using a configuration and dataset.detect
: Identifies anomalies in a dataset with a specified model.rca
: Pinpoints the root causes of anomalies.
Example Usage
# Build an anomaly detection model
anomaly_model = tw.anomaly_detection.build_model(configuration=config, dataset=data)
# Detect anomalies
anomalies = tw.anomaly_detection.detect(dataset=data, model=anomaly_model)
# Perform Root Cause Analysis (RCA)
rca_results = tw.anomaly_detection.rca(configuration=config, dataset=data, model=anomaly_model)
3. Insights
Provides tools for extracting and interpreting variable properties and features from models.
Available Methods
properties
: Retrieves and processes the variable properties of a given model, ranked by importance.features
: Extracts features used in the given model for interpretation and analysis.
Example Usage
# Extract variable properties
properties = tw.insights.properties(model=model)
# Extract features
features = tw.insights.features(model=model)
Key Benefits
Centralized Interface: Access all functionalities via a single class.
Scalability: Perform advanced operations on large-scale datasets.
Flexibility: Tailor configurations for specific use cases.
Dependencies
Ensure the following modules are properly installed:
pandas
Tangent Works library components