之前一直用weka的GUI界面做机器学习的任务, 感觉这个软件虽然界面丑, 不过确实是快速开展机器学期的利器. 关于GUI的weka使用以后有时间再写. 今天这篇记录一下最近使用的java版本的weka.

1. Include jars into project

weka官网的下载链接里选择linux版本的weka压缩包即可, 下载以后找到weka.jar文件, 在工程里将其include一下就可以使用了(btw, 现在开始放弃eclipse, 进入IDEA的怀抱了...).

weka的文档在解压缩的文件里有, 另外在线文档在: http://weka.sourceforge.net/doc.stable-3-8/

about libsvm...

关于libsvm需要有一点特别指出. weka自带的算法里是不包含libsvm的 (有个类似的SMO, 不过还是libsvm久经考验啊...), 需要使用weka的package manager安装. 打开package manager是在weka主界面的菜单里:

在package manager里搜索到libsvm安装即可. 然后(linux下)在主目录可以看到有个wekafiles文件夹, wekafiles/packages/LibSVM/目录下就是libsvm的内容.

需要指出的一点是, 要使用libsvm的话, 需要同时引用两个jar文件, 而且都叫libsvm.jar!!

这两个jar ...

1. Introduction to Intractability

recall model of computation: DFA
a univeral model of computation: turing machine
→ no more powerful model of computation.
Turing machine can compute any function that can be computed by a physically harnessable process of the natural world.

bottom line: turing machine is a simple and universal ...

simplex algo: top 10 algo of the 20th century (ever?).

what is linear programming:
a general problem-solving model that works for:
shortest-path, maxflow, MST, matching, assignment, ...

1. Brewer-'s Problem

toy example: choose products to maximize profit.
...
feasible region: a convex polygon.

⇒ optimum solution appears at an extreme point.

standard ...

http://www.imooc.com/learn/317

模块和包

: 文件夹 (可以有多级), 且包含__init__.py文件(每层都要有) 模块: py文件

代码分开放在多个py文件(模块名=文件名). 同名变量互不影响.

模块名冲突: 把同名模块放在不同中.

导入模块

from math import log
from logging import log as logger

引用时: 使用完整的路径(包+模块名). ex. p1.util.f()

动态导入模块

try:
    from cStringIO import ...

Goal: classify problems according to computational requirements.
bad new: for huge number of pbs we don't know...

1. Introduction to Reductions

shifing gears:

  • from individual problems to problem-solving models.
  • from linear/quard to polynomial/exponential pbs
  • from implementation details to conceptual framwork

suppose we could (not) solve pb X ...

http://www.imooc.com/learn/317

函数式编程: 更抽象, 更脱离指令(计算机), 更贴近计算(数学).

  • 不需要变量 (python允许有变量, 所以python非纯函数式)
  • 高阶函数
  • 闭包: 返回函数
  • 匿名函数

高阶函数

  • 变量可以指向函数 f=abs; f(-10)
  • 函数名: 就是指向函数的变量 abs=len
  • 高阶函数: 接收函数作为参数的函数

    def add(x,y,f):
    return f(x)+f(y)
    add(-5, 9, abs)

map()

map()是 Python 内置的高阶函数 ...

总结了一下C++ STL里面用的比较频繁的一些代码片段. (地址: https://github.com/X-Wei/cpp-demo-snippets/tree/master/STL)
cpp文档: http://en.cppreference.com/w/cpp

常用的library主要有:
<algorithm>, <vector>, <queue>, <set>, <map>, <cmath>

另外一个常见的cpp文件开头版本是:

#include <iostream>  
#include <vector>  
#include <algorithm>  
using namespace std;  
#define forloop(i,lo,hi) for(int i = (lo); i <= (hi); i++)  
#define rep(i ...

1. Introduction to Data Compression

pb: reduce the size of a file, to save space/time for storing/transmitting.
applications: generic file compression(gzip), multimedia (mp3), communication(skype).

From binary data B, ⇒ generate a compressed representation C(B).

lossless compression: get exactly B from C(B)
compression ratio: |C(B ...


I. 工作

学业

三月初结束了在X的最后几门考试, X的课从来都不简单, 但我真的很享受, 尤其是那些数学课.
(不过刚考完就sb了: 陪伴我两年的杯子丢了...)

Polytechnique, 从憧憬变成回忆. X的各种经历, 三天三夜也说不完.

然后九月来到ETH, 课程很有意思, project比较多. 第一个学期说实话有点应付, 所以现在要好好复习备考...orz

实习

在MEC实习了五个月, 这里的工作环境真是宽松. 一宽松我有点担心没有什么进步, 不过后来看这一段时间我的进步还是很大的.
实习期间做的是音乐分类工作, 实践了一些NLP的流程, 试用了不少算法, 以及读了一些paper...

有幸和神童Aranud(X11 major)一起工作, 感叹智商不够, 只能努力来凑.

然后顺利通过了实习的答辩, 算是给X的三年划上了圆满的句号 — 到2017年remise再见了!

面试

这是最后三个月的主旋律, 今年算起来经历了好多面试:

  • AL: 三轮电面, 深感ML方面的知识不够扎实, 不过居然过了, 看来他们真的很缺人...
  • GG: 在充分的准备之后经历了两轮电面五轮现场, 拿下dream offer, 感觉很幸运 ...

1. Regular Expressions

pb: pattern matching.

regular expression

Is a notation to specify a set of strings.
basic operations:

  • concatenation
  • or
  • closure: "0 or more appearances of chars"
  • parentheses


additional operations (added for convinence):

ex. [A-C]+ is equivalent to (A|B|C)(A|B|C)*.

吐槽名句:

2. REs and NFAs ...