heatmaps / modules /ai_engine.py
Prasanna1622's picture
Update modules/ai_engine.py
40ca968 verified
raw
history blame contribute delete
374 Bytes
import pandas as pd
import numpy as np
def run_hf_predictions(df: pd.DataFrame) -> pd.DataFrame:
"""
Simulates Hugging Face-based fault predictions.
"""
df["HealthScore"] = np.random.uniform(0.2, 1.0, size=len(df))
df["AlertLevel"] = df["HealthScore"].apply(
lambda x: "Red" if x < 0.4 else "Yellow" if x < 0.7 else "Green"
)
return df