calix.common.algorithms.PolynomialPrediction
-
class
calix.common.algorithms.
PolynomialPrediction
(probe_parameters: Union[int, numpy.ndarray], polynomial: numpy.polynomial.polynomial.Polynomial) Bases:
calix.common.algorithms.PredictiveModel
Class implementing a polynomial predictive model. Construction of this class requires an instance of numpy Polynomial which already contains suitable parameters, or measured data from characterization of the parameter/result pair to be calibrated (via from_data()). In the latter case, a fit to the data is performed to obtain the numpy polynomial.
- Variables
polynomial – Instance of numpy polynomial, used as a model to map target values to parameters.
-
__init__
(probe_parameters: Union[int, numpy.ndarray], polynomial: numpy.polynomial.polynomial.Polynomial) - Parameters
probe_parameters – Parameter at which a measurement was or will be taken in order to determine the offsets for each calibration instance. Refer to _predict for details.
Methods
__init__
(probe_parameters, polynomial)- param probe_parameters
Parameter at which a measurement
from_data
(parameters, results, degree)Construct the polynomial prediction from data.
-
classmethod
from_data
(parameters: numpy.ndarray, results: numpy.ndarray, degree: int) → calix.common.algorithms.PolynomialPrediction Construct the polynomial prediction from data. A polynomial of given degree is fitted to the parameters and results. Refer to the documentation of numpy.polynomial.polynomial.Polynomial for details on how the fit is performed.
The median of the parameters used during characterization is used as probe point when determining the offset of each instance during prediction.
- Parameters
parameters – Array of parameters where values have been recored.
results – Array of results obtained at parameters.
degree – Degree of the fitted polynomial.