ml_suite C++ API Reference¶
-
template<typename T>
class BaseFeature¶ - #include <feature_extractor.hpp>
Base class for all features.
All features have a
feature_size
which determines how many fields in the resulting feature array are writtien to by this feature.Subclassed by IterativeFeature< T >, PostFeature< T >
Protected Attributes
-
size_t _feature_size¶
-
size_t _feature_size¶
-
template<typename T>
class BasePulseModifier¶ - #include <pulse_modifier.hpp>
Base class for all pulse modifiers.
All derived classes must implement the following methods: intialize(pulse_map, frame): Perform necessary calcuations to initialize the pulse modifier. operator()(times, charges, om_key): Modify pulse times and charges for a given DOM.
Subclassed by ChargeWeightedMeanTimePulseModifier< T >, ChargeWeightedMedianTimePulseModifier< T >
-
template<typename T>
class ChargePercentile : public PostFeature<T>¶ - #include <feature_extractor.hpp>
charge percentile
Public Functions
-
template<typename T>
class ChargeUntilT : public PostFeature<T>¶ - #include <feature_extractor.hpp>
Calculate the sum of all charges up to a time t.
The time t is relative to the time of the first pulse.
Public Functions
-
template<typename T>
class ChargeWeightedMean : public PostFeature<T>¶ - #include <feature_extractor.hpp>
-
template<typename T>
class ChargeWeightedMeanAndStd : public PostFeature<T>¶ - #include <feature_extractor.hpp>
-
template<typename T>
class ChargeWeightedMeanTimePulseModifier : public BasePulseModifier<T>¶ - #include <pulse_modifier.hpp>
Calculate pulse times relative to charge weighted mean time of event
Public Functions
-
inline ChargeWeightedMeanTimePulseModifier()¶
-
inline virtual void initialize(const I3RecoPulseSeriesMap &pulse_map, const I3Frame &frame)¶
-
inline ChargeWeightedMeanTimePulseModifier()¶
-
template<typename T>
class ChargeWeightedMedianTimePulseModifier : public BasePulseModifier<T>¶ - #include <pulse_modifier.hpp>
Calculate pulse times relative to charge weighted median time of event. Set interpolate to true if the median should be interpolated if between two times.
Public Functions
-
inline ChargeWeightedMedianTimePulseModifier(bool interpolate = false)¶
-
inline virtual void initialize(const I3RecoPulseSeriesMap &pulse_map, const I3Frame &frame)¶
-
inline ChargeWeightedMedianTimePulseModifier(bool interpolate = false)¶
-
template<typename T>
class ChargeWeightedStd : public PostFeature<T>¶ - #include <feature_extractor.hpp>
-
template<typename T>
class EventFeatureExtractor¶ - #include <event_feature_extractor.hpp>
Event Feature Extractor class.
The event feature extractor class applies exclusions, modifies pulses (e.g. relative time offset or cleaning), and extracts features for a given event.
Public Functions
-
inline size_t size()¶
Return number of features.
-
inline size_t n_doms()¶
Return number of doms.
-
inline size_t n_strings()¶
Return number of strings.
-
inline void setExclusions(const std::vector<std::string> &exclusions, bool partial_exclusion)¶
Set DOM and TimeWindow exclusions
-
inline void fill_feature_matrix(T *matrix, const boost::python::object &frame_obj)¶
Helper function to fill the feature array from the frame
-
inline I3MapKeyVectorDoublePtr get_feature_map(boost::python::object &frame_obj)¶
Extract features from frame and return a map omkey -> feature vec for all DOMs that have at least one non-zero feature
-
inline std::shared_ptr<FeatureExtractorFrameObject> get_frame_object(boost::python::object &frame_obj)¶
Extract features from frame and return a FeatureExtratorFrame object DO WE STILL NEED THIS?
-
inline bn::ndarray operator()(boost::python::object &frame_obj)¶
Extract features from event and return ndarray[n_strings][n_doms][n_features]
-
virtual ~EventFeatureExtractor() = default¶
-
inline size_t size()¶
-
template<typename T>
class FeatureExtractor¶ - #include <feature_extractor.hpp>
Class for dispatching the feature calculation to the individual Feature objects.
-
class FeatureExtractorFrameObject : public I3FrameObject¶
- #include <feature_extractor_frameobj.h>
Public Functions
-
inline FeatureExtractorFrameObject()¶
-
inline FeatureExtractorFrameObject(const std::vector<double> &nonzero_data, const std::vector<int> &nonzero_indices, int n_strings, int n_doms, int n_features)¶
-
inline int GetNStrings()¶
-
inline int GetNDOMs()¶
-
inline int GetNFeatures()¶
-
inline size_t size()¶
-
inline bn::ndarray GetFeatureArray()¶
Friends
- friend class icecube::serialization::access
-
inline FeatureExtractorFrameObject()¶
-
template<typename T>
class IterativeFeature : public BaseFeature<T>¶ - #include <feature_extractor.hpp>
Base class for iterative features.
Iterative features operate on one pulse at a time.
Subclassed by TotalCharge< T >
-
template<typename T>
class MeanVarianceAccumulator¶ - #include <utils.hpp>
Public Functions
-
inline MeanVarianceAccumulator(int dof = 1)¶
Private Members
-
int _dof¶
-
inline MeanVarianceAccumulator(int dof = 1)¶
-
template<typename T>
class PostFeature : public BaseFeature<T>¶ - #include <feature_extractor.hpp>
Base class for post features.
Post features operate on vectors of charges and times
Subclassed by ChargePercentile< T >, ChargeUntilT< T >, ChargeWeightedMean< T >, ChargeWeightedMeanAndStd< T >, ChargeWeightedStd< T >, TFirstPulse< T >, TimeAtChargePercentile< T >, TLastPulse< T >, TSpread< T >, TStd< T >
Public Functions
Public Members
-
bool req_chg_sorted = false¶
-
bool req_chg_sorted = false¶
-
template<typename T>
class TFirstPulse : public PostFeature<T>¶ - #include <feature_extractor.hpp>
Public Functions
-
inline TFirstPulse()¶
Public Members
-
bool req_chg_sorted = false¶
-
inline TFirstPulse()¶
-
template<typename T>
class TimeAtChargePercentile : public PostFeature<T>¶ - #include <feature_extractor.hpp>
Return time after which given percentile of the charge has been collected.
Public Functions
-
template<typename T>
class TLastPulse : public PostFeature<T>¶ - #include <feature_extractor.hpp>
Public Functions
-
inline TLastPulse()¶
Public Members
-
bool req_chg_sorted = false¶
-
inline TLastPulse()¶
-
template<typename T>
class TotalCharge : public IterativeFeature<T>¶ - #include <feature_extractor.hpp>
Calculate the sum of all charges
-
template<typename T>
class TSpread : public PostFeature<T>¶ - #include <feature_extractor.hpp>
Public Functions
-
inline TSpread()¶
Public Members
-
bool req_chg_sorted = false¶
-
inline TSpread()¶
-
template<typename T>
class TStd : public PostFeature<T>¶ - #include <feature_extractor.hpp>
Public Functions
-
inline TStd(int dof = 1)¶
Public Members
-
bool req_chg_sorted = false¶
Private Members
-
int _dof¶
-
inline TStd(int dof = 1)¶
-
namespace std
STL namespace.
- file event_feature_extractor.hpp
- #include <string>#include <vector>#include <memory>#include “icetray/I3Frame.h”#include “icetray/OMKey.h”#include “dataclasses/physics/I3RecoPulse.h”#include “dataclasses/I3Map.h”#include <boost/python.hpp>#include <boost/python/numpy.hpp>#include <boost/make_shared.hpp>#include “exclusions.hpp”#include “pulse_modifier.hpp”#include “feature_extractor.hpp”#include “feature_extractor_frameobj.h”
- file exclusions.hpp
- #include <vector>#include <memory>#include “icetray/I3Frame.h”#include “dataclasses/physics/I3RecoPulse.h”#include “dataclasses/I3Map.h”#include “dataclasses/I3TimeWindow.h”
Functions
-
I3RecoPulseSeriesMapPtr get_valid_pulse_map(const I3Frame &frame, const std::string pulse_key, std::vector<std::string> dom_exclusions, const bool partial_exclusion, const bool verbose)¶
Apply DOM and TimeWindow Exclusions
This method creates a new pulse series based on the given pulse series name, but excludes pulses and DOMs as specified with the
dom_exclusions
andpartial_exclusion
.
-
I3RecoPulseSeriesMapPtr get_valid_pulse_map(const I3Frame &frame, const std::string pulse_key, std::vector<std::string> dom_exclusions, const bool partial_exclusion, const bool verbose)¶
- file feature_extractor.hpp
- #include <vector>#include <memory>#include <set>#include <functional>#include <numeric>#include <iostream>#include <utility>#include <stdexcept>
- file feature_extractor_frameobj.cxx
- #include <icetray/I3Logging.h>#include “ml_suite/feature_extractor_frameobj.h”
Functions
-
I3_SERIALIZABLE(FeatureExtractorFrameObject)¶
-
std::ostream &operator<<(std::ostream &oss, const FeatureExtractorFrameObject &d)¶
-
I3_SERIALIZABLE(FeatureExtractorFrameObject)¶
- file feature_extractor_frameobj.h
- #include <icetray/serialization.h>#include <icetray/I3Logging.h>#include <icetray/I3FrameObject.h>#include <vector>#include <boost/python.hpp>#include <boost/python/numpy.hpp>
Functions
-
std::ostream &operator<<(std::ostream &oss, const FeatureExtractorFrameObject &d)
-
I3_POINTER_TYPEDEFS(FeatureExtractorFrameObject)¶
-
I3_CLASS_VERSION(FeatureExtractorFrameObject, feature_extractor_frame_object_version_)¶
Variables
-
static const unsigned feature_extractor_frame_object_version_ = 0¶
-
std::ostream &operator<<(std::ostream &oss, const FeatureExtractorFrameObject &d)
- file pulse_modifier.hpp
- #include <vector>#include “icetray/I3Frame.h”#include “icetray/OMKey.h”#include “dataclasses/physics/I3RecoPulse.h”#include “dataclasses/I3Map.h”#include “utils.hpp”
- file utils.hpp
- #include <map>#include “icetray/OMKey.h”#include <numeric>#include <algorithm>#include <vector>#include <memory>
- dir icetray
- dir ml_suite
- dir ml_suite
- dir ml_suite
- dir private
- dir public