python-机器学习-决策树实现

原创

python-机器学习-决策树实现

@author: asus
“”"
“”"
决策树
目的:

  1. 使用决策树模型
  2. 了解决策树模型的参数
  3. 初步了解调参数
    要求:
    基于乳腺癌数据集完成以下任务:
    1.调整参数criterion,使用不同算法信息熵(entropy)和基尼不纯度算法(gini)
    2.调整max_depth参数值,查看不同的精度
    3.根据参数criterion和max_depth得出你初步的结论。
    “”"

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import mglearn
from sklearn.model_selection import train_test_split
#导入乳腺癌数据集
from sklearn.datasets import load_breast_cancer
from sklearn.tree import DecisionTreeClassifier

#决策树并非深度越大越好,考虑过拟合的问题
#mglearn.plots.plot_animal_tree()
#mglearn.plots.plot_tree_progressive()

#获取数据集
cancer = load_breast_cancer()
#对数据集进行切片
X_train,X_test,y_train,y_test = train_test_split(cancer.data,cancer.target,
stratify = cancer.target,random_state = 42)
#查看训练集和测试集数据
print(‘train dataset :{0} ;test dataset :{1}’.format(X_train.shape,X_test.shape))
#建立模型(基尼不纯度算法(gini)),使用不同最大深度和随机状态和不同的算法看模型评分
tree = DecisionTreeClassifier(random_state = 0,criterion = ‘gini’,max_depth = 5)
#训练模型
tree.fit(X_train,y_train)
#评估模型
print(“Accuracy(准确性) on training set: {:.3f}”.format(tree.score(X_train, y_train)))
print(“Accuracy(准确性) on test set: {:.3f}”.format(tree.score(X_test, y_test)))
print(tree)

# 参数选择 max_depth,算法选择基尼不纯度算法(gini) or 信息熵(entropy)
def Tree_score(depth = 3,criterion = ‘entropy’):
“”"
参数为max_depth(默认为3)和criterion(默认为信息熵entropy),
函数返回模型的训练精度和测试精度
“”"

tree = DecisionTreeClassifier(criterion = criterion,max_depth = depth)
tree.fit(X_train,y_train)
train_score = tree.score(X_train, y_train)
test_score = tree.score(X_test, y_test)
return (train_score,test_score)

#gini算法,深度对模型精度的影响
depths = range(2,25)#考虑到数据集有30个属性
scores = [Tree_score(d,‘gini’) for d in depths]
train_scores = [s[0] for s in scores]
test_scores = [s[1] for s in scores]

plt.figure(figsize = (6,6),dpi = 144)
plt.grid()
plt.xlabel(“max_depth of decision Tree”)
plt.ylabel(“score”)
plt.title("‘gini’")
plt.plot(depths,train_scores,’.g-’,label = ‘training score’)
plt.plot(depths,test_scores,’.r–’,label = ‘testing score’)
plt.legend()

#信息熵(entropy),深度对模型精度的影响
scores = [Tree_score(d) for d in depths]
train_scores = [s[0] for s in scores]
test_scores = [s[1] for s in scores]

plt.figure(figsize = (6,6),dpi = 144)
plt.grid()
plt.xlabel(“max_depth of decision Tree”)
plt.ylabel(“score”)
plt.title("‘entropy’")
plt.plot(depths,train_scores,’.g-’,label = ‘training score’)
plt.plot(depths,test_scores,’.r–’,label = ‘testing score’)
plt.legend()

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92

运行结果:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
很明显看的出来,决策树深度越大,训练集拟合效果越好,但是往往面对测试集的预测效果会下降,这就是过拟合。

参考书籍:《Python机器学习基础教程》

                                </div>
            <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-526ced5128.css" rel="stylesheet">
                </div>
</article>
<div class="postTime"> 
    <div class="article-bar-bottom">
        <span class="time">
            文章最后发布于: 2019-11-09 15:04:12            </span>
    </div>
