DataSet¶
-
class
minkit.
DataSet
(data, pars, weights=None)[source]¶ Bases:
minkit.pdfs.dataset.DataObject
Definition of an unbinned data set to evaluate PDFs.
- Parameters
Attributes Summary
Object to do operations on arrays.
Backend interface.
Data parameters associated to this sample.
Number of dimensions.
Values of the data set.
Weights of the sample.
Methods Summary
from_ndarray
(arr, data_par[, weights, backend])Build the class from a single array.
from_records
(arr, data_pars[, weights, backend])Build the class from a
numpy.ndarray
object.make_binned
([bins])Make a binned version of this sample.
merge
(samples[, maximum])Merge many samples into one.
subset
(arg[, rescale_weights])Get a subset of this data set.
to_backend
(backend)Initialize this class in a different backend.
Convert this class into a
numpy.ndarray
object.Attributes Documentation
-
aop
¶ Object to do operations on arrays.
- Type
-
sample_type
= 'unbinned'¶
Methods Documentation
-
classmethod
from_ndarray
(arr, data_par, weights=None, backend=None)[source]¶ Build the class from a single array.
- Parameters
arr (numpy.ndarray) – array of data.
weights (numpy.ndarray) – possible weights to use.
-
classmethod
from_records
(arr, data_pars, weights=None, backend=None)[source]¶ Build the class from a
numpy.ndarray
object.- Parameters
arr (numpy.ndarray) – array of data.
weights (numpy.ndarray) – possible weights to use.
-
make_binned
(bins=100)[source]¶ Make a binned version of this sample.
-
classmethod
merge
(samples, maximum=None)[source]¶ Merge many samples into one. If maximum is specified, then the last elements will be dropped.
- Parameters
- Returns
Merged sample.
- Return type
- … warning:: If maximum is specified, the last elements corresponding to the
last samples might be dropped.
-
subset
(arg, rescale_weights=False)[source]¶ Get a subset of this data set. If arg is a string, it will be considered as a range. In case it is a
barray
, then it is considered to be a mask array. If rescale_weights is set to True, then the weights are rescaled so their statistical weight in minimization processes is proportional to the event weights:\[\omega^\prime_i = \omega_i \times \frac{\sum_{j = 0}^n \omega_j}{\sum_{j = 0}^n \omega_j^2}\]
-
to_backend
(backend)[source]¶ Initialize this class in a different backend.
- Parameters
backend (Backend) – new backend.
- Returns
This class in the new backend.
-
to_records
()[source]¶ Convert this class into a
numpy.ndarray
object.- Returns
This object as a a
numpy.ndarray
object.- Return type