twistpy.polarization.SupportVectorMachine.train#
- SupportVectorMachine.train(wave_types: List[str] = ['R', 'L', 'P', 'SV', 'SH', 'Noise'], N: int = 5000, scaling_velocity: float = 1.0, vp: Tuple[float, float] = (50.0, 2000.0), vp_to_vs: Tuple[float, float] = (1.7, 2.4), vl: Tuple[float, float] = (50, 2000), vr: Tuple[float, float] = (50, 2000), phi: Tuple[float, float] = (0, 360), theta: Tuple[float, float] = (0, 90), xi: Tuple[float, float] = (-90, 90), free_surface: bool = True, C: float = 10.0, kernel: str = 'rbf', gamma: Union[str, float] = 'scale', plot_confusion_matrix: bool = True) None [source]#
Train support vector machine with random polarization models from the specified parameter range.
- Parameters
- wave_types
list
ofstr
, default=[‘R’, ‘L’, ‘P’, ‘SV’, ‘SH’, ‘Noise’] List of wave-types that are used for training.
‘P’: P-wave‘SV’: SV-wave‘SH’: SH-wave‘L’: Love-wave‘R’: Rayleigh-wave- N
int
, default=5000 Number of randomly generated polarization models for each wave type. Thereof, 80% are used for training and the remaining 20% are used for testing to evaluate the performance of the classifier.
- scaling_velocity
float
, default=1. Scaling velocity (in m/s) that was applied to the translational components of the real data.
- vp
tuple
P-wave velocity range (in m/s) from which the random parametrization of the training set of polarization vectors is drawn as (vp_min, vp_max).
- vp_to_vs
tuple
Range of P-to-S wave velocity ratios from which the random parametrization of the training set of polarization vectors is drawn (vp_to_vs_min, vp_to_vs_max).
- vl
tuple
Range of Love wave velocities in m/s.
- vr
tuple
Range of Rayleigh wave velocities in m/s.
- phi
tuple
Azimuth angle range in degrees.
- theta
tuple
Inclination angle range in degrees.
- xi
tuple
Rayleigh wave ellipticity angle range in degrees.
- free_surface
bool
, default=True Specifies whether free-surface polarization models apply
- C
float
, default=10.0 Regularization parameter for the support vector machine. See
sklearn.svm.SVC
.- kernel
str
or callable, default=’rbf’ Kernel type used for the support vector machine. Defaults to a radial basis function kernel. See
sklearn.svm.SVC
.- gamma
str
or float, default=’scale’ Kernel coefficient for the radial basis function kernel. See
sklearn.svm.SVC
.- plot_confusion_matrix
bool
, default=True Specify whether a confusion matrix will be plotted after training
- wave_types