Github上你找不到python版
Logistic 函数求导看这里
Sigmoid函数求导_np.exp(-x)_DeniuHe的博客-CSDN博客
Car数据集上五折交叉的分类精度。
相对标准的版本
"""
Daniel He
at CQUPT
2023-06-08
"""
import xlwt
import xlrd
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
from copy import deepcopy
from time import time
from scipy.special import expit
from sklearn.preprocessing import OneHotEncoder
from sklearn.metrics import accuracy_score, mean_absolute_error, f1_score, mutual_info_score
from pathlib import Path
from sklearn.preprocessing import StandardScaler
from mord import LogisticAT
class POM():
def __init__(self):
self.X_train = None
self.y_train = None
self.max_iter = 500
self.lr = 0.001
self.tol = 1e-03
print(self.tol)
self