How to tune hyperparameters with Python and scikit-learn
In last week’s post, I introduced the k-NN machine learning algorithm which we then applied to the task of image classification. Using the k-NN algorithm, we obtained 57.58% classification accuracy on...
View ArticleAcademic Technical Debt
Technical debt is "a concept in programming that reflects the extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall...
View ArticleA Shiny App for Passing Bablok and Deming Regression
Background Back in 2011 I was not aware of any tool in R for Passing Bablok (PB) regression, a form of robust regression described in a series of three papers in Clinical Chemistry and Laboratory...
View ArticleAdventures with minimongo
Too many choices! https://flic.kr/p/5zVmy5 Over the last few years I have wound up using mongo as my data store on several projects. In fact, it has been a while since I have written any SQL! For my...
View ArticleAnalyzing Data
My first Web-related job was in 1995, developing Web applications for a number of properties at Time Warner. When I first started there, we had a handful of programmers and managers handling all of the...
View ArticleCaktus Consulting Group: Python Nordeste 2016 Recap
Image via @pythonnordeste #pyselfie I don’t know anyone there. I don’t know the language. What about this Zika virus? What about this political unrest? These were some of the doubts and fears racing...
View Articlepython 操作消息队列
图示 其中P指producer,即生产者;C指consumer,即消费者。中间的红色表示消息队列,实例中表现为HELLO队列。 往队列里插入数据前,查看消息队列 $sudo rabbitmqctl list_queuesListing queues ...celeryev.db53a5e0-1e6a-4f06-a9f7-2c104c4612fb 0...done. 插入消息队列代码...
View ArticleJetBrains IDE Remote Code Execution and Local File Disclosure
TL;DR From at least 2013 until May 2016 JetBrains’ IDEs were vulnerable to local file leakage, with the windows versions additionally being vulnerable to remote code execution. The only prerequisite...
View ArticlePython Read/Write CSV Files
In this tutorial, we are going to show how to work with CSV files in python . CSV (Comma Separated Values) format is a very popular import and export format used in spreadsheets and databases. Python...
View ArticlePYTHON3连接MYSQL数据库
http://smilejay.com/2013/03/python3-mysql-connector/ Python 2.x 上连接MySQL的库倒是不少的,其中比较著名就是MySQLdb(Django项目都使用它;我也在开发测试系统时也使用过),见: http://sourceforge.net/projects/mysql-python/...
View ArticleCalculating CNTK Model Accuracy with a Python Script
I’ve been exploring the cool new CNTK (Computational Network Tool Kit) program. It was designed to do deep neural networks but the tool can also do logistic regression classification. I did a couple of...
View ArticleNew & Upcoming Course Highlights: Django, ES2015, PHP, C# & Rails ...
Every week, new courses are published to the growing TreehouseLibrary! Here is a short list of what we’ve addedrecently, as well as a few highlights from ourContent Roadmap. Start learning to code...
View ArticleGit 项目推荐 | Scrapy 分布式调度插件
============ Scrapy-Redis ============ .. image:: https://readthedocs.org/projects/scrapy-redis/badge/?version=latest :target: https://readthedocs.org/projects/scrapy-redis/?badge=latest :alt:...
View Article如何系统地自学 Python?
如何系统地自学 python? 48分钟前来源:36大数据 php?url=0EBtGnPLcS" alt="如何系统地自学 Python?" />是否非常想学好 Python,一方面被琐事纠缠,一直没能动手,另一方面,担心学习成本太高,心里默默敲着退堂鼓? 幸运的是,Python 是一门初学者友好的编程语言,想要完全掌握它,你不必花上太多的时间和精力。 Python...
View ArticleNumpy 笔记(一): 多维数组的创建
25 Feb 2016 目录 Numpy 及 ndarray 简介 创建特定形状的多维数组并进行填充 从 numerical range 创建多维数组 Numpy 及 ndarray 简介 Numpy 是一个 python 的科学计算包,提供了以下功能: 强大、灵活的多维数组对象及丰富的操作 C 实现,执行效率高 线性代数、丰富的随机数功能 ndarray 就是 Numpy...
View ArticleNumpy 笔记(二): 多维数组的切片(slicing)和索引
Numpy 中多维数组的切片操作与 python 中 list 的切片操作一样,同样由 start, stop, step 三个部分组成 import numpy as np arr = np.arange(12) print 'array is:', arr slice_one = arr[:4] print 'slice begins at 0 and ends at 4 is:',...
View Article文本相似度量方法(2): LCS 和编辑距离
LCS 是一个比较经典的算法问题,了解动态规划的读者应该对它不会陌生。 要求解 LCS,朴素的想法是将 A 的所有子序列都枚举一遍,看是否是 B 的子序列,然后从中挑选出最长的。对给定字符串 A ,假定其长度为 \(L\),其所有可能的子序列数量为 \(\sum_{i=1}^{L}\binom{L}{i}\) 也就是 \(2^{L} - 1\)...
View ArticlePython: 捕获异常然后再抛出另一个异常的正确姿势
一般大家实现捕获异常然后再抛出另一个异常的方法是下面这样的: def div(): 2 / 0 try: div() except ZeroDivisionError as e: raise ValueError(e) 不知道大家有没有注意到这样抛出异常的方式有一个很严重的问题,那就是 在重新抛出另一个异常的时候,捕获的上一个异常的 traceback 信息丢失了(python2): $ cat...
View ArticleAnsible and Ubuntu 16.04 Xenial - Get Python 2.7
Quick post on getting Ansible working with an Ubuntu 16.04/Xenial server. I have a bunch of nodes running in Amazon Web Services (AWS) and I need to put them under configuration management. This is a...
View Article__getattr__与__getattribute__
定义区别: __getattr__(self, item)获取 实例 的属性时,仅当实例属性中不包括item时,才被调用。这个方法应该返回相应的属性值或者抛出 AttributeError 异常 __getattribute__(self, item)获取 实例 属性时,无条件调用该方法,不论实例属性中是否包括item 应用实例 1. 利用 __getattr__...
View Article