- 博客(36)
- 资源 (1)
- 收藏
- 关注
原创 相似性度量总结
cosineJaccard系数(杰卡德系数)cosine更适合稠密空间,Jaccard和tfidf都适合稀疏空间.狭义Jaccard相似度,计算两个集合之间的相似程度,元素的“取值”为0或1对集合A和B,Jaccard相似度计算如下:Jaccard(A, B)= |A intersectB| / |A union B|相似度数值在[0, 1]之间,当A==B的时候,为1. 优缺点,...
2020-02-06 19:37:51
1229
1
原创 springboot基于配置控制注解是否生效
基于配置控制https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/condition/ConditionalOnProperty.html个注解的作用是当这个属性的值等于havingValue中的值的时候则会将bean进行注入,所以都是和@bean,@Compant...
2020-02-03 17:39:16
4724
原创 后端备忘录
idea常用插件lomdokrestfultoolkitdatabase tools and sqleasycodeRainbow BracketsAlibaba Java Coding Guidelinesplantuml integrationMaven HelperFindBugsfree mybatissonarlintjsonFormatKey promoter...
2020-02-03 17:38:07
341
原创 切面编程:自定义注解形式实现计时、数据上报
自定义注解aop/Monitor.javaimport java.lang.annotation.*;@Retention(RetentionPolicy.RUNTIME)@Target({ElementType.METHOD})@Documentedpublic @interface Monitor { String reportName() default "";}...
2020-02-03 16:53:49
494
转载 ubuntu上使用cron执行定时任务计划
在ubuntu下,cron为自带的系统服务。任意用户下,输入“crontab -e”即可进入任务编写。相关提示大致如下:[html] view plain copy print?# Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a singl
2017-07-13 21:54:37
1699
转载 python-time
取得时间相关的信息的话,要用到python time模块,python time模块里面有很多非常好用的功能,你可以去官方文档了解下,要取的当前时间的话,要取得当前时间的时间戳,时间戳好像是1970年到现在时间相隔的时间。你可以试下下面的方式来取得当前时间的时间戳:import timeprint time.time()输出的结果是:1279578704.6725271但是这样是一连串的数
2017-07-13 21:53:59
444
转载 sklearn.preprocessing中 LabelEncoder 和 OneHotEncoder区别
简单来说 LabelEncoder 是对不连续的数字或者文本进行编号from sklearn.preprocessing import LabelEncoder le = LabelEncoder() le.fit([1,5,67,100]) le.transform([1,1,100,67,5]) 输出: array([0,0,3,2,1])OneHotEncoder 用于将表示分类的数据
2017-06-09 15:24:02
2829
转载 Pandas标记删除重复记录
Pandas提供了duplicated、Index.duplicated、drop_duplicates函数来标记及删除重复记录duplicated函数用于标记Series中的值、DataFrame中的记录行是否是重复,重复为True,不重复为Falsepandas.DataFrame.duplicated(self, subset=None, keep=’first’)pandas.Seri
2017-06-02 17:59:45
13578
转载 ubuntu rar
经常用到, 如果再次搜索会找到很多干扰信息,而且都没有详细解析每个命令的具体用法,觉得这个博文解释的很详细,再次用的时候也很方便的找到。因为 参数 e 和 x 经常用错,特意记录在此。ubuntu刚安装的时候是不能解压rar文件的,只有在安装了解压工具之后,才可以解压。安装:sudo apt-get install unrar卸载:sudo apt-get remove unrarrar常用命令
2017-04-11 19:45:24
699
原创 python发送邮件
coding: utf-8import smtplib from email.mime.text import MIMEText from email.header import Headersender = ” receiver = ” subject = ” smtpserver = ‘smtp.163.com’ username = sender password = ”msg
2017-03-30 01:51:09
520
转载 sklearn.preprocessing
转载自:http://2hwp.com/2016/02/03/data-preprocessing/常见的数据预处理方法,以下通过sklearn的preprocessing模块来介绍;1. 标准化(Standardization or Mean Removal and Variance Scaling)变换后各维特征有0均值,单位方差。也叫z-score规范化(零均值规范化)。计算方式是将特征值减去
2017-03-28 16:13:09
927
翻译 grid_search_error
I’m trying to get to grips with sci-kit learn for some simple machine learning projects but I’m coming unstuck with Pipelines and wonder what I’ve done wrong…I’m trying to work through a tutorial on Ka
2017-03-28 00:54:30
662
翻译 pandas.map
Series.map(arg, na_action=None)[source]¶Map values of Series using input correspondence (which can bea dict, Series, or function)Parameters:arg : function, dict, or Seriesna_action : {None, ‘ignore
2017-03-20 21:03:33
2022
转载 PANDAS 数据合并与重塑(join/merge篇)
在上一篇文章中,我整理了pandas在数据合并和重塑中常用到的concat方法的使用说明。在这里,将接着介绍pandas中也常常用到的join 和merge方法mergepandas的merge方法提供了一种类似于SQL的内存链接操作,官网文档提到它的性能会比其他开源语言的数据操作(例如R)要高效。和SQL语句的对比可以看这里merge的参数on:列名,join用来对齐的那一列的名字,用到这个参数的
2017-03-20 20:52:23
109683
1
转载 PANDAS 数据合并与重塑(concat篇)
pandas作者Wes McKinney 在【PYTHON FOR DATA ANALYSIS】中对pandas的方方面面都有了一个权威简明的入门级的介绍,但在实际使用过程中,我发现书中的内容还只是冰山一角。谈到pandas数据的行更新、表合并等操作,一般用到的方法有concat、join、merge。但这三种方法对于很多新手来说,都不太好分清使用的场合与用途。今天就pandas官网中关于数据合并和
2017-03-20 20:40:12
10872
转载 pandas.DataFrame.to_csv
pandas.DataFrame.to_csvDataFrame.to_csv(path_or_buf=None, sep=’, ’, na_rep=”, float_format=None, columns=None, header=True, index=True, index_label=None, mode=’w’, encoding=None, compression=None, quot
2017-03-19 19:25:59
11258
转载 ubuntu16.04命令行模式黑屏解决办法
ubuntu16.04命令行模式黑屏解决办法问题描述在ubuntu上装Nvidia的显卡驱动,需要关闭图形界面才能安装驱动,但是,出现如下情况: 使用“ctrl+alt+F1”命令进入命令行界面是黑屏使用“sudo service lightdm stop”关闭图形界面之后也是黑屏(偶尔出现“/dev/sda6: clean, 211/30976 files, 64698/123904 bl
2017-03-16 15:38:56
8526
转载 ubuntu物理内存和虚拟SWAP分区调整问题
1. 涉及内存小或者虚拟SWAP分区调整问题 可以通过 系统监视器 进行查看 在UBUNTU系统里面,并不是你的物理内存全部耗尽之后,系统才使用swap分区!系统的swappiness设定值,对如何使用swap分区是有着很大的联系。 swappiness=0 的时候表示最大限度使用物理内存,然后才是 swap空间swappiness=100的时候表示积极的使用sw
2017-03-15 22:50:25
2009
原创 randomforest&GradientBoosting
!/usr/bin/env python3-- coding: utf-8 --“”” Created on Tue Mar 14 14:39:19 2017@author: dreamer “”” import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets im
2017-03-14 15:49:09
1358
原创 train_test_split(X, y, stratify=y)
from sklearn.model_selecting import train_test_spilt() 参数stratify: 依据标签y,按原数据y中各类比例,分配给train和test,使得train和test中各类数据的比例与原数据集一样。 A:B:C=1:2:3 split后,train和test中,都是A:B:C=1:2:3 将stratify=X就是按照X中的比例分配 将
2017-03-14 14:26:09
36210
2
翻译 KNN:Strengths, weaknesses, and parameters
Strengths, weaknesses, and parameters In principle, there are two important parameters to the KNeighbors classifier: the number of neighbors and how you measure distance between data points. In pract
2017-03-09 11:07:10
884
转载 Python 中的range,以及numpy包中的arange函数
Python 中的range,以及numpy包中的arange函数range()函数函数说明: range(start, stop[, step]) -> range object,根据start与stop指定的范围以及step设定的步长,生成一个序列。参数含义:start:计数从start开始。默认是从0开始。例如range(5)等价于range(0, 5);
2017-03-08 20:46:21
29705
转载 python中使用zip函数出现<zip object at 0x02A9E418>
在Python中使用zip函数,出现<zip object at 0x02A9E418>错误的原因是,你是用的是python2点多的版本,python3.0对python做了改动zip方法在Python 2 和Python 3中的不同为何有这种不同更多注解问题一:zip方法在Python 2 和Python 3中的不同Python 2 的代码演示:$ python2>>> a = zip((
2017-03-08 20:40:26
10433
1
转载 train_test_split(random_state) [sklearn]
X_train,X_test,y_train,y_test = train_test_split( iris_dataset[‘data’],iris_dataset[‘target’],random_state=0)在SKILEARN中,train_test_split方法有一个参数叫random_state,它的用途是在随机划分训练集和测试集时候,划分的结果并不是那么随机,也即
2017-03-08 15:51:49
9294
1
转载 Python科学计算的瑞士军刀——Anaconda 安装与配置
IntroducePython是一种强大的编程语言,其提供了很多用于科学计算的模块,常见的包括numpy、scipy和matplotlib。要利用Python进行科学计算,就需要一一安装所需的模块,而这些模块可能又依赖于其它的软件包或库,因而安装和使用起来相对麻烦。幸好有人专门在做这一类事情,将科学计算所需要的模块都编译好,然后打包以发行版的形式供用户使用,Anaconda就是其中一个常用的科学计算
2017-03-07 13:52:44
516
原创 Tensorboard学习
对官网Deep MNIST for Experts的例程做了可视化修改from tensorflow.examples.tutorials.mnist import input_datamnist = input_data.read_data_sets('MNIST_data', one_hot=True)import numpy as npimport tensorflo
2017-03-06 21:38:33
426
转载 跟着TensorFlow的进阶级教程实现MNIST库的训练
背景介绍代码实现及结果小问题 ResourceExhaustedError的原因及解决方式Saver()进行模型存储及恢复再说一下DL的运行时间吧小结优质资源分享背景介绍做这件事的初衷有二: ①做完入门级的,自然要进阶一下。 ②之前做到的准确率只有92%,据说进阶版可以把准确率做到99.2% 步骤还是参考TensorFlow的中文教程,自然没有上次那么简单,有些坑掉进去了,好歹
2017-03-06 21:35:48
536
转载 Scp(secure copy)Linux间传输文件
Linux 的 scp 命令 可以 在 linux 之间复制 文件 和 目录; ================== scp 命令 scp 可以在 2个 linux 主机间复制文件; 命令基本格式: scp [可选参数] file_source file_target ====== 从 本地 复制到 远程 复制文件: * 命令格式: scp
2017-03-06 21:17:39
667
转载 vim 自动添加头注释
Vim的强大就不用我多说了,很多的自定义功能可以由自己更改Vim的配置文件以实现,本文将介绍的是:创建新文件时,自动添加头部注释信息保存文件时,自动重写“修改时间”先来看看效果,当直接创建一个新文件的时候(vim filename.PHP),就会出现以下注释文字01<?php02#***********************************************03#04#
2017-03-06 17:22:53
727
转载 Tensorflow学习笔记
Tensorflow学习笔记(3) (2016-02-22 15:39:01)转载▼ var tag=″;vartag='';
2017-03-06 00:13:24
460
原创 Ubuntu休眠后不能唤醒
建议以后安装分配交换空间。出处:http://blog.youkuaiyun.com/huludan/article/details/52725594出处:http://www.tuicool.com/articles/uiMzuuI解决办法:安装laptop-mode-tools工具包。1.检查是否安装了grep laptop-mode-tools 工具包$ dpkg -l | grep laptop-
2017-03-06 00:07:10
14005
2
转载 四种激活函数(Relu Linear Sigmoid Tanh)
整流器(神经网络)https://en.wikipedia.org/wiki/Rectifier_(neural_networks)Rectifier (neural networks)维基百科,自由的百科全书整流器(蓝色)和softplus(绿色)的曲线在x = 0附近起作用在人工神经网络的上下文中,整流器是定义
2017-03-05 21:51:56
21634
原创 TensorFlow1.0在腾讯云上的安装问题
1.之前有在自己的Linux上安装了TensorFlow0.8,当时pip install的时候总是read time out,到了晚上两点,网络好一些才安装成功。2.现在想在腾讯云上安装TensorFlow1.0,刚开始直接pip install tensorflow,但是总是遇到超时问题。之后换用另一个网址下载,却总是出现Memory Error问题。3.网上找不到Tensor
2017-03-03 20:13:12
1991
3
原创 Tensorflow 网站host
1.最近Tensorflow1.0发布,但是官网上不去,科学上网也上不去,在github上有人提供修改hosts文件的方法(64.233.188.121 www.tensorflow.org )2.Linuxhosts文件在/ext/hosts内 ,需要root权限修改。vim /ext/hosts3.win7 hosts文件位置C:\W
2017-03-03 19:57:20
1702
原创 1553B总线_RT端
//1553B_RT.CPP #include #include #include /***API***/ #include "Proto_mch.h" #include "deviceio.h" #include "error_devio.h" #include "Error_mch.h" #include "exc4000.h" #
2017-01-12 22:29:45
6181
原创 1553B总线_BC端
#include #include #include "Proto_mch.h" #include "deviceio.h" #include "error_devio.h" #include "Error_mch.h" #include "exc4000.h" #include "excdef.h" #include "excsysio.h"
2017-01-12 22:05:03
4848
1
学习正则表达式.pdf
2017-03-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人