/images/avatar.png

爬虫简单教程

爬虫 定义 1 网络爬虫(又称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓取万维网信息的程

数据加载器

sklearn的库 划分训练集,测试集,验证集 1 2 3 4 5 6 7 8 9 10 11 from sklearn.model_selection import train_test_split def train_test_val_split(x,y, train_ratio = 0.8,validation_ratio = 0.1,test_ratio = 0.1,random_state=0): # random_state for reproduction # shuffle must be 'True' [x_train, x_test, y_train, y_test] = train_test_split( x, y, test_size=validation_ratio+test_ratio, random_state=random_state, shuffle=True) [x_val, x_test, y_val, y_test]

数据库池子Python

Python 数据库池子 引言 假设网站一天有很大的访问量,数据库服务器就需要为每次连接创建一次数据库连接,极大的浪费数据库的资源,并且极易造成数据库服务器