数据挖掘(二)预测潜在贷款发放客户

article/2025/3/18 19:40:18

注:参考多篇csdn及b站文章所得

一、实验背景

某机构想要预测哪些客户可能会产生贷款违约行为。他们搜集了历史客户行为的部分数据以及目标客户的信息,希望通过历史数据对目标客户进行预测哪些客户会是潜在的违约客户,从而缩小目标范围,实现低风险贷款发放。

搜集到的数据以.CSV存储,分别包括历史客户和目标客户两个文件。数据描述如下:

字段名

字段描述

数据类型

income

客户收入

int

age

客户年龄

int

experience

工作年限

int

profession

职业

string

married

婚否

string

house_ownership

有房/租房/其它

string

car_ownership

是否有车

string

risk_flag

是否拖欠贷款

string

currentjobyears

现有工作年限

int

currenthouseyears

在当前住所居住时长

int

city

居住城市

string

state

居住州/邦

string

二、实验内容

基于分类方法,根据客户历史行为预测潜在的贷款客户

三、实验步骤

1.导入数据

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import datetime
import warnings
from sklearn.preprocessing import LabelEncoder
warnings.filterwarnings('ignore')#一、数据导入
app_train=pd.read_csv('D:/班级作业/数据挖掘/实验报告/实验二/archive/historic customer behavior.csv')
app_test =pd.read_csv('D:/班级作业/数据挖掘/实验报告/实验二/archive/target customer.csv')

2.数据探索性分析

#二、数据探索性分析
# 画图代码
def plot_stats(feature, label_rotation=False, horizontal_layout=True):temp = app_train[feature].value_counts()df1 = pd.DataFrame({feature: temp.index, 'Number of contracts': temp.values})# 计算每个属性类别中Risk_Flag=1的个数cat_perc = app_train[[feature, 'Risk_Flag']].groupby([feature], as_index=False).mean()cat_perc.sort_values(by='Risk_Flag', ascending=False, inplace=True)if (horizontal_layout):fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(12, 6))else:fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(12, 14))sns.set_color_codes("pastel")s = sns.barplot(ax=ax1, x=feature, y="Number of contracts", data=df1)if (label_rotation):s.set_xticklabels(s.get_xticklabels(), rotation=90)s = sns.barplot(ax=ax2, x=feature, y='Risk_Flag', order=cat_perc[feature], data=cat_perc)if (label_rotation):s.set_xticklabels(s.get_xticklabels(), rotation=90)plt.ylabel('Percent of Risk_Flag with value 1 [%]', fontsize=10)plt.tick_params(axis='both', which='major', labelsize=10)plt.gcf().subplots_adjust(left=0.05,top=0.91,bottom=0.09)plt.show();
def plot_distribution(var):i = 0t1 = app_train.loc[app_train['Risk_Flag'] != 0]t0 = app_train.loc[app_train['Risk_Flag'] == 0]sns.set_style('whitegrid')plt.figure()fig, ax = plt.subplots(2, 2, figsize=(6, 6))for feature in var:i += 1plt.subplot(2, 2, i)sns.kdeplot(t1[feature], bw=0.5, label="Risk_Flag = 1")sns.kdeplot(t0[feature], bw=0.5, label="Risk_Flag = 0")plt.ylabel('Density plot', fontsize=12)plt.xlabel(feature, fontsize=12)locs, labels = plt.xticks()plt.tick_params(axis='both', which='major', labelsize=12)plt.show();
plt.figure(figsize = (5, 6))#1.年龄的影响
# 按时偿还贷款的KDE(kdeplot,核密度估计图)图
sns.kdeplot(app_train.loc[app_train['Risk_Flag'] == 0, 'Age'], label='Risk_Flag == 0')
# 没有按时偿还贷款的KDE(kdeplot,核密度估计图)图
sns.kdeplot(app_train.loc[app_train['Risk_Flag'] == 1, 'Age'], label='Risk_Flag == 1')
# 标签设置
plt.xlabel('Age (years)'); plt.ylabel('Density'); plt.title('Distribution of Ages');
plt.gcf().subplots_adjust(left=0.05,right=0.91, top=0.9, bottom=0.09)
plt.show()
#年龄的影响
plot_stats('Age',False,False)
#2.收入的影响
plot_stats('Income',False,False)
#3.房车的影响
plot_stats('FLAG_OWN_CAR')
plot_stats('FLAG_OWN_REALTY')
#4.婚否的影响
plot_stats('Married/Single',True, True)
#5.工作经验的影响
plot_stats('Experience',False,False)

