#!/usr/bin/env python3
"""
calculates sensitivity for each class in a confusion matrix
"""
import numpy as np


def sensitivity(confusion):
    """
    confusion: confusion numpy.ndarray of shape (classes, classes)
    classes: num of classes
    """
    sensitivity_arr = np.diagonal(confusion) / (np.sum(confusion, axis=1))
    return sensitivity_arr

58277d9a17a270b09286784fa218d028c99b3d4e
<mask token>

<mask token>


def sensitivity(confusion):
    """
    confusion: confusion numpy.ndarray of shape (classes, classes)
    classes: num of classes
    """
    sensitivity_arr = np.diagonal(confusion) / np.sum(confusion, axis=1)
    return sensitivity_arr

<mask token>
import numpy as np


def sensitivity(confusion):
    """
    confusion: confusion numpy.ndarray of shape (classes, classes)
    classes: num of classes
    """
    sensitivity_arr = np.diagonal(confusion) / np.sum(confusion, axis=1)
    return sensitivity_arr

#!/usr/bin/env python3
"""
calculates sensitivity for each class in a confusion matrix
"""
import numpy as np


def sensitivity(confusion):
    """
    confusion: confusion numpy.ndarray of shape (classes, classes)
    classes: num of classes
    """
    sensitivity_arr = np.diagonal(confusion) / (np.sum(confusion, axis=1))
    return sensitivity_arr