</div>
        <div class="hide-article-box hide-article-pos text-center">
        <a class="btn-readmore" data-report-view="{&quot;mod&quot;:&quot;popu_376&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;,&quot;strategy&quot;:&quot;readmore&quot;}" data-report-click="{&quot;mod&quot;:&quot;popu_376&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;,&quot;strategy&quot;:&quot;readmore&quot;}">
            展开阅读全文
            <svg class="icon chevrondown" aria-hidden="true">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#csdnc-chevrondown"></use>
            </svg>
        </a>
    </div>
            <!--打赏开始-->
                        <div class="reward-user-box">
                <span class="reward-word" style="color:#B4B4B4 !important">有 <span class="num">0</span> 个人打赏</span>
                                </div>
                    <!--打赏结束-->
        <div class="recommend-box"><div class="recommend-item-box type_blog clearfix" data-report-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/Yeoman92/article/details/73436632&quot;,&quot;strategy&quot;:&quot;OPENSEARCH&quot;,&quot;index&quot;:&quot;0&quot;}" data-report-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/Yeoman92/article/details/73436632&quot;,&quot;strategy&quot;:&quot;OPENSEARCH&quot;,&quot;index&quot;:&quot;0&quot;}">
<div class="content" style="width: 962px;">
	<a href="https://blog.csdn.net/Yeoman92/article/details/73436632" target="_blank" rel="noopener" title="Python机器学习算法库——决策树(scikit-learn学习 - 决策树)">
	<h4 class="text-truncate oneline" style="width: 802px;">
			Python<em>机器学习</em>算法库——<em>决策树</em>(scikit<em>-</em>learn学习 <em>-</em> <em>决策树</em>)		</h4>
	<div class="info-box d-flex align-content-center">
		<p class="date-and-readNum oneline">
			<span class="date hover-show">06-18</span>
			<span class="read-num hover-hide">
				阅读数 
				1万+</span>
			</p>
		</div>
	</a>
	<p class="content" style="width: 962px;">
		<a href="https://blog.csdn.net/Yeoman92/article/details/73436632" target="_blank" rel="noopener" title="Python机器学习算法库——决策树(scikit-learn学习 - 决策树)">
			<span class="desc oneline">决策树决策树(DTs)是一种用于分类和回归的非参数监督学习方法。目标是创建一个模型,通过从数据特性中推导出简单的决策规则来预测目标变量的值。例如,在下面的例子中,决策树通过一组if-then-else...</span>
		</a>
		<span class="blog_title_box oneline ">
								<span class="type-show type-show-blog type-show-after">博文</span>
										<a target="_blank" rel="noopener" href="https://blog.csdn.net/Yeoman92">来自:	<span class="blog_title"> Yeoman92的博客</span></a>
											</span>
	</p>
</div>
</div>
还能输入1000个字符
<div class="comment-list-container">
	<a id="comments"></a>
	<div class="comment-list-box">
	</div>
	<div id="commentPage" class="pagination-box d-none"></div>
	<div class="opt-box text-center">
		<div class="btn btn-sm btn-link-blue" id="btnMoreComment"></div>
	</div>
</div>
<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_59" data-pid="59"><script type="text/javascript">
(function() {
    var s = "_" + Math.random().toString(36).slice(2);
    document.write('<div style="" id="' + s + '"></div>');
    (window.slotbydup = window.slotbydup || []).push({
        id: "u3491668",
        container:  s
    });
})();

机器学习决策树(Decision Tree)及其Python代码实现 -..._CSDN博客

11-9

Python《机器学习实战》读书笔记(三)——决策树 - wait..._CSDN博客

6-23

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_60" data-pid="60"><iframe src="https://adaccount.csdn.net/#/preview/644?m=EEtApncQnEJLJLQHAcDynSiHcDLiAyEEtLboAEtHinXQHtttXfLfSnAJSHiAQApSWtSiEpEDfoSonotbLbSLScELvipiXHpESUQQ&amp;k=" frameborder="0" width="100%" height="75px" scrolling="no"></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&amp;k=&amp;m=EEtApncQnEJLJLQHAcDynSiHcDLiAyEEtLboAEtHinXQHtttXfLfSnAJSHiAQApSWtSiEpEDfoSonotbLbSLScELvipiXHpESUQQ"></div></div>

机器学习 --决策树学习(超级完整!含python代码!) - 八..._CSDN博客

5-24

机器学习基础-决策树-python实现 - 偏执的眸 - CSDN博客