1)用户年龄特征探索

数据表处理结果:

图2:年龄与违约行为是否发生的折线图

 图3:不同年龄段违约之人所占比例

分析: 

由图2可知,违约用户中20-30的年轻用户分布更多,所以可以假设用户年龄越小,违约的可能性越大;

由图3可知,对用户的年龄进行分捅,进一步观察不同年龄段用户的违约概率。发现[20,25],[25,30]的用户违约的可能性最高,其余年龄段违约可能性相近;

 2)用户有无房否

分析:由图可知,没有房的人比有房的人违约率更高

3) 用户有无车否

分析:由图可知,没有车的人比有车的人违约率更高,但相差并不大

 4)用户婚否

分析:由图可知,未婚的人比已婚的违约率更高

5)用户收入

 

分析:由图可知看出收入较低的人违约几率较高

6)用户工作经验 

分析:由图可知工作时间较短的人违约几率较高

7)热力图

 

3.特征预处理

构建新特征DAYS_EMPLOYED_PERCENT: 用户工作年限experience/客户年龄

#三、特征预处理
from sklearn.model_selection import KFold
from sklearn.metrics import roc_auc_score
import lightgbm as lgb
import gc#构造新特征
app_train_domain = app_train.copy()
app_test_domain = app_test.copy()
#构建新特征
app_train_domain['DAYS_EMPLOYED_PERCENT'] = app_train_domain['Experience'] / app_train_domain['Age']#用户工作时间/年龄
#app_train_domain['INCOME_HOUSE'] = app_train_domain['Income'] / app_train_domain['House_Ownership']#用户工作收入/房子拥有有情况
#app_train_domain['INCOME_CAR'] = app_train_domain['Income'] / app_train_domain['Car_Ownership']#用户工作收入/车子拥有有情况
plt.figure(figsize=(10, 10))
# 构造新特性的迭代器
for i, feature in enumerate(['DAYS_EMPLOYED_PERCENT']):# 创建子图plt.subplot(1, 1, i + 1)# 按期还款用户的KDE图sns.kdeplot(app_train_domain.loc[app_train_domain['Risk_Flag'] == 0, feature], label='Risk_Flag == 0')# plot loans that were not repaidsns.kdeplot(app_train_domain.loc[app_train_domain['Risk_Flag'] == 1, feature], label='Risk_Flag == 1')# 未按期还款用户的KDE图plt.title('Distribution of %s by Target Value' % feature)plt.xlabel('%s' % feature);plt.ylabel('Density');
plt.tight_layout(h_pad=2.5)
plt.show()
app_test_domain['DAYS_EMPLOYED_PERCENT'] = app_test_domain['Experience'] / app_test_domain['Age']

 

4. 建模分析

