TP、TN、FP、FN、map、Precision、Recall

TP代表被正确分类的正样本,TN表示被正确分类的负样本,FP是被错误分类为正样本的负样本,而FN是被错误分类为负样本的正样本。这些术语常用于评估机器学习和数据分析中的分类性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

什么是TP、TN、FP、FN
TP的英文全称为True Positives,其指的是被分配为正样本,而且分配对了的样本,代表的是被正确分类的正样本,。
TN的英文全称为True Negatives,其指的是被分配为负样本,而且分配对了的样本,代表的是被正确分类的负样本。
FP的英文全称为False Positives,其指的是被分配为正样本,但分配错了的样本,代表的是被错误分类的负样本。
FP的英文全称为False Negatives,其指的是被分配为负样本,但分配错了的样本,代表的是被错误分类的正样本。
在这里插入图片描述
转载地址

以下是 pcl/evaluation/precision_recall.h 文件中的代码示例,包括 PrecisionRecallCurve 类和 confusionMatrix 函数的定义: ```c++ #ifndef PCL_EVALUATION_PRECISION_RECALL_H_ #define PCL_EVALUATION_PRECISION_RECALL_H_ #include <pcl/common/common.h> #include <pcl/point_types.h> #include <vector> #include <map> #include <iostream> #include <string> #include <utility> namespace pcl { namespace evaluation { /** \brief A class that computes precision-recall curves. * \author Radu Bogdan Rusu * \ingroup evaluation */ template<typename PointT> class PrecisionRecallCurve { public: typedef typename pcl::PointCloud<PointT>::Ptr PointCloudPtr; typedef typename pcl::PointCloud<PointT>::ConstPtr PointCloudConstPtr; /** \brief Constructor. */ PrecisionRecallCurve () : tp_ (0), fp_ (0), tn_ (0), fn_ (0) {}; /** \brief Destructor. */ virtual ~PrecisionRecallCurve () {}; /** \brief Add ground truth data. * \param[in] ground_truth the input ground truth data */ virtual void addGroundTruth (const PointCloudPtr &ground_truth); /** \brief Add computed data. * \param[in] computed_data the input computed data */ virtual void addComputedData (const PointCloudPtr &computed_data); /** \brief Compute the precision-recall curve for the given data. * \param[out] precision_recall_curve the output precision-recall curve */ virtual void compute (std::vector<std::pair<float, float> > &precision_recall_curve); /** \brief Reset the internal counters. */ virtual void reset (); protected: /** \brief The number of true positives. */ unsigned int tp_; /** \brief The number of false positives. */ unsigned int fp_; /** \brief The number of true negatives. */ unsigned int tn_; /** \brief The number of false negatives. */ unsigned int fn_; }; /** \brief Compute the confusion matrix. * \param[in] ground_truth the input ground truth data * \param[in] computed_data the input computed data * \param[out] confusion the output confusion matrix */ void confusionMatrix (const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &ground_truth, const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &computed_data, std::map<std::string, unsigned int> &confusion); } } #include <pcl/evaluation/impl/precision_recall.hpp> #endif // PCL_EVALUATION_PRECISION_RECALL_H_ ``` 其中,PrecisionRecallCurve 类提供了计算精度-召回率曲线的接口,addGroundTruth 和 addComputedData 函数用于添加实际标签和预测标签数据,compute 函数用于计算精度-召回率曲线,reset 函数用于重置内部计数器。confusionMatrix 函数用于计算混淆矩阵。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值