import React from 'react'; import { motion } from 'framer-motion'; import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell } from 'recharts'; import { Microscope } from 'lucide-react'; const FeatureImportance = ({ explanation }) => { // Transform explanation dict to array for Recharts const data = Object.entries(explanation) .map(([name, value]) => ({ name: name.replace(/_/g, ' '), value })) .sort((a, b) => b.value - a.value) .slice(0, 5); // Top 5 features return (
Feature Importance (SHAP Values)
"Primary driver is {data[0]?.name} with {Math.round(data[0]?.value * 100)}% weight. This suggests the model is prioritizing {data[0]?.name.includes('hiring') ? 'talent acquisition' : 'growth metrics'} over other signals."