10-8

		<div class="recommend-item-box blog-expert-recommend-box" style="display: block;">
		<div class="d-flex">
			<div class="blog-expert-recommend">
				<div class="blog-expert">
					<div class="blog-expert-flexbox" data-report-view="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/Yeoman92" target="_blank"><img src="https://profile.csdnimg.cn/8/5/A/3_yeoman92" username="Yeoman92" alt="Yeoman92" title="Yeoman92"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="Yeoman92" data-nick="Yeoman92">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/Yeoman92" target="_blank"><h5 class="oneline" title="Yeoman92">Yeoman92</h5></a></span>  <p></p><p class="article-num" title="146篇文章"> 146篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/aijun123456" target="_blank"><img src="https://profile.csdnimg.cn/3/5/E/3_aijun123456" username="aijun123456" alt="aijun123456" title="aijun123456"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="aijun123456" data-nick="aijun123456">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/aijun123456" target="_blank"><h5 class="oneline" title="aijun123456">aijun123456</h5></a></span>  <p></p><p class="article-num" title="4篇文章"> 4篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/daiyucheng88" target="_blank"><img src="https://profile.csdnimg.cn/6/5/8/3_daiyucheng88" username="daiyucheng88" alt="睡觉的咖啡" title="睡觉的咖啡"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="daiyucheng88" data-nick="睡觉的咖啡">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/daiyucheng88" target="_blank"><h5 class="oneline" title="睡觉的咖啡">睡觉的咖啡</h5></a></span>  <p></p><p class="article-num" title="4篇文章"> 4篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/gshengod" target="_blank"><img src="https://profile.csdnimg.cn/4/5/7/3_gshengod" username="gshengod" alt="李博Garvin" title="李博Garvin"><svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#csdnc-blogexpert"></use></svg></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="gshengod" data-nick="李博Garvin">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/huangjiaaaaa/article/details/102987183&quot;}"><a href="https://blog.csdn.net/gshengod" target="_blank"><h5 class="oneline" title="李博Garvin">李博Garvin</h5></a></span>  <p></p><p class="article-num" title="311篇文章"> 311篇文章</p><p class="article-num" title="排名:1000+"> 排名:1000+</p><p></p></div></div></div></div>
				</div>
			</div>
		</div>
	</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-report-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/m0_45384958/article/details/100833672&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:&quot;5&quot;}" data-report-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/m0_45384958/article/details/100833672&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:&quot;5&quot;}" data-track-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/m0_45384958/article/details/100833672&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:4,&quot;extend1&quot;:&quot;_&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/m0_45384958/article/details/100833672&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:4,&quot;extend1&quot;:&quot;_&quot;}" data-flg="true">                <a href="https://blog.csdn.net/m0_45384958/article/details/100833672" target="_blank">              		<h4 class="text-truncate oneline" style="width: 884px;">Python<em>机器学习</em>——<em>决策树</em> <em>-</em> m0_45384958的博客 <em>-</em> CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">10-3</span>                    </p>                  </div>                </a>            	</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-report-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_40631132/article/details/89007115&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:&quot;6&quot;}" data-report-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_40631132/article/details/89007115&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:&quot;6&quot;}" data-track-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_40631132/article/details/89007115&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:5,&quot;extend1&quot;:&quot;_&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_40631132/article/details/89007115&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:5,&quot;extend1&quot;:&quot;_&quot;}" data-flg="true">                <a href="https://blog.csdn.net/weixin_40631132/article/details/89007115" target="_blank">              		<h4 class="text-truncate oneline" style="width: 876px;"><em>机器学习</em>实战之<em>决策树</em>(python<em>实现</em>) <em>-</em> weixin_40631132的博客 <em>-</em> ...</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">10-29</span>                    </p>                  </div>                </a>            	</div>

Python机器学习决策树案例 - 雪域枫蓝的博客 - CSDN博客

5-18

机器学习--决策树python实现案例 - u014556057的专栏 - CSDN博客

