/** * @file eqpalg/distribution/frame.h * @brief 分布类型的数据处理框架 * @author Cat (null.null.null@qq.com) * @version 0.1 * @date 2021-08-21 * * Copyright: Baosight Co. Ltd. * DO NOT COPY/USE WITHOUT PERMISSION * */ #pragma once #include "mix_cc/algorithm/is_in_range.h" #include "mix_cc/algorithm/split.h" #include "mix_cc/exception.h" #include #include #include #include #include #include #include #include namespace distribution { class Frame { public: static constexpr double legal_diff = 0.3; ///< 默认的合法差值,30% static constexpr double normal_skewness = 0; ///< 近似正态分布容许的偏度偏离范围 static constexpr double normal_ex_k = 0; ///< 近似正态分布的超值峰度偏离范文 protected: const std::unique_ptr logger_; const std::string rule_id_; const size_t dims_; public: /** * @brief Construct a new Frame object * @param ruleId My Param doc */ Frame(const std::string& ruleId, size_t dims); /** * @brief 初始化接受阈 * @param prob My Param doc * @return int */ int init_prob(double prob); /** * @brief 自动探测数据分布类型 * @return int */ int auto_detect_distribution(Rs rs, const SampleWindow& tmp_data); /** * @brief 得到合理分布区间 * @return mix_cc::float_range_t */ small_vector get_range(); /** * @brief 是否是指定类型的分布 * @return true * @return false */ bool is_distribution_valid(); /** * @brief 是否数据经过变换/映射 * @return true * @return false */ bool is_transformed(); protected: small_vector dist_; ///< 分布情况和合理上下限 protected: double prob_; ///< 接受区间(0~1) small_vector legal_range_; ///< 合法数值的上下限 bool valid = true; ///< 是否有效 protected: bool is_transformed_; ///< 数据是否因不满足正态分布而被映射作用区间,暂时不适用 DataMapping data_mapping_; ///< 用于数据映射的类,暂时不使用 }; } // namespace distribution