自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 资源 (2)
  • 收藏
  • 关注

原创 setuptools

python Flask项目打包分发工具setuptools使用1:打包和配置# setup.py文件(项目下)# -*- coding:utf-8 -*-__author__ = 'Marco'#coding:utf8from setuptools import setup,find_packagessetup( name='Flask_demo_01', #应用...

2019-07-01 13:15:29 272

原创 Pandas日期处理

参看:https://www.jianshu.com/p/93734eeed9b3

2019-04-25 15:18:13 250

原创 sql_server笔记

window 下 SQLserver 配置ip地址主要参考:https://blog.csdn.net/qq_22642239/article/details/75635232

2019-04-16 09:40:16 227

翻译 Scala_leetcode

Two_sumScala codeimport scala.collection.mutableobject Solution { def twoSum(nums: Array[Int], target: Int): Array[Int] = { var map = Map[Int, Int]() for (i <- 0 until nums.length) {...

2019-04-03 13:52:26 193

原创 Pandas笔记

@缺失值填充(transform) # rep_s = df_valid.groupby('rmp_id')['run_cap'].transform('mean') # 利用均值填充run_cap 为nall # df_valid['run_cap'].fillna(rep_s, inplace = True)

2019-02-27 12:00:53 308

原创 机器学习-特征选择sbs

序列向后特征选择from itertools import combinationsimport numpy as npfrom sklearn.metrics import accuracy_scorefrom sklearn.model_selection import train_test_splitclass SBS(): def __init__(self, e...

2018-08-09 10:01:37 1710

原创 感知机

来源于机器学习import numpy as npclass Perceptron(object): """Perceptron classifier. Parameters ------------ eta : float Learning rate (between 0.0 and 1.0) n_iter : int Passe...

2018-07-26 09:21:20 353

转载 centos

http://www.centoscn.com/CentOS/config/2014/0810/3471.html1、添加用户,首先用adduser命令添加一个普通用户,命令如下: adduser tommy//添加一个名为tommy的用户passwd tommy //修改密码Changing password for user tommy. New UNIX p...

2018-06-15 10:00:09 165

原创 windows 下spark的安装

参看文献: 先配置java 安装spark 最后安装对应版本的hadoop 出现问题参考文件【2】 【1】https://blog.csdn.net/u011513853/article/details/52865076 【2】https://blog.csdn.net/u011242657/article/details/53968135...

2018-05-29 18:01:25 293

原创 1.3 线性回归-Lasso回归

线性回归-Lasso回归# -*- coding: utf-8 -*-"""auhtor:Marcoalgorithm name :Lasso Regression"""print (__doc__)import numpy as npfrom sklearn import cross_validation,linear_model,datasetsdef load_dat...

2018-05-02 09:16:54 314

原创 1.2 线性回归-Ridge回归

线性回归-Rige回归# -*- coding:utf-8 -*-"""回归模型1.2 Ridge regressionauthor :marco"""print (__doc__)import matplotlib.pyplot as pltimport numpy as npfrom sklearn import datasets,linear_model,cross...

2018-05-02 08:52:01 262

原创 1.1 回归-线性回归

机器学习之-线性回归sklean库的api# -*- coding:utf-8 -*-# @author Marcoprint (__doc__)import matplotlib.pyplot as pltimport numpy as npfrom sklearn import datasets,linear_model,cross_validationdef lo...

2018-05-01 08:20:23 439

原创 python 模型的保存

来源于知乎模型上线一般通过java处理 此时最好用pmml,github上有sklearntopmml的模块可以免费使用,强烈推荐。 这和R语言有点类似完整的一个例子# conding = utf-8from sklearn import svmfrom sklearn.externals import joblibimport osX = [[0,1],[0,2]...

2018-04-25 14:59:14 5440

翻译 集成学习算法

本文来源于网络# coding=utf8from sklearn.model_selection import cross_val_scorecross_val_score()from sklearn import datasetsfrom sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier, Gra...

2018-04-25 14:26:10 317

原创 逻辑回归-采用的是梯度上升

# 读取数据和分割数据from math import expimport numpy as npdef loadData(): dataMat=[];labelMat =[] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() ...

2018-04-21 15:18:58 566

原创 python_socket_tcp

# -*- coding:utf-8 -*-import socketHOST='127.0.0.2' #服务端的IP地址PORT=50007 #服务端的端口号s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)try: s.connect((HOST,PORT))except Exception as e: print...

2018-03-30 21:41:00 197

原创 链接数据库的几种方法

1、JDBC可以对数据库操作dbSendUpdate(codb,"delete from dbo.a_gas_alarm where End_DT = '2018-01-15 09:00:33';")#details:Methods for the class ‘JDBCConnection’ in Package ‘RJDBC’.dbSendQuery and db

2018-02-02 09:54:12 398

原创 ggplot_笔记

1、基本绘图P <- ggplot2::ggplot(data=zx2,aes(X1,Y1,color=as.factor(code),shape=as.factor(code))) + geom_point(size=2) + geom_smooth(mapping = aes(X1,Y1),method='lm',data=zx2[1:10,],se=F) + labs(titl

2018-02-01 09:16:34 273

原创 R使用小技巧

RMARKDOWN 写文档设置图像``{r, fig.width=***, fig.height=***}如果是文字在chunk中加入 options(width = ***)

2017-12-04 17:37:30 434

原创 R语言数据清洗:table、xtabs,ftable,(tidyr)、(reshape2)

R语言常用的表格处理函数 table: 语法形式:table(x,y,z),其中x,y,z是因子集合或可转化成因子的对象 当table的参数如上含有多个,table输出的结果是一个多维数组。 table的例子:泰坦尼克数据df <- Titanicdf <- as.data.frame(df)head(df)#查看男、女的计数table(df$Sex)

2017-11-28 21:46:03 7037

原创 Send Email

library(mailR)sender <- c("发送邮箱")recipients <- c("接收邮箱")send.mail(from = sender, to = recipients, encoding = 'utf-8', subject = "自动化报告", body = "数据报表",

2017-11-28 16:03:36 612

原创 auto_report

ANALYSIS.RmdssBuilt_report.R# Set working directorysetwd("D:\\R_PROJECT\\machine_learning\\machine\\secco")# Load packagesrequire(knitr)require(markdown)# Create .md, .html, and .pdf filesknit("M

2017-11-28 15:28:00 327

原创 R_笔记

从github中load数据library(RCurl)x getURL("https://raw.github.com/aronlindberg/latent_growth_classes/master/LGC_data.csv")y read.csv(text = x)From UCI## Not run: # Download UCI Archived Data

2017-11-21 15:15:57 251

翻译 Supervised learning-1.1 Generalized Linear models

机器学习有监督学习系列开篇:1.1 广义线性模型(Generalized Linear models)1.1.1   (最小二乘法)Ordinary Least Squares LinearRegression 问题数学中实际就是找到一个如下的关系式:

2017-11-18 16:11:41 304

翻译 sklear_ELASTIC_regression

Elastic net regressionimport numpy as npfrom sklearn import linear_modelimport matplotlib.pyplot as pltX = np.c_[.5,1].Ty = [.5,1]test = np.c_[0,2].Tregr = linear_model.LinearRegression()plt.fig

2017-11-14 15:46:18 305

翻译 python_linear_model

# -*- coding: utf-8 -*-"""come form sklearn测试"""print (__doc__)#load data from sklearnfrom sklearn import datasetsdiabetes = datasets.load_diabetes()diabetes_X_train = diabetes.data[:-20]dia

2017-11-14 14:50:04 1434

翻译 permutations

## data permutations# Python function to print permutations of a given listdef permutation(lst): # If lst is empty then there are no permutations if len(lst) == 0: return [] # If t

2017-11-11 10:01:56 262

原创 冒泡排序:python

# -*- coding: utf_8 -*-print(__doc__)dic = {}with open('G:/py_proj/test/flask.txt') as f: for char in f.read().replace(' ',''): if char in dic: dic[char] += 1 els

2017-11-01 09:46:21 355

原创 Shannon 信息熵:python_code

信息熵代码来源于《机器学习》 from math import logimport numpy as npdef calcShannonEnt(dataset): numEntries =len(dataset) labelCounts = {} for favocter in dataset: setkeys = favocter[-1]

2017-11-01 09:34:20 644

转载 Rstudio 链接github

参考文件:http://www.molecularecologist.com/2013/11/using-github-with-r-and-rstudio/

2017-10-25 17:30:22 992

转载 centos7 添加用户授予权限

参考文献:http://blog.sina.com.cn/s/blog_e0b6f5bd0102ximm.html

2017-10-25 09:52:51 1150

原创 机器学习_聚类分析_K-mens

机器学习_聚类分析_K-mensK-means聚类的方法也叫K均值聚类,聚类的方法有许多中,其中K-mens可能是最常用到的方法。算法的优缺点算法的核心思想算法的实现1 算法的优缺点 优点 缺点 使用简单 因为它使用了一个随机的元素,所以它不能保证找到最佳的类 无 需要一个合理初始化要聚类的个数:即要初始化K .. 对极值敏感2.算法的核心思想物以类聚、人以群分

2017-10-17 22:52:03 1827

转载 R语言树模型

参考资料:https://max.book118.com/html/2017/0731/125536057.shtm

2017-09-25 15:06:51 507

原创 centos7安装R

Centos7下安装R的方法总结在Centos下安装R的时候,遇到了许多问题,进过多次的安装,卸载,再安装的过程。对Centos下安装R进行了总结;方法主要主要有两类:方法(1)推荐方法:采用epel-realse源安装R语言, 类似于ubuntu下的sudo apt-get install r-base,步骤1:yum install -y epel-release步骤2

2017-07-15 13:34:29 642

模拟退火算法

多参数模拟退火算法

2018-04-23

空空如也

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

TA关注的人

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