yatsm.cli.train module¶
Command line interface for training classifiers on YATSM output
-
yatsm.cli.train.
algo_diagnostics
(cfg, X, y, row, col, algo, n_fold, make_plots=True)[source]¶ Display algorithm diagnostics for a given X and y
Parameters: - cfg (dict) – YATSM configuration dictionary
- X (np.ndarray) – X feature input used in classification
- y (np.ndarray) – y labeled examples
- row (np.ndarray) – row pixel locations of y
- col (np.ndarray) – column pixel locations of y
- algo (sklearn classifier) – classifier used from scikit-learn
- n_fold (int) – number of folds for crossvalidation
- make_plots (bool, optional) – show diagnostic plots (default: True)
-
yatsm.cli.train.
find_result_attributes
(cfg)[source]¶ Return result attributes relevant for training a classifier
At this time, the only relevant information is the design information,
design (OrderedDict)
anddesign_matrix (str)
Parameters: cfg (dict) – YATSM configuration dictionary Returns: dictionary of result attributes Return type: dict
-
yatsm.cli.train.
get_training_inputs
(cfg, exit_on_missing=False)[source]¶ Returns X features and y labels specified in config file
Parameters: Returns: matrix of feature inputs for each training data sample y (np.ndarray): array of labeled training data samples row (np.ndarray): row pixel locations of y col (np.ndarray): column pixel locations of y labels (np.ndarraY): label of y if found, else None
Return type: X (np.ndarray)