自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(62)
  • 收藏
  • 关注

原创 【特征工程】特征选择Feature Selection

正好在写这部分,就顺带练习一下吧。一如既往地,来源:https://towardsdatascience.com/feature-selection-techniques-1bfab5fe0784数据集:https://www.kaggle.com/uciml/mushroom-classification减少特征数量的好处有:准确性提高。减少过度拟合。加快训练速度。改进数据可视化...

2020-01-06 21:42:10 463

原创 【基础概念】Matplotlib里的plt.xxx(), or ax.xxx()

侵删,来源:https://towardsdatascience.com/plt-xxx-or-ax-xxx-that-is-the-question-in-matplotlib-8580acf42f44坑坑坑,等有空再看。

2020-01-05 20:43:40 474

原创 【资料】Model evaluation, model selection, and algorithm selection in machine learning

Model evaluation, model selection, and algorithm selection in machine learningDo you know how to choose the right machine learning algorithm among 7 different types?

2019-12-27 09:51:04 456

转载 【基础概念】P-values的解释

无授权,自留,侵删:P-values Explained By Data Scientist四个部分:Hypothesis TestingNormal DistributionWhat is P-value?Statistical Significance1.Hypothesis Testing首先了解一下hypothesis testing ,在这里, p-value 被用来...

2019-12-24 21:59:16 4585

原创 【gis学习】把从栅格中获取的投影坐标转换为经纬度

获取相应坐标系import gdalimport numpy as npfrom osgeo import osrdataset = gdal.Open("C:\\Users\\Nihil\\Desktop\\Arcgisdata\\HPDEM.tif")adfGeoTransform = dataset.GetGeoTransform()get_ref = dataset.GetS...

2019-12-18 11:06:34 1755

原创 【gis学习】GDAL获取栅格数据各个像素对应的经纬度

参考:GDAL获取栅格数据各个像素对应的经纬度(Python版)gdal GetGeoTransform解释 GetProjectionRef//如果图像不含地理坐标信息,默认返回值是:(0,1,0,0,0,1)//In a north up image,//左上角点坐标(padfGeoTransform[0],padfGeoTransform[3]);//padfGeoTransfor...

2019-12-18 10:18:57 6798 7

原创 【语言分析】看看我为了不写英语作业都做了些什么

Text Mining in Python: Steps and Examples词性标注(Part-of-speech tagging)词性标注(Part-of-speech tagging)(自然语言处理文档系列)Penn Treebank词性标记集import pandas as pdimport numpy as npimport osimport nltk.corpus...

2019-12-14 22:57:59 181

原创 【特征工程】(资料)使用Xgboost筛选特征重要性

资料:Using XGBoost For Feature SelectionFeature Importance and Feature Selection With XGBoost in Python

2019-12-14 16:42:10 903

转载 【基础概念】(自存)几种验证模型的方法(交叉验证及模型对比)

使用适当的验证技术可以帮助您理解您的模型,但最重要的是,评估一个无偏的泛化性能。

2019-12-14 11:33:08 5131

原创 【资料】Divide dataset

Is there a rule-of-thumb for how to best divide data into training and validation sets? Is an even 50/50 split advisable

2019-12-13 15:51:23 208

原创 【Pytorch】【CNN】一些资料

CNN 卷积神经网络

2019-12-12 15:36:46 95

原创 【CASE】芝加哥犯罪率数据集(CatBoostClassifier)

参考:top 2% based on CatBoostClassifier导入库与数据import numpy as npimport pandas as pdpd.set_option("display.max_columns", None)from sklearn.preprocessing import LabelEncoder, OrdinalEncoder, OneHotEnc...

2019-12-12 15:32:22 2790 1

原创 【特征工程】在机器学习中使用地理空间数据(转载)

原文:Working with Geospatial Data in Machine Learning如何使用地理空间类数据。首先通过可视化数据集(坐标点)来获得有价值的信息,然后,提出用于提取和创造新特征的不同方法,这些新特征将优化模型的建立。数据集来自:New York City Taxi Fare Prediction由于数据集实在太大,我只使用了测试集。import num...

2019-12-11 22:15:21 2124

原创 【特征工程】处理经纬度的9种方法/技巧(转载)

转载加修改:Feature engineering: all I learnt about Geo-spatial features1. 极坐标法Add two new features of Polar coordinates to the datasetx = Longitude;y = Latituderot_x = x * cosθ + y * sinθrot_y = x *...

