tedana.selection._utils¶
Utility functions for tedana.selection
Functions
do_svm (X_train, y_train, X_test[, svmtype]) |
Implements Support Vector Classification on provided data |
getelbow_aggr (arr[, return_val]) |
Elbow using curvature - aggressive |
getelbow_cons (arr[, return_val]) |
Elbow using mean/variance method - conservative |
getelbow_mod (arr[, return_val]) |
Elbow using linear projection method - moderate |
-
do_svm
(X_train, y_train, X_test, svmtype=0)[source]¶ Implements Support Vector Classification on provided data
Parameters: - X_train ((N1 x F) array_like) – Training vectors, where n_samples is the number of samples in the training dataset and n_features is the number of features.
- y_train ((N1,) array_like) – Target values (class labels in classification, real numbers in regression)
- X_test ((N2 x F) array_like) – Test vectors, where n_samples is the number of samples in the test dataset and n_features is the number of features.
- svmtype (
int
, optional) – Desired support vector machine type. Must be in [0, 1, 2]. Default: 0
Returns: - y_pred ((N2,)
numpy.ndarray
) – Predicted class labels for samples in X_test - clf ({
sklearn.svm.SVC
,sklearn.svm.LinearSVC
}) – Trained sklearn model instance
-
getelbow_aggr
(arr, return_val=False)[source]¶ Elbow using curvature - aggressive
Parameters: - arr ((C,) array_like) – Metric (e.g., Kappa or Rho) values.
- return_val (
bool
, optional) – Return the value of the elbow instead of the index. Default: False
Returns: Either the elbow index (if return_val is True) or the values at the elbow index (if return_val is False)
Return type:
-
getelbow_cons
(arr, return_val=False)[source]¶ Elbow using mean/variance method - conservative
Parameters: - arr ((C,) array_like) – Metric (e.g., Kappa or Rho) values.
- return_val (
bool
, optional) – Return the value of the elbow instead of the index. Default: False
Returns: Either the elbow index (if return_val is True) or the values at the elbow index (if return_val is False)
Return type:
-
getelbow_mod
(arr, return_val=False)[source]¶ Elbow using linear projection method - moderate
Parameters: - arr ((C,) array_like) – Metric (e.g., Kappa or Rho) values.
- return_val (
bool
, optional) – Return the value of the elbow instead of the index. Default: False
Returns: Either the elbow index (if return_val is True) or the values at the elbow index (if return_val is False)
Return type: