Downloads · 30 days
9
36% of all-time downloads
Shoriful025/tabular-decision-transformer-finance
tabular-decision-transformer-finance is a machine learning model from Shoriful025. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
The tabular-decision-transformer-finance model is a specialized Decision Transformer adapted for classifying structured, tabular data (often seen in financial risk assessment). Instead of predicting actions in a seque…
Downloads · 30 days
9
36% of all-time downloads
All-time downloads
25
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md4.1 KB · 53%
From the Hugging Face model README
The tabular-decision-transformer-finance model is a specialized Decision Transformer adapted for classifying structured, tabular data (often seen in financial risk assessment). Instead of predicting actions in a sequence, this model interprets the feature vector (sequence of normalized features) and classifies the overall outcome (e.g., loan risk). It leverages the power of the attention mechanism to capture complex, non-linear interactions between features, outperforming traditional tree-based models on complex, high-dimensional datasets.
DecisionTransformerForSequenceClassification).To classify a new financial profile:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Conceptual loading (A tokenizer is often a custom feature processor here)
model_name = "YourOrg/tabular-decision-transformer-finance"
# Assuming a custom tokenizer/processor handles feature -> tensor conversion
# tokenizer = TabularFeatureTokenizer.from_pretrained(model_name)
# model = DecisionTransformerForSequenceClassification.from_pretrained(model_name)
# --- Conceptual Input Data ---
# A new applicant's features, normalized and ordered:
raw_features = [35, 75000, 720, 15000, 1] # Age, Income, Score, Amount, History (1=Yes)
# Input preparation (conceptual: features are tokenized/embedded into a tensor)
# In reality, this requires a specific processor to handle categorical/continuous embeddings.
input_tensor = torch.tensor([raw_features], dtype=torch.float32)
# --- Conceptual Prediction ---
# with torch.no_grad():
# outputs = model(input_tensor)
# logits = outputs.logits
# predicted_class_id = torch.argmax(logits, dim=1).item()
# Predicted class mapping (based on config.json)
predicted_class_id = 0 # Example result
label_map = {0: "High Risk", 1: "Medium Risk", 2: "Low Risk"}
prediction = label_map[predicted_class_id]
print(f"Input Profile: Age 35, Score 720, Amount $15k")
print(f"Predicted Loan Risk: **{prediction}**")