#四、建模
from sklearn.model_selection import KFold
from sklearn.metrics import roc_auc_score
import lightgbm as lgb
import gc#1. LGBMClassifier模型
def model(features, test_features, encoding='ohe', n_folds=5):# 提取idtrain_ids = features['Id']test_ids = test_features['ID']# 提起训练集中的idlabels = features['Risk_Flag']# 删除训练集中的id和targetfeatures = features.drop(columns=['Id', 'Risk_Flag'])test_features = test_features.drop(columns=['ID'])# One Hot 编码if encoding == 'ohe':features = pd.get_dummies(features)test_features = pd.get_dummies(test_features)# 连接对齐训练集和测试集中的特征features, test_features = features.align(test_features, join='inner', axis=1)# 没有分类索引的记录cat_indices = 'auto'# I整数标签编码elif encoding == 'le':# 创建编码器label_encoder = LabelEncoder()# 创建列表,用于储存分类索引cat_indices = []# I按列迭代for i, col in enumerate(features):if features[col].dtype == 'object':# 将分类特征映射到整数features[col] = label_encoder.fit_transform(np.array(features[col].astype(str)).reshape((-1,)))test_features[col] = label_encoder.transform(np.array(test_features[col].astype(str)).reshape((-1,)))# 记录分类索引cat_indices.append(i)# 捕获错误,当标签编码方案无效时else:raise ValueError("Encoding must be either 'ohe' or 'le'")print('Training Data Shape: ', features.shape)print('Testing Data Shape: ', test_features.shape)# 提取训练集特征的名字feature_names = list(features.columns)# 转换为np数组features = np.array(features)test_features = np.array(test_features)# 创建K者交叉验证对象k_fold = KFold(n_splits=n_folds, shuffle=True, random_state=50)# 为重要特征设置空数组feature_importance_values = np.zeros(len(feature_names))# 创建测试预测的空数组test_predictions = np.zeros(test_features.shape[0])# 创建空数组,为了折叠验证预测out_of_fold = np.zeros(features.shape[0])# 创建list,保存验证和训练分数valid_scores = []train_scores = []# 创建K折验证迭代器for train_indices, valid_indices in k_fold.split(features):# K折训练数据train_features, train_labels = features[train_indices], labels[train_indices]# K折验证数据valid_features, valid_labels = features[valid_indices], labels[valid_indices]# 创建LGBMClassifier模型model = lgb.LGBMClassifier(n_estimators=1000, objective='binary',class_weight='balanced', learning_rate=0.05,reg_alpha=0.1, reg_lambda=0.1,subsample=0.8, n_jobs=-1, random_state=50)# 训练模型model.fit(train_features, train_labels, eval_metric='auc',eval_set=[(valid_features, valid_labels), (train_features, train_labels)],eval_names=['valid', 'train'], categorical_feature=cat_indices,early_stopping_rounds=100, verbose=200)# 在训练过程中使用了提前停止,使用best_iteration从最佳迭代中获取训练结果best_iteration = model.best_iteration_# 记录重要特征feature_importance_values += model.feature_importances_ / k_fold.n_splits# 预测test_predictions += model.predict_proba(test_features, num_iteration=best_iteration)[:, 1] / k_fold.n_splits# 在验证集上预测out_of_fold[valid_indices] = model.predict_proba(valid_features, num_iteration=best_iteration)[:, 1]# 记录最好的分数valid_score = model.best_score_['valid']['auc']train_score = model.best_score_['train']['auc']valid_scores.append(valid_score)train_scores.append(train_score)# 清楚所有变量gc.enable()del model, train_features, valid_featuresgc.collect()# 设置提交文件的数据框格式submission = pd.DataFrame({'ID': test_ids, 'Risk_Flag': test_predictions})# 把重要特性变成数据框格式feature_importances = pd.DataFrame({'feature': feature_names, 'importance': feature_importance_values})# 整体验证评分valid_auc = roc_auc_score(labels, out_of_fold)# 将总分添加到指标中valid_scores.append(valid_auc)train_scores.append(np.mean(train_scores))# 创建验证分数的数据框格式fold_names = list(range(n_folds))fold_names.append('overall')# 验证分数的数据框格式metrics = pd.DataFrame({'fold': fold_names,'train': train_scores,'valid': valid_scores})return submission, feature_importances, metrics#利用自定义函数训练模型,并输出5折交叉验证的结果
submission, fi, metrics = model(app_train_domain, app_test_domain)
print('Baseline metrics')
print(metrics)
submission.to_csv('my_submission1.csv',index=False)
del app_train_domain,app_test_domain
gc.collectdef plot_feature_importances(df):# 根据重要性对特征进行排序df = df.sort_values('importance', ascending=False).reset_index()# 将特性的重要性标准化,使其加起来等于1df['importance_normalized'] = df['importance'] / df['importance'].sum()# 做一个特征重要性的水平条形图plt.figure(figsize=(5, 3))ax = plt.subplot()# 最重要的特征放在最上面ax.barh(list(reversed(list(df.index[:15]))),df['importance_normalized'].head(15),align='center', edgecolor='k')# 设置y轴标签和刻度ax.set_yticks(list(reversed(list(df.index[:15]))))ax.set_yticklabels(df['feature'].head(15))# 设置x轴标签、标题plt.xlabel('Normalized Importance');plt.title('Feature Importances')plt.show()return df
fi_sorted = plot_feature_importances(fi)#2. xgboost模型
# 定类数据编码
from sklearn.preprocessing import OrdinalEncoder
enc = OrdinalEncoder()
enc.fit(app_train.iloc[:,3:6])
enc.categories_app_train['Married/Single'] = app_train['Married/Single'].map({'single': 0, 'married': 1})
app_train['House_Ownership'] = app_train['House_Ownership'].map({'norent_noown': 0, 'rented': 1 ,'owned': 2})
app_train['Car_Ownership'] = app_train['Car_Ownership'].map({'no': 0, 'yes': 1})
app_train# 定量特征转化为标准正态分布
from sklearn.preprocessing import StandardScaler
#标准化,返回值为标准化后的数据
app_train[["Income","Age","Experience","CURRENT_JOB_YRS","CURRENT_HOUSE_YRS"]] = StandardScaler().fit_transform(app_train[["Income","Age","Experience","CURRENT_JOB_YRS","CURRENT_HOUSE_YRS"]])
app_train
# 划分训练集和测试集
from sklearn.model_selection import train_test_split
X = app_train[["Income", "Age", "Experience", "Married/Single", "House_Ownership", "Car_Ownership", "CURRENT_JOB_YRS","CURRENT_HOUSE_YRS"]]
y = app_train[["Risk_Flag"]]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
X_test# xgboost模型训练
from xgboost import XGBClassifier
print("---------------------xgboost forest---------------------")
xgbc = XGBClassifier(n_estimatores=180,nthread=-1,early_stopping_rounds=200,max_depth=10).fit(X_train, y_train)
print("训练集精度:")
result = xgbc.score(X_train,y_train)
print(result)
print("验证集精度:")
result = xgbc.score(X_test,y_test)
print(result)
# 绘制ROC曲线
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import train_test_split
# Compute ROC curve and ROC area for each class
y_score = xgbc.fit(X_train, y_train).predict_proba(X_test)
fpr,tpr,thresholds = roc_curve(y_test, y_score[:,1]);
roc_auc = auc(fpr, tpr)
# 确定最佳阈值
right_index = (tpr + (1 - fpr) - 1)
yuzhi = max(right_index)
index = list(right_index).index(max(right_index))
tpr_val = tpr[index]
fpr_val = fpr[index]
# 绘制roc曲线图
plt.subplots(figsize=(7,5.5))
plt.plot(fpr, tpr, color='darkorange',lw=2, label='ROC curve (area = %0.2f)' % roc_auc)
plt.plot([0, 1], [0, 1], color='navy', lw=2, linestyle='--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('ROC Curve')
plt.legend(loc="lower right")
plt.grid()
plt.show() # 3. 随机森林分类器训练from sklearn.metrics import roc_auc_scorefrom sklearn.ensemble import RandomForestClassifierprint("---------------------random forest---------------------")rf = RandomForestClassifier(n_estimators=22, random_state=0, max_depth=20).fit(X_train, y_train)print("训练集精度:")result = rf.score(X_train , y_train)print(result)print("验证集精度:")result = rf.score(X_test, y_test)print(result)# 绘制ROC曲线from sklearn.metrics import roc_curve, aucfrom sklearn.model_selection import train_test_split# Compute ROC curve and ROC area for each classy_score = rf.fit(X_train, y_train).predict_proba(X_test)fpr, tpr, thresholds = roc_curve(y_test, y_score[:, 1]);roc_auc = auc(fpr, tpr)# 确定最佳阈值right_index = (tpr + (1 - fpr) - 1)yuzhi = max(right_index)index = list(right_index).index(max(right_index))tpr_val = tpr[index]fpr_val = fpr[index]# 绘制roc曲线图plt.subplots(figsize=(7, 5.5))plt.plot(fpr, tpr, color='darkorange', lw=2, label='ROC curve (area = %0.2f)' % roc_auc)plt.plot([0, 1], [0, 1], color='navy', lw=2, linestyle='--')plt.xlim([0.0, 1.0])plt.ylim([0.0, 1.05])plt.xlabel('False Positive Rate')plt.ylabel('True Positive Rate')plt.title('ROC Curve')plt.legend(loc="lower right")plt.grid()plt.show()

1)利用LightGBM模型进行建模预测

 

 

