03 2020 档案

摘要:代码: 1 # -*- coding:utf-8 -*- 2 3 import numpy as np 4 import math 5 6 7 # 相关度 8 def computeCorrelation(X, Y): 9 xBar = np.mean(X) 10 yBar = np.mean(Y) 阅读全文
posted @ 2020-03-30 00:13 博二爷 阅读(715) 评论(0) 推荐(0)
摘要:代码: 1 # -- coding: gbk -- 2 from sklearn.datasets import load_breast_cancer 3 from sklearn.model_selection import train_test_split 4 import pandas as 阅读全文
posted @ 2020-03-28 00:07 博二爷 阅读(794) 评论(0) 推荐(0)
摘要:直接给代码: 1 # -- coding: gbk -- 2 from sklearn.datasets import load_breast_cancer 3 from sklearn.tree import DecisionTreeClassifier 4 from sklearn.model_ 阅读全文
posted @ 2020-03-26 23:58 博二爷 阅读(511) 评论(0) 推荐(0)
摘要:注释很清楚: 1 import tensorflow as tf 2 import os 3 import numpy as np 4 import matplotlib.pyplot as plt 5 os.environ["CUDA_VISIBLE_DEVICES"]="0" 6 learnin 阅读全文
posted @ 2020-03-26 12:44 博二爷 阅读(281) 评论(0) 推荐(0)
摘要:解析在注释里: 1 import tensorflow as tf 2 from tensorflow.examples.tutorials.mnist import input_data 3 import os 4 os.environ["CUDA_VISIBLE_DEVICES"]="0" 5 阅读全文
posted @ 2020-03-26 12:43 博二爷 阅读(643) 评论(0) 推荐(0)
摘要:pip源的更改: pip的默认源在国外,pip install some_packages特别慢,经常会超时,导致安装失败; pip 更换为国内的镜像 一:使用方法: ①临时使用: 1 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple “ 阅读全文
posted @ 2020-03-25 21:51 博二爷 阅读(3680) 评论(2) 推荐(0)
摘要:代码: # -- coding: gbk -- from sklearn.datasets import load_breast_cancer from pylab import * from sklearn.model_selection import train_test_split from 阅读全文
posted @ 2020-03-24 23:54 博二爷 阅读(855) 评论(0) 推荐(0)
摘要:因为注释已经很详细了,所以直接上代码: 1 # -- coding: gbk -- 2 import mglearn 3 from pylab import * 4 from sklearn.model_selection import train_test_split 5 mpl.rcParams 阅读全文
posted @ 2020-03-24 23:15 博二爷 阅读(538) 评论(0) 推荐(0)
摘要:因为注释已经很详细了,所以直接上代码: 1 from sklearn.datasets import load_iris 2 from sklearn.model_selection import train_test_split 3 #k临近算法 4 from sklearn.neighbors 阅读全文
posted @ 2020-03-23 23:46 博二爷 阅读(356) 评论(0) 推荐(0)
摘要:切词: 1 from pyhanlp import * 2 content = "现如今,机器学习和深度学习带动人工智能飞速的发展,并在图片处理、语音识别领域取得巨大成功。" 3 CoreStopWordDictionary = JClass("com.hankcs.hanlp.dictionary 阅读全文
posted @ 2020-03-23 22:58 博二爷 阅读(1912) 评论(0) 推荐(0)
摘要:代码: 1 # -*- coding:UTF-8 -*- 2 from numpy import * 3 import jieba as jb 4 import time 5 # 计算权值,并存储为txt 6 # 计算所有文本包含的总词数 7 def wordsCount(dataSet): 8 w 阅读全文
posted @ 2020-03-19 11:33 博二爷 阅读(537) 评论(0) 推荐(0)
摘要:因为里面有很详细的解释,所以就不做过多阐释: 1 from pyhanlp import * 2 import numpy as np 3 import re 4 5 '''创建数据集:单词列表postingList, 所属类别classVec''' 6 def Handle_data(conten 阅读全文
posted @ 2020-03-14 22:07 博二爷 阅读(582) 评论(0) 推荐(0)
摘要:只需要: 1 im = Image.fromarray(np.uint8(“你的数组”)) 2 im.convert('RGB').save("MY.jpg",format = 'jpeg') 阅读全文
posted @ 2020-03-14 17:53 博二爷 阅读(1314) 评论(0) 推荐(0)
摘要:简单分词: 1 from pyhanlp import * 2 content = "现如今,机器学习和深度学习带动人工智能飞速的发展,并在图片处理、语音识别领域取得巨大成功。" 3 Get_value=HanLP.segment(content) 4 print(Get_value) 输出: 加词 阅读全文
posted @ 2020-03-14 17:51 博二爷 阅读(761) 评论(0) 推荐(1)
摘要:代码: 1 import scipy.stats as ss 2 3 obs=[107,198,192,125,132,248]#真实值 4 exp=[167]*6#期望值 5 ''' 6 关于p值意义: 7 P>0.05 碰巧出现的可能性大于5% ,不能否定无效假设,两组差别无显著意义 8 P<0 阅读全文
posted @ 2020-03-11 19:24 博二爷 阅读(273) 评论(0) 推荐(0)
摘要:1 #!/usr/bin/env python 2 # encoding: utf-8 3 4 """ 5 @author: zkjiang 6 @site: https://www.github.com 7 @software: PyCharm 8 @file: TFIDF.py 9 @time: 阅读全文
posted @ 2020-03-10 23:52 博二爷 阅读(666) 评论(1) 推荐(0)
摘要:思路: 1、查找指定字段如(公司名称) 2、根据公司名称,从后往前,慢慢提取 public static String Get_code(String dy_name,String table_name) throws SQLException { String code=""; int len=d 阅读全文
posted @ 2020-03-10 18:01 博二爷 阅读(297) 评论(0) 推荐(0)
摘要:代码: 1 #urllib is used to download the utils file from deeplearning.net 2 import urllib.request 3 response = urllib.request.urlopen('http://deeplearnin 阅读全文
posted @ 2020-03-08 22:29 博二爷 阅读(588) 评论(0) 推荐(0)
摘要:代码 1 # -*- coding: utf-8 -*- 2 # @Time : 2018/12/1 11:06 3 # @Author : MaochengHu 4 # @Email : wojiaohumaocheng@gmail.com 5 # @File : read_tfrecord.py 阅读全文
posted @ 2020-03-07 22:23 博二爷 阅读(225) 评论(0) 推荐(0)
摘要:代码: 1 # -*- coding: utf-8 -*- 2 # @Time : 2018/11/23 0:09 3 # @Author : MaochengHu 4 # @Email : wojiaohumaocheng@gmail.com 5 # @File : generate_tfreco 阅读全文
posted @ 2020-03-07 22:21 博二爷 阅读(254) 评论(0) 推荐(0)
摘要:只有一个很简单的group_concat()函数 1 select group_concat(你要合并字段名称) from access_jian where 。。。; 阅读全文
posted @ 2020-03-07 16:42 博二爷 阅读(480) 评论(0) 推荐(0)
摘要:二话不说给代码: 1 #urllib is used to download the utils file from deeplearning.net 2 import urllib.request 3 response = urllib.request.urlopen('http://deeple 阅读全文
posted @ 2020-03-03 18:51 博二爷 阅读(1642) 评论(0) 推荐(0)
摘要:最简代码: 1 #简单的决策树分类 2 from sklearn import tree 3 features = [[300,2],[450,2],[200,8],[150,9]] 4 labels = ['apple','apple','orange','orange'] 5 clf = tre 阅读全文
posted @ 2020-03-03 18:35 博二爷 阅读(810) 评论(0) 推荐(0)
摘要:直接给代码 1 # -*- coding: UTF-8 -*- 2 from math import log 3 import operator 4 5 """ 6 函数说明:计算给定数据集的经验熵(香农熵) 7 8 Parameters: 9 dataSet - 数据集 10 Returns: 1 阅读全文
posted @ 2020-03-03 18:30 博二爷 阅读(423) 评论(0) 推荐(0)
摘要:上代码 1 import os 2 if __name__=='__main__': 3 str="CHCP 65001"+"&&" 4 str+="E:"+"&&" 5 str += "cd E:\\DATAX\\datax\\bin" + "&&" 6 str += "python datax. 阅读全文
posted @ 2020-03-01 18:19 博二爷 阅读(1207) 评论(0) 推荐(0)
摘要:二话不说直接给代码 1 package UTIL; 2 import java.io.BufferedReader; 3 import java.io.BufferedWriter; 4 import java.io.IOException; 5 import java.io.InputStream 阅读全文
posted @ 2020-03-01 17:43 博二爷 阅读(1415) 评论(0) 推荐(1)
摘要:先说一下可测试性: 可测试性战术的目标是允许在完成软件开发的一个增量后,轻松的对软件进行测试。 测试的目标是发现错误。 具有可测试性的代码有什么特点? 1. 控制性。 控制性是指测试者给在被测试的软件提供固定的输入数据的方便程度。换句话说就是软件本身接受定义明确的参数,并且这些参数可由测试者灵活的传 阅读全文
posted @ 2020-03-01 15:29 博二爷 阅读(914) 评论(0) 推荐(0)
摘要:先说一下可测试性: 可测试性战术的目标是允许在完成软件开发的一个增量后,轻松的对软件进行测试。 测试的目标是发现错误。 具有可测试性的代码有什么特点? 1. 控制性。 控制性是指测试者给在被测试的软件提供固定的输入数据的方便程度。换句话说就是软件本身接受定义明确的参数,并且这些参数可由测试者灵活的传 阅读全文
posted @ 2020-03-01 00:10 博二爷 阅读(173) 评论(0) 推荐(0)