Getting Started
Service
- Introduction To A Service
- Deploy your first Service
- Interacting With Your Service
- Configuring your service
- Update, Rollback, Promote
- Monitoring Your Service
Job
- Introduction To A Job
- Running your first Job
- Interacting With Your Job
- Monitor Your Job
- Configuring your Job
ML Repository
- Introduction To ML Repo
- Quick Start
- Guides
- API Reference
Workflow
Large Language Models (LLMs)
Workbenches: Notebooks and SSH
Volumes
Async Service
- Introduction to Async Service
- Deploy your first Async Service
- Configure async service
- Queue Integrations
- Monitor Your Async Service
Secret Management
Collaboration and Access Control
Deploying On Your Own Cloud
- Modes Of Deployment
- Deploy Compute Plane
- Deploy Control Plane Only
- Advanced Configuration
- Integrations
- SSO Integration
- Deploy Truefoundry In An Air Gapped Environment
HOW TOs
Guides
Log Plots
Mlfoundry allows you to log custom plots under the current run
at the given step
using thelog_plot
function.
You can use this function to log custom matplotlib, plotly plots as shown in examples below:
from truefoundry.ml import get_client
from sklearn.metrics import ConfusionMatrixDisplay
import matplotlib.pyplot as plt
client = get_client()
run = client.create_run(
ml_repo="my-classification-project",
)
ConfusionMatrixDisplay.from_predictions(["spam", "ham"], ["ham", "ham"])
run.log_plots({"confusion_matrix": plt}, step=1)
You can visualize the logged plots in the Truefoundry Dashboard.
Visualizing the logged plots
Logging a seaborn plot
from truefoundry.ml import get_client
from matplotlib import pyplot as plt
import seaborn as sns
# create a run in mlfoundry
client = get_client()
run = client.create_run(
ml_repo="my-classification-project",
)
sns.set_theme(style="ticks", palette="pastel")
# Load the example tips dataset
tips = sns.load_dataset("tips")
# Draw a nested boxplot to show bills by day and time
sns.boxplot(x="day", y="total_bill", hue="smoker", palette=["m", "g"], data=tips)
sns.despine(offset=10, trim=True)
run.log_plots({"seaborn": plt})
run.end()
Logging a plotly figure
from truefoundry.ml import get_client
import plotly.express as px
client = get_client()
run = client.create_run(ml_repo="my-classification-project")
df = px.data.tips()
fig = px.histogram(
df,
x="total_bill",
y="tip",
color="sex",
marginal="rug",
hover_data=df.columns,
)
plots_to_log = {
"distribution-plot": fig,
}
run.log_plots(plots_to_log, step=1)
run.end()
You can find this logged image in the dashboard.
Plotly Image
On this page