10-29

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_61" data-pid="61"><iframe src="https://adaccount.csdn.net/#/preview/598?m=tnALJLcQpSpnEniLLnpJbLQHcADLybAtLHAcnSDnppEEfnApULJHSJXticHEvomnbEJLHbnQWDSiQStLbLEoJXfSyifpEDHnADQQ&amp;k=机器学习" frameborder="0" width="100%" height="75px" scrolling="no"></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&amp;k=机器学习&amp;m=tnALJLcQpSpnEniLLnpJbLQHcADLybAtLHAcnSDnppEEfnApULJHSJXticHEvomnbEJLHbnQWDSiQStLbLEoJXfSyifpEDHnADQQ"></div></div><div class="recommend-item-box baiduSearch recommend-box-ident" data-report-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_34268310/article/details/94576734&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:&quot;9&quot;}" data-report-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_34268310/article/details/94576734&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:&quot;9&quot;}" data-track-view="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_34268310/article/details/94576734&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:8,&quot;extend1&quot;:&quot;_&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_614&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/weixin_34268310/article/details/94576734&quot;,&quot;strategy&quot;:&quot;searchFromBaidu1&quot;,&quot;index&quot;:8,&quot;extend1&quot;:&quot;_&quot;}" data-flg="true">                <a href="https://blog.csdn.net/weixin_34268310/article/details/94576734" target="_blank">              		<h4 class="text-truncate oneline" style="width: 876px;">【<em>机器学习</em>笔记之二】<em>决策树</em>的python<em>实现</em> <em>-</em> weixin_342..._CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">10-27</span>                    </p>                  </div>                </a>            	</div>

python机器学习决策树分类

06-04 阅读数 2036

决策树分类算法就是在对训练数据进行cun 博文 来自: cui134的专栏

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_62" data-pid="62"><iframe src="https://adaccount.csdn.net/#/preview/733?m=icfJAvHDQQHSpcUSLALppUEiSpbQibtHnLJbbXttSADnLLHEiyiUASSbiSpUHSQWJbScncJEpEnEScLQSEXtXAibpccHLSJADQLQ&amp;k=" frameborder="0" width="100%" height="75px" scrolling="no"></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&amp;k=&amp;m=icfJAvHDQQHSpcUSLALppUEiSpbQibtHnLJbbXttSADnLLHEiyiUASSbiSpUHSQWJbScncJEpEnEScLQSEXtXAibpccHLSJADQLQ"></div></div>

机器学习笔记-决策树-3】利用matplotlib绘制决策树图形

02-01 阅读数 198

'''CreatedonOct14,2010@author:PeterHarrington'''importmatplotlib.pyplotasplt#fromtreesimport*decisio... 博文 来自: Quiet

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_63" data-pid="63"><script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u4221910",
            container: s
        });
    })();

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_64" data-pid="64"><script type="text/javascript">
(function() {
    var s = "_" + Math.random().toString(36).slice(2);
    document.write('<div style="" id="' + s + '"></div>');
    (window.slotbydup = window.slotbydup || []).push({
        id: "u3600856",
        container:  s
    });
})();

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_65" data-pid="65"><iframe src="https://adaccount.csdn.net/#/preview/575?m=nASbAcQbvpHccAnpiSbLyHEcDSDcSHJXEnvtJtEAHJLvyLLAJiSnbbbvJtnLLHQWQonSLbbiQvLXQAcJSbmLtSLtLtHctQJpbJLQ&amp;k=" frameborder="0" width="100%" height="75px" scrolling="no"></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&amp;k=&amp;m=nASbAcQbvpHccAnpiSbLyHEcDSDcSHJXEnvtJtEAHJLvyLLAJiSnbbbvJtnLLHQWQonSLbbiQvLXQAcJSbmLtSLtLtHctQJpbJLQ"></div></div>
<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_66" data-pid="66"><div id="three_ad38" class="mediav_ad"></div>

只因写了一段爬虫,公司200多人被抓!

10-16 阅读数 9万+

“一个程序员写了个爬虫程序,整个公司200多人被端了。”

“不可能吧!”

刚从朋友听到这个消息的时候,我有点不太相信,做为一名程序员来讲,谁还没有写过几段爬虫呢?只因写爬虫程序就被端有点夸张了吧。…


博文