2019-12-11 17:01:34 6530

原创 【Pandas操作】之列名

1. 参考:Pandas中修改DataFrame列名创建一个DataFrameimport pandas as pda = pd.DataFrame({'A':[1,2,3], 'B':[4,5,6], 'C':[7,8,9]})print(a) A B C0 1 4 71 2 5 82 3 6 9方法1,直接赋值缺点:必须把所有的列名都写上,否则...

2019-12-10 09:11:13 1175

原创 【特征处理】Label Encoding与One Hot

其实Catboost自带处理类别数据的功能。但还是学习一下。Label Encoding与One Hot的区别-201805131.两类模型:(A)逻辑回归,SVM。对数值大小是敏感的,即变量间的数值大小本身是有比较意义的。(B)树模型。对数值变化不敏感,数值存在的意义更多的是为了排序,即0.1,0.2,0.3与1,2,3是没有区别的,这部分模型绝大部分是。2.两类类别变量:2.1...

2019-12-09 16:01:43 461

原创 【基础概念】什么是benchmark model?

阅读文献的时候提到多次,决定还是存一些资料。What is a benchmark model?Benchmarking Predictive Models基准测试流程可能需要运行多次,并使用一个聚合平滑度量 smoothed measure(如中值median value)进行比较为了Benchmarking Models,set.seed,random.seed等的意义就出现了...

2019-12-09 14:56:01 4395

原创 把文本里含有某个关键词的赋值1,其余赋值为0

依旧是芝加哥犯罪的demo:dataset['Block'] = dataset['Address'].str.contains('block', case=False)dataset['Block'] = dataset['Block'].map(lambda x: 1 if x == True else 0)print(dataset.Block.head())0 01 ...

2019-12-08 22:36:21 755

原创 【特征处理】时间序列的一些处理

其余几个Demo讲清楚了,其实我就单拎出来。以消费者数据为例#%%import pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport numpy as npimport repd.set_option('display.max_columns', 1000)pd.set_option('dis...

2019-12-08 21:53:48 323

原创 关于数据泄露

关注这个主要是之前看了nature那篇地震预测的纷争,希望自己以后能绕开。存一些资料。一些文章:你可能过于高估了机器学习算法能力,带你解读鲜为人知的数据泄露问题Kaggle上关于data leakage的详细介绍以及提出的一些避免方法How Data Leakage Impacts Machine Learning Models(一个详细解释)八卦:Nature论文预测余震只是炒作?...

2019-12-08 21:11:36 180

原创 芝加哥犯罪率数据集(数据分析与特征处理)

参照:SF-Crime Analysis & PredictionCrime Scene Exploration and Model Fit主要是因为这个数据集包含了时间序列和坐标点。练习一下特征处理。数据分析导入库#%%%matplotlib inlineimport numpy as np import pandas as pdimport mathimport s...

2019-12-08 16:42:35 6560 1

原创 .shape[0]

import numpy as npimport pandas as pdc= np.array(([[1,1],[1,2],[1,3],[1,4]]))c = pd.DataFrame(c)print(c) 0 10 1 11 1 22 1 33 1 4print(c.shape[0])4

2019-12-08 14:27:05 1558 1

原创 Python安装Geopandas库

