上一篇文章基于Python的信用评分卡模型分析(一)已经介绍了信用评分卡模型的数据预处理.探索性数据分析.变量分箱和变量选择等.接下来我们将继续讨论信用评分卡的模型实现和分析,信用评分的方法和自动评分系统. 六.模型分析 证据权重(Weight of Evidence,WOE)转换可以将Logistic回归模型转变为标准评分卡格式.引入WOE转换的目的并不是为了提高模型质量,只是一些变量不应该被纳入模型,这或者是因为它们不能增加模型值,或者是因为与其模型相关系数有关的误差较大,其实建立标准信用评…
信用风险计量体系包括主体评级模型和债项评级两部分.主体评级和债项评级均有一系列评级模型组成,其中主体评级模型可用“四张卡”来表示,分别是A卡.B卡.C卡和F卡:债项评级模型通常按照主体的融资用途,分为企业融资模型.现金流融资模型和项目融资模型等. 我们主要讨论主体评级模型的开发过程. 一.项目流程 典型的信用评分模型如图1-1所示.信用风险评级模型的主要开发流程如下: (1) 数据获取,包括获取存量客户及潜在客户的数据.存量客户是指已经在证券公司开展相关融资类业务的客户,包括个人客户和机构客户:…
实验介绍 数据采用Criteo Display Ads.这个数据一共11G,有13个integer features,26个categorical features. Spark 由于数据比较大,且只在一个txt文件,处理前用split -l 400000 train.txt对数据进行切分. 连续型数据利用log进行变换,因为从实时训练的角度上来判断,一般的标准化方式,如Z-Score和最大最小标准化中用到的值都跟某一批数据的整体统计结果有关,换一批数据后标准化就程度就不一样了. 而对于离散型分…
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("E:\\MNIST_data\\", one_hot=True) #构建回归模型,输入原始真实值(group truth),采用sotfmax函数拟合,并定义损失函数和优化器 #定义回归模型 x = tf.placeholder(tf.float32,…
import tensorflow as tf # 输入数据 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("E:\\MNIST_data", one_hot=True) # 定义网络的超参数 learning_rate = 0.001 training_iters = 200000 batch_size = 128 display_step =…
import tensorflow as tf tf.reset_default_graph() # 配置神经网络的参数 INPUT_NODE = 784 OUTPUT_NODE = 10 IMAGE_SIZE = 28 NUM_CHANNELS = 1 NUM_LABELS = 10 # 第一层卷积层的尺寸和深度 CONV1_DEEP = 32 CONV1_SIZE = 5 # 第二层卷积层的尺寸和深度 CONV2_DEEP = 64 CONV2_SIZE = 5 # 全连接层的节点个数 FC…
import tensorflow as tf v1 = tf.Variable(0, dtype=tf.float32) step = tf.Variable(0, trainable=False) ema = tf.train.ExponentialMovingAverage(0.99, step) maintain_averages_op = ema.apply([v1]) with tf.Session() as sess: # 初始化 init_op = tf.global_varia…
import os import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data tf.reset_default_graph() INPUT_NODE = 784 OUTPUT_NODE = 10 IMAGE_SIZE = 28 NUM_CHANNELS = 1 NUM_LABELS = 10 CONV1_DEEP = 32 CONV1_SIZE = 5…
import numpy as np inf = 99999 # 不连通值 mtx_graph = [[0, 1, inf, 3, inf, inf, inf, inf, inf], [1, 0, 5, inf, 2, inf, inf, inf, inf], [inf, inf, 0, 1, inf, 6, inf, inf, inf], [inf, inf, inf, 0, inf, 7, inf, 9, inf], [inf, 2, 3, inf, 0, 4, 2, inf, 8], [i…
from collections import defaultdict from heapq import * # 堆--先进后出 inf = 99999 # 不连通值 mtx_graph = [[0, 1, inf, 3, inf, inf, inf, inf, inf], [1, 0, 5, inf, 2, inf, inf, inf, inf], [inf, inf, 0, 1, inf, 6, inf, inf, inf], [inf, inf, inf, 0, inf, 7, inf,…