#ifndef LOGISTIC_H_
#define LOGISTIC_H_
#include<string>
#include<opencv2/opencv.hpp>
using cv::Mat;
using std::string;
void loadDataSet(string filePath, Mat& data, Mat& label);
void sigmoid(const Mat& inX, Mat& output);
float sigmoid(float inX);
Mat gradAscent(const Mat& data, const Mat& label, float alpha, int epoch);
Mat SGD(const Mat& data, const Mat& label, float alpha, int epoch);
float calAccuracy(const Mat& data, const Mat& label, const Mat& weight);
void logistic(string trainPath, string testPath, float alpha, int epoch);
#endif
#include"Logistic.h"
#include<sstream>
#include<vector>
#include<fstream>
#include<iostream>
#include<opencv2/opencv.hpp>
#include<ctime>
#include<algorithm>
using std::cout;
using std::endl;
using std::vector;
void loadDataSet(string filePath, Mat& data, Mat& label)
{
std::ifstream path;
path.open(filePath);
if (