<div class="recommend-item-box recommend-recommend-box"><div style=""><iframe width="900" frameborder="0" height="90" scrolling="no" src="https://pos.baidu.com/s?hei=90&amp;wid=900&amp;di=u3491668&amp;ltu=https%3A%2F%2Fblog.csdn.net%2Fhuangjiaaaaa%2Farticle%2Fdetails%2F102987183&amp;psi=08150c8b1b1453ccf48b4c033b842d19&amp;cec=UTF-8&amp;cpl=20&amp;ccd=24&amp;ti=python-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0-%E5%86%B3%E7%AD%96%E6%A0%91%E5%AE%9E%E7%8E%B0&amp;psr=1920x1080&amp;dai=4&amp;dri=1&amp;cce=true&amp;tpr=1573401207118&amp;ant=0&amp;pcs=1899x907&amp;drs=1&amp;chi=1&amp;par=1920x1030&amp;dc=3&amp;ari=2&amp;dis=0&amp;cja=false&amp;cmi=37&amp;pis=-1x-1&amp;col=zh-CN&amp;ps=8779x622&amp;prot=2&amp;tlm=1573401207&amp;cdo=-1&amp;ltr=https%3A%2F%2Fwww.csdn.net%2Fnav%2Fpython&amp;cfv=0&amp;dtm=HTML_POST&amp;pss=1899x11760&amp;exps=111000&amp;tcn=1573401207"></iframe></div><script type="text/javascript" src="//rabc1.iteye.com/production/res/rxjg.js?pkcgstj=jm"></script></div>

动画:用动画给女朋友讲解 TCP 四次分手过程

10-21 阅读数 2万+

作者 | 小鹿 来源 | 公众号:小鹿动画学编程

写在前边
大家好,我们又见面了,做为一个业余的动画师,上次的用动画的形式讲解 TCP 三次握手过程再各大平台收到了广大读者的喜爱,说文章有趣、有…


博文



动…


博文



<div class="recommend-item-box recommend-recommend-box"><div id="_i34cfyqk2g" style=""><iframe width="900" frameborder="0" height="90" scrolling="no" src="https://pos.baidu.com/s?hei=90&amp;wid=900&amp;di=u3491668&amp;ltu=https%3A%2F%2Fblog.csdn.net%2Fhuangjiaaaaa%2Farticle%2Fdetails%2F102987183&amp;psi=08150c8b1b1453ccf48b4c033b842d19&amp;tpr=1573401207118&amp;dri=2&amp;pcs=1899x907&amp;col=zh-CN&amp;chi=1&amp;drs=1&amp;tlm=1573401207&amp;ltr=https%3A%2F%2Fwww.csdn.net%2Fnav%2Fpython&amp;par=1920x1030&amp;cdo=-1&amp;prot=2&amp;ccd=24&amp;dis=0&amp;psr=1920x1080&amp;cce=true&amp;tcn=1573401207&amp;pss=1899x11856&amp;cpl=20&amp;cmi=37&amp;exps=111000&amp;ant=0&amp;dc=3&amp;ari=2&amp;ps=9285x622&amp;ti=python-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0-%E5%86%B3%E7%AD%96%E6%A0%91%E5%AE%9E%E7%8E%B0&amp;dtm=HTML_POST&amp;cja=false&amp;dai=5&amp;cec=UTF-8&amp;pis=-1x-1&amp;cfv=0"></iframe><div style="width:0px;height:0px;padding:0px;"></div></div><script type="text/javascript" src="//rabc1.iteye.com/production/res/rxjg.js?pkcgstj=jm"></script></div>

Linux/C/C++ 不可错过的好书

10-24 阅读数 4161

来源:公众号【编程珠玑】

作者:守望先生

ID:shouwangxiansheng

前言

经常有读者让我推荐书籍,这次我就把我私藏的计算机书单分享给你们!不过由于时间匆忙,不会进行更加详细…


博文



用到的库:



博文



从月薪3K的中专生,到身家千万的CTO!人生最大的对手,就是自已

10-25 阅读数 1万+

关注“技术领导力”博客,独家大厂干货推送

文/Daniel.W

David坐在我对面,窗外是梦境般的外滩夜景,繁星点点的璀璨灯火,散落在黄浦江两岸。我转过头对David说,你丫挺会享受啊,约我…


博文



这应该是把计算机网络五层模型讲的最好是文章了,看不懂你打我

10-25 阅读数 1万+

帅地:用心写好每一篇文章!

前言
天各一方的两台计算机是如何通信的呢?在成千上万的计算机中,为什么一台计算机能够准确着寻找到另外一台计算机,并且把数据发送给它呢?
可能很多人都听说过网络通信的 5 …


博文



单点登录(SSO)

10-26 阅读数 1万+

一、SSO(单点登录)介绍