2)利用随机森林模型进行建模预测

 

 

3)利用xgboost模型进行建模预测 

 四、实验总结及结果讨论分析

1、数据探索性分析

可以得出用户年龄、有无房或车以及婚否、收入、工作经验对其欠贷违约率的影响:

1)年龄[20,30]的用户违约的可能性最高,其余年龄段违约可能性相近,也可以近似看成年龄越小,违约率越大

2)没有房/车的人比有房/车的人违约率更高

3)未婚的人比已婚的违约率更高

4)收入较低的人违约几率较高

5)工作时间较短的人违约几率较高

2、特征预处理分析

假设由于客户工作时间短,工作年限少故而引起了欠贷违约,则构建新特征DAYS_EMPLOYED_PERCENT,用户工作年限experience/客户年龄。

3建模预测分析

1)利用LightGBM模型进行建模预测,K折交叉验证得到模型在训练集上的AUC得分为 0.926473 ,在验证集上的AUC得分为 0.885765

2)利用随机森林模型进行建模预测,得到的训练集精度为0.9116326530612245,得到的验证集精度为0.8934920634920634

3)利用xgboost模型进行建模预测,得到的训练集精度为0.9096315192743765,得到的验证集精度为0.8965079365079365

4)比较三种模型可以看出,xgboost模型的验证集精度最大,随机森林模型的验证集精度比xgboost模型略小,训练集精度比其略大。


