Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SmirkCao/Lihang
/ functions
Functions
228 in github.com/SmirkCao/Lihang
⨍
Functions
228
◇
Types & classes
38
↓ 12 callers
Method
predict
(self, x_)
CH08/adaboost.py:76
↓ 11 callers
Method
plot
(self, data)
CH17/utils.py:17
↓ 9 callers
Method
fit
(self, X, y)
CH02/perceptron.py:21
↓ 9 callers
Method
predict
(self, X)
CH02/perceptron.py:53
↓ 7 callers
Method
predict
(self, X)
CH06/demo.py:154
↓ 6 callers
Method
fit
(self, X, y)
CH05/dt.py:29
↓ 5 callers
Method
_do_backward
(self, X)
CH10/hmm.py:69
↓ 4 callers
Method
_cal_entropy
(y)
CH05/dt.py:62
↓ 4 callers
Method
_do_forward
(self, X)
CH10/hmm.py:51
↓ 4 callers
Method
decode
Find most likely state sequence corresponding to ``X``.
CH10/hmm.py:156
↓ 4 callers
Method
draw_arrow
(origin, e1, e2)
CH15/unit_test.py:126
↓ 4 callers
Method
fit_transform
(self, x)
CH16/pca.py:56
↓ 3 callers
Method
_pw
计算书85页公式6.22和6.23, 这个表示的是最大熵模型. mask相当于给 :param x: :return:
CH06/maxent.py:55
↓ 3 callers
Function
cal_ent
calculate shannon ent of x :param x: :return ent: H(D)=-\sum_{k=1}^K\frac{|C_k|}{|D|}\log_2\frac{|C_k|}{|D|}
CH05/decision_tree.py:197
↓ 3 callers
Function
f
(x_, y_, w_)
CH06/logistic_regression.py:66
↓ 3 callers
Method
fit
(self, x_, y_, d_=None)
CH08/adaboost.py:48
↓ 3 callers
Method
fit
(self, X, y)
CH07/svm.py:26
↓ 3 callers
Method
load_data
(path_="./Input/data_8-1.txt")
CH08/unit_test.py:13
↓ 3 callers
Method
predict
(self, x_)
CH08/adaboost.py:118
↓ 3 callers
Function
sigmoid
(x_)
CH06/logistic_regression.py:86
↓ 2 callers
Method
_distance
(self, x, y)
CH03/knn.py:55
↓ 2 callers
Method
_do_ei
(self, X, y, i)
CH07/svm.py:107
↓ 2 callers
Method
_gain
(X, y)
CH05/dt.py:82
↓ 2 callers
Method
_pyx
注意这个里面X没有去重, 所以, 如果有个特征出现了两次, 会加两次. :param X: :return:
CH06/demo.py:94
↓ 2 callers
Method
describe_tree
(self, tree=None)
CH05/decision_tree.py:103
↓ 2 callers
Method
fit
(self, X, y=None)
CH09/bmm.py:44
↓ 2 callers
Method
fit
(self, X, y)
CH04/nb.py:22
↓ 2 callers
Method
fit
(self, x)
CH14/clustering.py:56
↓ 2 callers
Method
fit
(self, x)
CH14/clustering.py:85
↓ 2 callers
Method
fit
(self, x)
CH16/pca.py:25
↓ 2 callers
Method
fit
(self, X)
CH03/knn.py:76
↓ 2 callers
Method
fit
(self, x)
CH17/lsa.py:19
↓ 2 callers
Method
fit
(self, x_, y_)
CH06/logistic_regression.py:26
↓ 2 callers
Function
gain
calculate information g(y, x) :param x: feature :param y: class :return: gain
CH05/decision_tree.py:228
↓ 2 callers
Method
gradient_descent
(self, x_, y_, epsilon_=0.00001, n_iter=1500)
CH06/logistic_regression.py:34
↓ 2 callers
Function
load_data
(path=None)
CH06/maxent.py:149
↓ 2 callers
Method
predict
(self, X)
CH04/nb.py:38
↓ 2 callers
Method
predict
(self, x_)
CH06/logistic_regression.py:29
↓ 2 callers
Method
test_load_data
(self)
CH06/unit_test.py:59
↓ 1 callers
Method
_EPx
计算书83页最上面那个期望 对于同样的y, Ex是一样的, 所以这个矩阵其实用长度是n的向量表示就可以了. :return:
CH06/maxent.py:72
↓ 1 callers
Method
__gen_threshold_lst
(self, start_, end_)
CH08/adaboost.py:80
↓ 1 callers
Method
_build_cart
:param x_: :param y_: :return: cart_tree
CH05/decision_tree.py:135
↓ 1 callers
Method
_build_tree
(self, x, y, eps)
CH05/decision_tree.py:56
↓ 1 callers
Method
_build_tree
(self, X, y)
CH05/dt.py:98
↓ 1 callers
Method
_cal_conditioanl_entropy
(X, y)
CH05/dt.py:70
↓ 1 callers
Method
_choose_best_fea
(self, x_, y_)
CH05/decision_tree.py:127
↓ 1 callers
Method
_convergence
(self)
CH06/demo.py:58
↓ 1 callers
Method
_do_clipalpha
(alpha, H, L)
CH07/svm.py:125
↓ 1 callers
Method
_do_estep
(self, X)
CH10/hmm.py:113
↓ 1 callers
Method
_do_eta
(X, i, j)
CH07/svm.py:112
↓ 1 callers
Method
_do_gxi
(self, X, y, i)
CH07/svm.py:103
↓ 1 callers
Method
_do_mstep
(self, X)
CH10/hmm.py:133
↓ 1 callers
Method
_do_selectj
(i, m)
CH07/svm.py:117
↓ 1 callers
Method
_do_smo
(self, X, y)
CH07/svm.py:38
↓ 1 callers
Method
_fit
(X, depth=0)
CH03/knn.py:34
↓ 1 callers
Method
_initparams
(self)
CH06/demo.py:50
↓ 1 callers
Method
_min_samples_leaf_check
(self, X)
CH05/dt.py:93
↓ 1 callers
Method
_model_ep
注意这里, 考虑到不同的样本都在刷这个_ep, :return:
CH06/demo.py:119
↓ 1 callers
Method
_px_pxy
统计TF, 这里面没有用稀疏存储的方式. 所以这里会有很多的0, 包括后面的E也会有很多零, 需要处理掉除零的问题. 这里x, y是全量的数据, :param x: :param y: :return:
CH06/maxent.py:31
↓ 1 callers
Method
_sample_ep
样本期望, 特征函数f(x, y)关于经验分布\tilde p(x,y)的期望 每个样本的直方图, 这个采用了稀疏存储, 实际上这里对应(m,n)的二维数组, 对应了不同的y情况下的特征直方图. :return:
CH06/demo.py:64
↓ 1 callers
Method
_search
(self, point, tree=None, depth=0, best=None)
CH03/knn.py:58
↓ 1 callers
Method
_search
(self, X, parent=None)
CH05/dt.py:34
↓ 1 callers
Method
_zx
因为后面利用最大熵模型计算条件概率分布pyx的时候,需要归一化, 所以求解Zx :param X: :return:
CH06/demo.py:77
↓ 1 callers
Method
backward
后向算法
CH10/hmm.py:100
↓ 1 callers
Function
cal_condition_ent
calculate condition ent(y|x) :param x: feature :param y: class :return: ent(y|x)
CH05/decision_tree.py:211
↓ 1 callers
Method
calc_ms
(y)
CH08/adaboost.py:150
↓ 1 callers
Method
calc_res
(x, y, theta)
CH08/adaboost.py:171
↓ 1 callers
Method
decode
(self, X)
CH11/crf.py:40
↓ 1 callers
Method
density
(self)
CH09/bmm.py:85
↓ 1 callers
Method
do_e_step
(self)
CH09/bmm.py:90
↓ 1 callers
Method
do_m_step
(self)
CH09/bmm.py:97
↓ 1 callers
Method
fit
(self, x_, y_)
CH08/adaboost.py:94
↓ 1 callers
Method
fit
(self, x_, y_)
CH08/adaboost.py:136
↓ 1 callers
Method
fit
(self, X)
CH10/hmm.py:145
↓ 1 callers
Method
fit
(self, x, y)
CH05/decision_tree.py:29
↓ 1 callers
Method
fit
eq 6.34 实际上这里是个熵差, plog(p)-plog(p)这种情况下, 对数差变成比值. :param x: :param y: :return: self: object
CH06/maxent.py:85
↓ 1 callers
Method
forward
前向算法
CH10/hmm.py:87
↓ 1 callers
Function
gain_ratio
calculate gain ration gr(y, x) :param x: feature :param y: class :return: gr
CH05/decision_tree.py:238
↓ 1 callers
Function
get_dummy
()
CH09/gmm.py:15
↓ 1 callers
Function
gini
:param x_: Feature A :param y_: Class D :param s_: split threshold :return: gini(y,x) or gini(y)
CH05/decision_tree.py:176
↓ 1 callers
Function
gmm
todo: 封装, 输入检测, 使用矩阵操作要比循环快很多, 一两个数量级的差异, 可以做个对比 :param X: :return:
CH09/gmm.py:28
↓ 1 callers
Method
init_param
(self, X)
CH10/hmm.py:37
↓ 1 callers
Method
is_convergence
(self)
CH09/bmm.py:81
↓ 1 callers
Function
load_data
data size is 28x28, 784 :param path_: :return:
CH06/logistic_regression.py:92
↓ 1 callers
Method
load_data
(self, filename)
CH06/demo.py:30
↓ 1 callers
Method
predict
(self, X)
CH03/knn.py:80
↓ 1 callers
Method
predict
(self, x, x_tree=None)
CH05/decision_tree.py:33
↓ 1 callers
Method
predict
(self, X)
CH05/dt.py:49
↓ 1 callers
Method
predict
:param x: :return:
CH06/maxent.py:123
↓ 1 callers
Method
predict_proba
:param x: :return:
CH06/maxent.py:136
↓ 1 callers
Method
train
(self, maxiter=1000)
CH06/demo.py:139
Method
__init__
:param n_components: :param max_iter: :param tol: :param mu: 这里可能要看一下和书中的p,q对应关系, p=0.6, q=0.7, 对应了X=1 X=0的情况, 所以[0.
CH09/bmm.py:13
Method
__init__
(self, pi=0, p=0, q=0)
CH09/model.py:14
Method
__init__
(self, lambda_)
CH04/nb.py:14
Method
__init__
(self, name, data, linkage="single")
CH14/clustering.py:11
Method
__init__
(self, k=2, maxiter=1000)
CH14/clustering.py:39
Method
__init__
(self, n_components=2)
CH16/pca.py:12
Method
__init__
y: 标记的集合
CH11/crf.py:13
Method
__init__
(self, )
CH08/adaboost.py:43
Method
__init__
(self, ds, max_iter=10)
CH08/adaboost.py:87
next →
1–100 of 228, ranked by callers