SSO英文全称Single SignOn,单点登录。SSO是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。它包括可以将这次主要的登录映射到其他应用…


博文



漫话:什么是 https ?这应该是全网把 https 讲的最好的一篇文章了

10-26 阅读数 1万+

今天这篇文章,讲通过对话的形式,让你由浅入深着知道,为什么 Https 是安全的。

一、对称加密

一禅:在每次发送真实数据之前,服务器先生成一把密钥,然后先把密钥传输给客户端。之后服务器给客…


博文



史上最全的mysql基础教程

10-28 阅读数 3673

启动与停止

启动mysql服务
sudo /usr/local/mysql/support-files/mysql.server start
停止mysql服务
sudo /usr/loc…


博文



2019双十一淘宝天猫刷喵币

10-28 阅读数 1万+

实现步骤

下载并安装Auto.js
官网网址:https://hyb1996.github.io/AutoJs-Docs
Github地址:https://github.com/hyb1996/Au…


博文



敲黑板!!!读了这篇文章,你将知道如何才能进大厂,如何实现财务自…


博文



一文搞懂什么是TCP/IP协议

10-28 阅读数 1万+

什么是TCP/IP协议?

计算机与网络设备之间如果要相互通信,双方就必须基于相同的方法.比如如何探测到通信目标.由哪一边先发起通信,使用哪种语言进行通信,怎样结束通信等规则都需要事先确定.不同的硬件…


博文



各大公司在GitHub上开源投入排名分析

11-05 阅读数 2120

基于GitHub的数据进行分析各个公司在开源上的投入排名 博文

中国麻将:世界上最早的区块链项目

10-29 阅读数 2万+

中国麻将:世界上最早的区块链项目

最近区块链这个玩意又被市场搞的很是火热,相信大部分人都不太清楚这玩意到底是怎么样的一个概念,它来了,它来了,它到底是啥~ 国家都开始发文支持了,下面是一个通俗易懂的…


博文



比特币原理详解

10-29 阅读数 7296

一、什么是比特币

比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是…


博文



Python 基础(一):入门必备知识

10-30 阅读数 1万+

Python 入门必备知识,你都掌握了吗? 博文

Spring简介、框架核心、优缺点、应用场景

10-29 阅读数 2649

文章目录Spring简介Spring的设计目标Spring的优缺点优点缺点Spring的应用场景 Spring简介

Spring是一个轻量级Java开发框架,最早有Rod Johnson创建,目的是…


博文



根据我们的经验,程序员兼职主要分为三种:兼职职位众包、项目整包和自由职业者驻场。

所谓的兼职职位众…


博文



那…


博文



                <div class="recommend-item-box type_hot_word">
                                    <div class="content clearfix" style="width: 962px;">
                    <div class="float-left">
                                            <span>
                        <a href="https://www.csdn.net/gather_14/MtTaEg0sNC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# 单例模式里面的属性</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_1f/MtTaEg0sNS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# lic文件</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_18/MtTaEg0sNi1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# 盘古分词</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_1a/MtTaEg0sNy1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# 文本框只能输入-</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_1d/MtTaEg0sOC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# 十进制数字转换字母</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_10/MtTaEg0sOS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c#某个变量更改刷新</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_12/MtTaEg1sMC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c#往json里添加数据</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_1f/MtTaEg1sMS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# 创建原子变量</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_14/MtTaEg1sMi1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c#怎么调用api接口</a>
                    </span>
                                            <span>
                        <a href="https://www.csdn.net/gather_15/MtTaEg1sMy1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        c# 调用mstsc</a>
                    </span>
                                            </div>
                </div>
                                    </div>
                                <div class="recommend-loading-box">
                <img src="https://csdnimg.cn/release/phoenix/images/feedLoading.gif">
            </div>
            <div class="recommend-end-box">
                <p class="text-center">没有更多推荐了,<a href="https://blog.csdn.net/" class="c-blue c-blue-hover c-blue-focus">返回首页</a></p>
            </div>
        </div>
                        <div class="template-box">
                <span>©️2019 CSDN</span><span class="point"></span>
            <span>皮肤主题: 游动-白</span>
            <span> 设计师:
                                        上身试试                                    </span>
            </div>
                </main>
  • 0
    点赞
  • 0
    评论
  • 1
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值