![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据挖掘
zanlinux
这个作者很懒,什么都没留下…
展开
-
内网辅助
https://blog.csdn.net/weixin_39216383/article/details/79197701原创 2021-01-26 10:18:51 · 75 阅读 · 0 评论 -
Hive两表count除法
select 100 * different / total from (select count(*) as different from a, b where ........) t1, (select count(*) as total from a where .......) t2原创 2020-11-26 10:45:57 · 2634 阅读 · 1 评论 -
pandas读取excel,txt,csv,pkl文件等命令
pandas读取txt文件读取txt文件需要确定txt文件是否符合基本的格式,也就是是否存在\t,,,等特殊的分隔符一般txt文件长成这个样子txt文件举例下面的文件为空格间隔1 2019-03-22 00:06:24.4463094 中文测试 2 2019-03-22 00:06:32.4565680 需要编辑encoding 3 2019-03-22 00:06:32.6835965 ashshsh 4 2017-03-22 00:06:32.8041945 eggg读取原创 2020-11-20 17:01:22 · 419 阅读 · 0 评论 -
多项式回归_搜索参数
# -*- coding: utf-8 -*-import numpy as npimport matplotlib.pyplot as pltfrom sklearn.linear_model import LinearRegressionfrom sklearn.preprocessing import PolynomialFeaturesfrom sklearn.metrics import mean_squared_errorfrom sklearn.model_selection.原创 2020-10-22 16:09:58 · 245 阅读 · 0 评论 -
折线图
import matplotlib.pyplot as pltimport pandas as pdmovie_pd = pd.read_csv('IMDB_Movie.csv', header = 0)movie_count = movie_pd.groupby('Year').size().reset_index(name = 'Count')movie_count.plot(x = 'Year', y = 'Count', color = 'b', marker = 'o', legend.原创 2020-10-13 10:49:32 · 107 阅读 · 0 评论 -
混淆矩阵画图
from sklearn.metrics import confusion_matriximport matplotlib.pyplot as pltimport numpy as npy_true = ['Cat', 'Dog', 'Rabbit', 'Cat', 'Cat', 'Rabbit']y_pred = ['Dog', 'Dog', 'Rabbit', 'Dog', 'Dog', 'Rabbit']classes=['Cat', 'Dog', 'Rabbit']confusio.原创 2020-09-23 18:06:16 · 349 阅读 · 0 评论 -
pandas设置不用科学计数法
import numpy as npnp.set_printoptions(suppress=True)pd.set_option(‘display.float_format’, lambda x: ‘%.2f’ % x) #为了直观的显示数字,不采用科学计数法train_df.describe()原创 2020-09-04 14:54:32 · 3761 阅读 · 0 评论 -
GridSearch调参xgb
import xgboost as xgbimport pandas as pdfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import roc_auc_scoretrain_data = pd.read_csv(‘train.csv’) # 读取数据y = train_data.pop(‘30’).values # 用pop方式将训练数据中的标签值y取出来,作为训练目标,这里的‘30’是标签.原创 2020-08-24 10:16:52 · 418 阅读 · 0 评论