没想到装这个比配置pytorch还麻烦。Step1 查看属性import wheel.pep425tags as wprint(w.get_supported())[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ...

2019-12-07 16:53:05 761

原创 利用Shap解释Xgboost(或者别的)模型

Shap的一些介绍:SHAP包算法解析shap的中文解析知乎的翻译ps,sklearn库的模型可以用lime模块解析本文参考利用SHAP解释Xgboost模型数据集

2019-12-07 16:33:07 12738 6

原创 LabelEncoer,类别特征转换为数值特征,transform的使用

demo参照E-Commerce Data那篇对country类别的处理。换个简单的数据集Demo:import pandas as pdimport numpy as npdf = pd.DataFrame({"Person": ["John", "Myla", "Lewis", "John", "Myla"], ...

2019-12-07 10:27:50 796

原创 pandas.Series.str.contains(筛选)

https://blog.csdn.net/weixin_43615654/article/details/103419171这篇里用到了一个Str的contains函数,查了一下用法。pandas.Series.str.containsReturns: Series or Index of boolean valuesA Series or Index of boolean value...

2019-12-07 09:42:47 930

原创 Pandas的count()与value_counts()区别

pandas.DataFrame.count函数方法的使用count计算每列或每行的非NA单元格。值None,NaN,NaT和可选的numpy.inf(取决于pandas.options.mode.use_inf_as_na)被视为NA。demo:import pandas as pdimport numpy as npdf = pd.DataFrame({"Person":...

2019-12-06 15:44:47 6358

原创 kaggle上面的E-Commerce Data数据集练习(可视化与部分特征工程)

接上篇:https://editor.csdn.net/md/?articleId=103394900Part 2 特征工程及可视化一种处理时间数据的方法data.insert(loc = 2, column='year_month',value=data['InvoiceDate'].map(lambda x:100*x.year+x.month))data.insert(loc = ...

2019-12-06 11:27:25 1642 1

原创 kaggle上面的E-Commerce Data数据集练习(数据处理)

熟练一下pandas和数据处理项目地址参考:Python数据清洗指南Customer Segmentation with XGBoost (97.92%)项目描述:这是一个跨国数据集,包含2010年12月1日至2011年12月9日期间英国注册的非商店在线零售的所有交易。该公司主要销售独特的万能礼品。公司的许多客户都是批发商。Part 1 分析数据和清洗数据导入数据data = pd...

2019-12-04 21:46:52 3238

原创 pandas数据处理练习(数据集:犯罪率)

导入库import pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport numpy as npdata = pd.read_csv("C:\\Users\\Nihil\\Documents\\pythonlearn\\data\\random\\crimerate.csv")data.drop(...

2019-12-04 17:30:34 787 1

原创 categorical_features_indices = np.where(X.dtypes != np.float)[0]的含义

参考:CatBoost: A machine learning library to handle categorical (CAT) data automatically数据类型:X = train.drop(['Item_Outlet_Sales'], axis=1)y = train.Item_Outlet_Salesfrom sklearn.model_selection imp...

2019-12-01 20:25:04 1203

原创 Pandas练习资料,技巧,函数 &cat.codes +1

50道练习一些奇怪的操作在这里插入代码片

2019-12-01 15:41:33 2071

原创 统计学_相关性分析(资料)

用Python统计推断——相关性篇

2019-12-01 10:40:52 584

原创 Dataset(自留)_Geoscience

Landslide Hazards

2019-12-01 09:33:58 118

原创 特征处理与可视化资料

数据分析思维训练—泰坦尼克生还者预测鳄梨价格分析——Python数据可视化This notebook demos Python data visualizations on the Iris dataset特征处理的小case

2019-11-30 18:02:31 107

原创 宝可梦数据集的练习(预测模型)

仍然是参照:https://www.kesci.com/home/project/5b02bf4b57e80961e67c3b06先根据原文做,之后再做改动吧预测模型采用算法:1)Logistic Regression2)Support Vector Machines(Linear and radial)3)Random Forest4)K-Nearest Neighbours5)...

2019-11-30 17:18:17 3173

原创 机器学习模型的可解释性

参考:https://www.jiqizhixin.com/articles/2019-10-30-9

2019-11-30 15:05:16 264

原创 数据共线性处理——用seaborn的方式(1),顺便也存些seaborn的资料

参考:https://zhuanlan.zhihu.com/p/50736139https://www.jiqizhixin.com/articles/2019-01-30-15https://lanpeihui.top/2018/09/27/%E7%89%B9%E5%BE%81%E9%80%89%E6%8B%A9%E5%AE%9E%E8%B7%B5/http://codingdict.co...

2019-11-28 11:29:43 426

原创 宝可梦数据集的练习(数据和特征的分析)

不想干正事练习点别的。来自kaggle项目:Visualizing Pokémon Stats with SeabornEDA-Pokemon目录Part1: 探索性数据分析:1)特征分析.2)发现特征间的关系和趋势Part2: 特征工程和数据清洗:1)移除多余的特征2)数据类型的转换Part3: 预测模型1)基本算法2)交叉验证3)集成算法4)重要特征抽取Par...

2019-11-27 22:16:30 5066

原创 特征输出重要性的排序

几个参考:模型输出特征重要性排序在 Python 中使用 XGBoost 的特征重要性和特征选择关于seaborn作图barplot&countplot&pointplotPython Seaborn综合指南1.用matplotlibimport pandas as pdfrom xgboost import XGBClassifierfrom xgboost i...

2019-11-27 20:51:46 5160

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除