Skip to main content
`Ctrl`+`K`

# SALib.sample.morris.brute module

class SALib.sample.morris.brute.BruteForce

  Bases: `Strategy`

  Implements the brute force optimisation strategy

  Methods

  `brute_force_most_distant`(input_sample, ...) | Use brute force method to find most distant trajectories
  `check_input_sample`(input_sample, num_params, ...) | Check the input_sample is valid
  `compile_output`(input_sample, num_samples, ...) | Picks the trajectories from the input
  `compute_distance`(m, l) | Compute distance between two trajectories
  `compute_distance_matrix`(input_sample, ...[, ...]) | Computes the distance between each and every trajectory
  `find_maximum`(scores, N, k_choices) | Finds the k_choices maximum scores from scores
  `find_most_distant`(input_sample, num_samples, ...) | Finds the 'k_choices' most distant choices from the 'num_samples' trajectories contained in 'input_sample'
  `mappable`(combos, pairwise, distance_matrix) | Obtains scores from the distance_matrix for each pairwise combination held in the combos array
  `nth`(iterable, n[, default]) | Returns the nth item or a default value
  `run_checks`(number_samples, k_choices) | Runs checks on k_choices
  `sample`(input_sample, num_samples, ...[, ...]) | Computes the optimum k_choices of trajectories from the input_sample.

  grouper |

  brute_force_most_distant(input_sample: ndarray, num_samples: int, num_params: int, k_choices: int, num_groups: int = None) → List

    Use brute force method to find most distant trajectories

    Parameters:

      - input_sample (numpy.ndarray)

      - num_samples (int) – The number of samples to generate

      - num_params (int) – The number of parameters

      - k_choices (int) – The number of optimal trajectories

      - num_groups (int, default=None) – The number of groups

    Return type:

      list

  find_maximum(scores, N, k_choices)

    Finds the k_choices maximum scores from scores

    Parameters:

      - scores (numpy.ndarray)

      - N (int)

      - k_choices (int)

    Return type:

      list

  find_most_distant(input_sample: ndarray, num_samples: int, num_params: int, k_choices: int, num_groups: int = None) → ndarray

    Finds the ‘k_choices’ most distant choices from the ‘num_samples’ trajectories contained in ‘input_sample’

    Parameters:

      - input_sample (numpy.ndarray)

      - num_samples (int) – The number of samples to generate

      - num_params (int) – The number of parameters

      - k_choices (int) – The number of optimal trajectories

      - num_groups (int, default=None) – The number of groups

    Return type:

      numpy.ndarray

  static grouper(n, iterable)
  static mappable(combos, pairwise, distance_matrix)

    Obtains scores from the distance_matrix for each pairwise combination held in the combos array

    Parameters:

      - combos (numpy.ndarray)

      - pairwise (numpy.ndarray)

      - distance_matrix (numpy.ndarray)

  static nth(iterable, n, default=None)

    Returns the nth item or a default value

    Parameters:

      - iterable (iterable)

      - n (int)

      - default (default=None) – The default value to return