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_typeslist of str, 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
Nint, 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_velocityfloat, default=1.

Scaling velocity (in m/s) that was applied to the translational components of the real data.

vptuple

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_vstuple

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).

vltuple

Range of Love wave velocities in m/s.

vrtuple

Range of Rayleigh wave velocities in m/s.

phituple

Azimuth angle range in degrees.

thetatuple

Inclination angle range in degrees.

xituple

Rayleigh wave ellipticity angle range in degrees.

free_surfacebool, default=True

Specifies whether free-surface polarization models apply

Cfloat, default=10.0

Regularization parameter for the support vector machine. See sklearn.svm.SVC.

kernelstr or callable, default=’rbf’

Kernel type used for the support vector machine. Defaults to a radial basis function kernel. See sklearn.svm.SVC.

gammastr or float, default=’scale’

Kernel coefficient for the radial basis function kernel. See sklearn.svm.SVC.

plot_confusion_matrixbool, default=True

Specify whether a confusion matrix will be plotted after training