Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
evaluator.metrics Namespace Reference

Functions

float get_average_difference (np.array output, np.array expected)
 Computes the average difference between an output output and the expected values.
 
int get_false_positives (np.ndarray output, np.ndarray expected, float threshold)
 Computes the number of false positives in the output compared to the expected values.
 
float get_mean_squared_difference (np.ndarray output, np.ndarray expected)
 Computes the mean squared difference between an output output and the expected values.
 
float compute_distance (np.array cone1, np.array cone2)
 Compute the Euclidean distance between two cones.
 
np.array build_adjacency_matrix (np.array cones)
 
int get_duplicates (np.array output, float threshold)
 
float get_inter_cones_distance (np.array perception_output)
 Computes the average distance between pairs of perceived cones using Minimum Spanning Tree Prim's algorithm.
 
np.ndarray compute_closest_distances (np.ndarray arr1, np.ndarray arr2)
 Computes the distance between each element in arr2 and the closest element in arr1.
 
float get_average_error (np.array values)
 Computes the average of a list of values.
 
float get_mean_squared_error (np.array values)
 Computes the mean squared value of a list of values.
 
float get_root_mean_squared_error (np.array values)
 Computes the root mean squared error of a list of values.
 

Function Documentation

◆ build_adjacency_matrix()

np.array evaluator.metrics.build_adjacency_matrix ( np.array  cones)
Build an adjacency matrix based on the distances between cones.

Args:
    cones (np.array): An array containing the coordinates of cones.

Returns:
    np.array: The adjacency matrix representing the distances between cones.

Definition at line 127 of file metrics.py.

◆ compute_closest_distances()

np.ndarray evaluator.metrics.compute_closest_distances ( np.ndarray  arr1,
np.ndarray  arr2 
)

Computes the distance between each element in arr2 and the closest element in arr1.

Args: arr1 (np.ndarray): First array of positions. arr2 (np.ndarray): Second array of positions.

Returns: np.ndarray: Array of distances between each element in arr2 and the closest element in arr1.

Definition at line 202 of file metrics.py.

◆ compute_distance()

float evaluator.metrics.compute_distance ( np.array  cone1,
np.array  cone2 
)

Compute the Euclidean distance between two cones.

Args: cone1 (np.array): The coordinates of the first cone. cone2 (np.array): The coordinates of the second cone. Returns: float: The Euclidean distance between the two cones.

Definition at line 114 of file metrics.py.

◆ get_average_difference()

float evaluator.metrics.get_average_difference ( np.array  output,
np.array  expected 
)

Computes the average difference between an output output and the expected values.

Args: output (np.array): Empirical Output. expected (np.array): Expected output.

Returns: float: Average difference between empirical and expected outputs.

Definition at line 8 of file metrics.py.

◆ get_average_error()

float evaluator.metrics.get_average_error ( np.array  values)

Computes the average of a list of values.

Args: values (np.array): List of values.

Returns: float: Average of the values.

Definition at line 228 of file metrics.py.

◆ get_duplicates()

int evaluator.metrics.get_duplicates ( np.array  output,
float  threshold 
)
Receives a set of cones and identifies the possible duplicates.

Args:
    output (np.array): The set of cones.
    threshold (float): The threshold value to consider cones different or duplicates.

Returns:
    int: The number of possible duplicates.

Definition at line 151 of file metrics.py.

◆ get_false_positives()

int evaluator.metrics.get_false_positives ( np.ndarray  output,
np.ndarray  expected,
float   threshold 
)

Computes the number of false positives in the output compared to the expected values.

Args: output (np.ndarray): Empirical Output. expected (np.ndarray): Expected output. threshold (float): Distance threshold to consider values as matching.

Returns: int: Number of false positives.

Definition at line 42 of file metrics.py.

◆ get_inter_cones_distance()

float evaluator.metrics.get_inter_cones_distance ( np.array  perception_output)

Computes the average distance between pairs of perceived cones using Minimum Spanning Tree Prim's algorithm.

Args: perception_output (np.array): List of perceived cones, where each cone is represented as a numpy array.

Returns: float: Average distance between pairs of perceived cones.

Definition at line 170 of file metrics.py.

◆ get_mean_squared_difference()

float evaluator.metrics.get_mean_squared_difference ( np.ndarray  output,
np.ndarray  expected 
)

Computes the mean squared difference between an output output and the expected values.

Args: output (list): Empirical Output. expected (list): Expected output.

Returns: float: Mean squared difference.

Definition at line 83 of file metrics.py.

◆ get_mean_squared_error()

float evaluator.metrics.get_mean_squared_error ( np.array  values)

Computes the mean squared value of a list of values.

Args: values (np.array): List of values.

Returns: float: Mean squared value of the values.

Definition at line 244 of file metrics.py.

◆ get_root_mean_squared_error()

float evaluator.metrics.get_root_mean_squared_error ( np.array  values)

Computes the root mean squared error of a list of values.

Args: values (np.array): List of values.

Returns: float: Root mean squared error of the values.

Definition at line 260 of file metrics.py.