e15190.neutron_wall.pulse_shape_discrimination¶
Classes
|
|
Custom base estimator object for RANSAC. |
|
|
|
|
|
|
|
|
- class e15190.neutron_wall.pulse_shape_discrimination.FastTotalRansacEstimator¶
Custom base estimator object for RANSAC.
By default, RANSAC regressor in scikit-learn only uses linear regression. To use custom regressor, we need to construct a base estimator object. See sklearn.linear_model.RANSACRegressor for more details.
- model(x, *args, **kwargs)¶
The fast-total relation function.
This function is currently just an empty function. When inheriting from this class, define this model to enable all other methods that depend on the model.
- Parameters
x (array-like) – The TOTAL values.
- Returns
y – The predicted FAST values.
- Return type
array-like
- score(X, y)¶
Coefficient of determination.
- Parameters
X (array-like, shape (n_samples, n_features)) – Input data.
y (array-like, shape (n_samples,)) – Target values, or ground truth.
- Returns
score – The coefficient of determination. For model that perfectly predicts all true values, the score is 1. For model that always predicts the mean of all true values, the score is 0. Models with worse performance will have negative scores.
- Return type
float
- class e15190.neutron_wall.pulse_shape_discrimination.FastTotalRansacEstimatorGamma(*args, **kwargs)¶
- model(x, p0, p1)¶
The fast-total relation for gammas.
- Parameters
x (array_like) – The TOTAL values.
p0 (float) – The intercept.
p1 (float) – The slope.
- Returns
y – The predicted FAST values.
- Return type
array_like
- class e15190.neutron_wall.pulse_shape_discrimination.FastTotalRansacEstimatorNeutron(*args, **kwargs)¶
- model(x, a0, a1, a2)¶
The fast-total relation for neutrons.
Unlike gammas, whose fast-total relation is mostly linear, the observed fast-total relation of neutrons has non-linearity at low TOTAL light region. Hence, we fit the fast-total relation using piecewise function. When
TOTAL >= x_switch, we use linear function; whenTOTAL < x_switch, we quadratic function. AtTOTAL = x_switch, the two functions are continuous and smooth. This removes the freedom of choosing the intercept and slope of the linear function, hence there are only three parameters,a0,a1anda2.- Parameters
x (array_like) – The TOTAL values.
a0 (float) – The intercept.
a1 (float) – The slope.
a2 (float) – The coefficient of the quadratic term.
- Returns
y – The predicted FAST values.
- Return type
array_like
- class e15190.neutron_wall.pulse_shape_discrimination._MainUtilities¶
Functions, classes and attributes for using this module as a script.