def _core_dist(point, neighbors, dist, n_features):
    """
    Computes the core distance of a point.
    Core distance is the inverse density of an object.

    Args:
        point (int): number of the point in the dataset
        neighbors (np.ndarray): array of dimensions (n_neighbors, 1):
            array of all other points indexes in object class
        dist (np.ndarray): array of dimensions (n, n):
            precalculated distances between all points

    Returns: core_dist (float)
        inverse density of point
    """
    
    n_neighbors = len(neighbors)
    distance_vector = dist[point][neighbors]
    distance_vector = distance_vector[distance_vector != 0]
    numerator = ((1/distance_vector)**n_features).sum()
    core_dist = (numerator / (n_neighbors - 1)) ** (-1/n_features)
    return core_dist