http://chatgpt.dhexx.cn/article/5ekrde7x.shtml

相关文章

淘宝客服话术《挖掘每一个潜在客户》

在这个电商行业的时代,作为一名淘宝客服人员,与店铺之间的关系是密不可言的,客服相当于店铺的门面,也是和客户第一接触者,重要性可想而知。 随着客服岗位的泛滥,客服之间的能力也是参差不齐的,想…

依据数据简单分析,发掘潜在客户

大数据概论作业(一) 信息技术的不断发展让人们离不开科技,我们每天使用各类电子产品所产生的信息数据不计其数,而这些数据的合理利用将会使我们的生活更加的便捷,所以,大数据俨然已成为现在前沿科技。的研究热点,大数据来源于我们生活的方方面面,也必将影响着我们…

生成微信小程序码、URL Scheme和URL Link

通用第一步,获取access_token,需要服务端去获取并缓存 (APPID和APPSECRET在微信小程序后台查看获取) https://api.weixin.qq.com/cgi-bin/token?grant_typeclient_credential&appidAPPID&secretAPPSECRET 1.获取小程序码(通过该接口生成的小程序码,永久有…

如何生成小程序太阳码

近期在小程序管理后台发现了生成太阳码的工具,以此来记录下。 登录微信公众平台(https://mp.weixin.qq.com/) 菜单栏工具->生成小程序码 输入页面路径->点击确定->右击保存太阳码 注意: 生成的页面路径必须是已发布的&am…

php小程序码生成并保存,小程序中如何生成小程序码

导语: 小程序是一种不需要下载安装即可使用的应用,它实现了应用“触手可及”的梦想,用户扫一扫或者搜一下即可打开应用。也体现了“用完即走”的理念,用户不用关心是否安装太多应用的问题。应用将无处不在,随时可用&am…

uniapp小程序生成小程序码

文章目录 前言一、自测版本二、线上版本三、测试总结 前言 需求&#xff1a;用户通过扫描小程序码&#xff0c;直接跳转到小程序的登陆页&#xff0c;并自动填充推荐码 一、自测版本 用于前端自己测试如何生成小程序码 <!-- 以图片的形式展示 --> <image :src"…

微信小程序开发实战9_1 生成小程序码

9.1 小程序的入口场景 为了便于商家进行小程序的推广&#xff0c;微信提供了多种小程序入口的方式&#xff0c;用户可以通过常规的方式来使用小程序&#xff1a;例如用户可以通过搜索关键字来搜索并进入小程序&#xff0c;也可以通过附近的小程序来选择并进入小程序。用户还可…

微信小程序生成小程序码和展示

云函数代码&#xff1a; // 云函数入口文件 const cloud require(wx-server-sdk) cloud.init({env: cloud.DYNAMIC_CURRENT_ENV })// 云函数入口函数 exports.main async (event, context) > {try {const result await cloud.openapi.wxacode.getUnlimited({scene:event…

【微信小程序】 java如何生成小程序码,并跳转到指定落地页 demo

前言&#xff1a; 需求场景&#xff0c;用户通过扫描小程序码&#xff0c;到指定的页码&#xff0c;希望能帮到大家&#xff0c;切记&#xff0c;要等到小程序发版测能测试。 1、微信官网 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/qr-code.…

uni-app跨端开发之生成小程序码和调试scene参数爬坑指南

前段时间&#xff0c;公司的小程序中有一个分享小程序码邀请好友的功能。前前后后也踩过不少坑&#xff0c;然后就有了这篇笔记。如果看官正在因生成微信小程序码或调试scene参数而苦恼&#xff0c;不妨继续往下看看&#xff0c;或许这篇文章能够帮助到您哟。 1、如何生成微信…

微信小程序实现前端自己生成小程序码并且带参数

hxrhwxacode.getUnlimited | 微信开放文档微信开发者平台文档https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.getUnlimited.html后端开发希望我们前端自己去生成小程序码并且带上用户信息。于是查到了官网上有相关的文档。开始着手去…

小程序云函数生成小程序码

云函数生成小程序码的Demo # 云函数 config.json配置,云调用wxacode.get API 的权限 {"permissions": {"openapi": ["wxacode.get"]} }index.js const cloud require(wx-server-sdk) cloud.init()exports.main async (event, context) > {t…

微信小程序生成小程序码以及参数的获取

一、小程序码介绍 通过后台接口可以获取小程序任意页面的小程序码&#xff0c;扫描该小程序码可以直接进入小程序对应的页面&#xff0c;所有生成的小程序码永久有效&#xff0c;可放心使用。 目前小程序码有两种形式&#xff0c;推荐生成并使用小程序码&#xff0c;它具有更好…

小程序指定页面生成小程序码(任意页面),所有运营在小程序端就可以自主得到页面链接,再也不用每次去协助看页面链接了~

写在前面&#xff1a; 业主运营经常会咨询&#xff0c;公众号放小程序链接&#xff0c;或者小程序后台使用&#xff0c;分类链接是哪一个&#xff0c;商品具体链接是哪一个&#xff0c;拼团砍价秒杀链接是哪一个。这里是设置好&#xff0c;解决以上所有不定期的咨询。 一、官方…

小程序-云开发-实现生成小程序码

虽互不曾谋面,但希望能和您成为笔尖下的朋友 以读书,技术,生活为主,偶尔撒点鸡汤 不作,不敷衍,意在真诚吐露,用心分享 点击左上方,可关注本刊 标星公众号&#xff08;ID&#xff1a;itclanCoder&#xff09; 如果不知道如何操作 点击这里,标星不迷路 前言 小程序因为传播快,易分…

超强、超详细Redis入门教程

转载自&#xff1a; http://www.h5min.cn/article/56448.htm 这篇文章主要介绍了超强、超详细Redis入门教程,本文详细介绍了Redis数据库各个方面的知识,需要的朋友可以参考下 【本教程目录】 1.redis是什么 2.redis的作者何许人也 3.谁在使用redis 4.学会安装redis 5.学会启动r…

Redis02:企业架构介绍以及redis介绍

企业架构介绍以及redis介绍 互联网项目架构演进单机Mysql的演进当今企业架构分析 Redis概述 互联网项目架构演进 单机Mysql的演进 1、单机Mysql的年代 90年代一个基本的网站访问量一般不会太大&#xff0c;单个数据库完全足够&#xff01;那个时候更多的去使用静态html&#…

Redis技术

一.基本知识 (1)NoSQL数据库简介 技术的分类: 1、解决功能性的问题&#xff1a;Java、Jsp、RDBMS、Tomcat、HTML、Linux、JDBC、SVN 2、解决扩展性的问题&#xff1a;Struts、Spring、SpringMVC、Hibernate、Mybatis 3、解决性能的问题&#xff1a;NoSQL、Java线程、Hadoop、…

《Redis系列专题》 之 大规模互联网应用Redis架构要点(精华)

建议有一定工作经验者阅读 通常&#xff0c;为了提高网站响应速度&#xff0c;总是把热点数据保存在内存中而不是直接从后端数据库中读取。Redis是一个很好的Cache工具。大型网站应用&#xff0c;热点数据量往往巨大&#xff0c;几十G上百G是很正常的事儿&#xff0c;在这种情况…

大数据互联网架构阶段 Redis(二)

Redis(二) 零 、 目录 将缓存引入电商项目主从复制哨兵模式集群容忍度CAP理论 十、 将缓存引入电商项目 使用Spring框架维护Jedis池对象 引入一个配置文件 application-redis.config <beans xmlns"http://www.springframework.org/schema/beans"xmlns:context&…