e15190.neutron_wall.pulse_shape_discrimination.FastTotalRansacEstimator

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.

Functions

__init__()

fit(X, y, **kwargs)

get_params([deep])

model(x, *args, **kwargs)

The fast-total relation function.

predict(X)

score(X, y)

Coefficient of determination.

set_params(**params)

__init__()
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