逻辑回归是非常经典的分类算法,通过sigmoid非线性函数实现的二分类器,关于函数原型、分类算法原理可参考:
https://blog.csdn.net/u014258807/article/details/80616647
sigmoid函数定义为:
函数图形为:
其推导过程略,实现可参考github:https://github.com/codestorm04/Arma_ML 项目下的src/logistic/logistic_classifier.cc。
对应logistic_classifier.h 定义如下:
/*
* The entry of the module datasets
* compile with flags:
* author: Yuzhen Liu
* Date: 2019.3.24 11:59
*/
#ifndef LOGISTIC_CLASSIFIER_H
#define LOGISTIC_CLASSIFIER_H
#include