
数据预处理
Bill_zhang5
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
One_hot编码批处理实现
特征更多的时候是分类特征,而不是连续的数值特征。 比如一个人的特征可以是``[“male”, “female”]``, ["from Europe", "from US", "from Asia"], ["uses Firefox", "uses Chrome", "uses Safari", "uses Internet Explorer"]。 这样的特征可以高效的编码成整数,例如 ["male原创 2018-01-17 11:01:29 · 690 阅读 · 0 评论 -
TensorFlow批读取图片
# coding:utf-8from __future__ import print_functionimport osimport tensorflow as tfdef TF_image_data(path_to_images): """ using tensorflow to read and store data """ if not t...原创 2019-07-25 14:42:33 · 230 阅读 · 0 评论 -
Python绘制箱形图
#coding: utf-8from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionimport matplotlib.pyplot as pltimport numpy as npall_data = np.loadtxt(...原创 2019-05-27 08:52:02 · 740 阅读 · 0 评论 -
matplotlib绘制两个柱状图
import matplotlib.pyplot as pltimport numpy as npdata_2 = [93, 92, 93, 91, 92,93]data_3 = [57,56, 57,56,56.,54]labels = ['HL', 'ED', 'HD_2', 'HD_all', 'Voting','ME']fig,ax = plt.subplots(f...原创 2019-05-27 08:50:32 · 3609 阅读 · 0 评论 -
特征选择之计算特征重要性(二):树森林 (forests of trees)
import numpy as npimport matplotlib.pyplot as pltfrom sklearn.datasets import make_classificationfrom sklearn.ensemble import ExtraTreesClassifierfrom sklearn.ensemble import RandomForestClassif...原创 2019-01-03 09:07:40 · 952 阅读 · 0 评论 -
特征选择之计算特征重要性(一):树森林 (forests of trees)
import numpy as npimport matplotlib.pyplot as pltfrom sklearn.datasets import make_classificationfrom sklearn.ensemble import ExtraTreesClassifierdata_matrix = np.loadtxt(open("table_11.csv", ...原创 2019-01-02 20:57:40 · 2430 阅读 · 0 评论 -
离散特征的转化LabelEncoder和OneHotEncoder
from sklearn.preprocessing import LabelEncoderfrom sklearn.preprocessing import OneHotEncoderimport pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport seaborn as snsimport warn...原创 2018-12-22 14:57:57 · 683 阅读 · 0 评论 -
Python按列和按行读取数据
def data_transform(heading, value): """ 按列读取 """ data_length = len(value) ticker_length =len(heading)-1 value_list=[] ticker_list =[] date_list =[] for i in range(tick...原创 2018-11-18 17:49:42 · 11821 阅读 · 0 评论 -
开源项目收集
https://github.com/loliverhennigh/Convolutional-LSTM-in-Tensorflow https://github.com/xylcbd/blogs_code/blob/master/algorithm-python-knn/knn.py https://machinelearningmastery.com/visualize-machine-lea...原创 2018-11-18 17:40:50 · 282 阅读 · 0 评论 -
Python将dat文件批转为csv和txt文件
DAT并不是一种标准文件。许多软件都使用这个扩展名,但文件含义不同。而许多数据分析软件也用这个扩展名保存数据。所以这要看具体的软件情况来定。DAT文件,可以按照扩展名来看就是DATA的意思,即数据文件,这类文件并没有进行绝对化的定义。dat文件批处理转为txt文件#utf-8import osimport syspath_0 =r"C:\Users\dell\Desktop\PAMAP2_...原创 2018-06-07 14:39:39 · 14549 阅读 · 3 评论 -
tensorflow的tensorboard的使用在Windows下的改进版及自定义读取函数
from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionimport osimport tensorflow as tfimport sysimport numpy as npimport collectionsfrom sk...原创 2018-05-24 11:09:16 · 443 阅读 · 0 评论 -
Python几种读取mat格式数据的方法
matlab中使用的数据一般会以mat的格式存储,用python读取有以下几种方法1、使用scipy,具体实现如下:import scipy.io as scioimport pandas as pddata_path="train.mat"#Method 1data = scio.loadmat(data_path)data_train_label=data_train.get('label')原创 2018-01-18 14:59:20 · 46905 阅读 · 2 评论 -
Opencv, PIL.Image和TensorFlow对图像进行resize(缩放)基于Python
一、基于OpenCV的方法def Resize_Image_cv2(img_name, height, width, method): ''' :param img_name: the name of image :param height, width: the resized heigth, width ''' img = cv2.imread(i...原创 2019-08-08 11:58:45 · 2053 阅读 · 0 评论