Quick Start

Get up and running with DATFID in under 5 minutes.

1. Install the SDK

Terminal
pip install datfid

2. Get Your API Key

You need an API token to use the SDK. Getting one is free and takes about 15 minutes.

Get API Key →

Fill out a short form and the DATFID team will respond within 15 minutes with your personal token. See Get Your API Key for details.

3. Initialize the Client

Python
import pandas as pd
from datfid import DATFIDClient

client = DATFIDClient(token="your_DATFID_token")

Sample Datasets

Ready-to-use sample data is available on GitHub: DATFID sample-datasets repo

Training file: Banking_extended.xlsx

  • 50,400 rows x 14 columns
  • Entities: 50 unique Individual IDs (ind1, ind2, ...)
  • Time: integer periods 1 to 1008 (sequential per entity)
  • Target: Loan Probability
  • Features: Repayment Amount, Credit Score, Unemployment Rate, Inflation Rate, Stable Income, Loan Type: Mortgage, and more

Forecast file: Banking_extended_forecast.xlsx

  • 500 rows x 13 columns (same structure minus the target column)
  • Time: 1009 to 1018 (10 future periods per entity)
  • Schema matches training file except target column is omitted

4. Fit a Model

Load your panel data and fit an interpretable model. DATFID will return a formula with coefficients that explain the relationships in your data.

Python
df = pd.read_excel("your_data.xlsx")

result = client.fit_model(
    df=df,
    id_col="Product",
    time_col="Time",
    y="Revenue",
    current_features="all",
    filter_by_significance=True
)

5. Explore the Result

After fit_model() completes, the returned result object exposes all analysis outputs. In Python or Colab, type result. and press Tab to see autocomplete suggestions. Key fields:

  • result.formula— the fitted model as a readable equation
  • result.alpha— per-entity intercepts (time-invariant baseline for each entity)
  • result.beta— feature coefficients with t-stats and p-values
  • result.Performance— overall R², MAE, MSE, RMSE
  • result.R2_individual— per-entity R² breakdown
  • result.dropped_cols— features removed (e.g. insignificant)
  • result.df— processed training DataFrame used for fitting
Python
print(result.formula)
print(result.Performance)
print(result.alpha.head())

See Python SDK Reference for the full list of result attributes including headers_alpha, headers_beta, and errors.

Drill into a single entity

You can also index result with an entity name and chain any attribute directly — all the same fields are available, scoped to that entity only:

Python
print(result["ind1"].alpha)        # this entity's baseline intercept
print(result["ind1"].Performance)  # R², MAE, MSE, RMSE for this entity only
print(result["ind1"].formula)      # formula with this entity's alpha substituted in
print(result["ind1"].df.head())    # training rows for this entity only

See individual entity access in the SDK reference for the full attribute list.

6. Generate Forecasts

Load a forecast file that defines which entities and time periods to predict, then run the forecast.

Python
df_forecast = pd.read_excel("your_forecast_data.xlsx")

forecast = client.forecast_model(df_forecast=df_forecast)

Next Steps

Prefer no code? The Free Playground lets you upload data, configure parameters, and run analysis with a visual UI — no SDK installation or API key required.