机器学习
文章平均质量分 80
不擅长纵横的捭阖家
行走在荒野的撰写者
展开
-
异常检测介绍
异常检测介绍 1.基于传统机器学习的异常检测 传统的机器学习方法主流的以LOF、HBOS、PCA、OCSVM、KNN等。市面上有已经集合了类似的框架,如下: [Python] Python Outlier Detection (PyOD): PyOD is a comprehensive and scalable Python toolkit for detecting outlying objects in multivariate data. It contains more than 20 detec原创 2021-08-02 15:47:26 · 316 阅读 · 0 评论 -
用于二分类的机器学习模型评价
0 1 0 预测negative正确 TN 预测positive错误 FP 1 预测negative错误 FN 预测positive正确 TP 其中行代表真实值,列代表预测值 举个列子,在下面表格中0代表健康人,1代表患有癌症的人。 预测\真实 0 1 0 9978 12 1 2 8 这里面就可以看出有12个人没有患癌症,但是我们算法却错误的预测了他患了癌症。 精准率 precision=TPTP+FPprecision = \tfrac{TP}{T...原创 2021-03-24 15:02:13 · 259 阅读 · 0 评论 -
test 训练数集代码加注释
import tensorflow as tf import numpy as np from PIL import Image import mnist_backward import mnist_forward def restore_model (testPicArr): with tf.Graph().as_default() as g: x = tf.place...原创 2019-10-18 20:28:58 · 148 阅读 · 0 评论 -
神经网络的模块化
前向传播就是搭建网络,设计网络结构 forward.py def forward(x,regularizer): 定义前向传播过程 w= b= y= return y def get_weight(shape,regularizer): w的形状和正则化regularizer的权重 w=tf.Va...原创 2019-10-16 11:51:23 · 414 阅读 · 0 评论 -
深度学习前奏——正则化
废话 不多说,直接上代码: ```python import tensorflow as tf import numpy as np import matplotlib.pyplot as plt; BATCH_SIZE = 30 # 30个网格坐标点 seed = 2 # 基于seed产生随机数 rdm = np.random.RandomState(seed) X = rdm.rand...原创 2019-10-15 17:33:25 · 224 阅读 · 0 评论 -
搭建神经网络的八股过程——案列演示
搭建神经网络的八股过程 1 准备 import 常量定义 然后生成数据集 (数据是第一位 练习中可以用random来生成) 2 前向传播 定义输入、参数和输出 x= (输入为x 标准答案是y_) y_= w1= (第一层网络的参数w1) w2= (第二层网络的参数w2) a= y= (用矩阵 求出y)...原创 2019-10-14 18:39:36 · 248 阅读 · 0 评论