次序 | 简要步骤 | 具体步骤 | 作用 |
---|---|---|---|
1 | 收集 | 信息收集 | 根据确定的数据分析对象,抽象出在数据分析中所需要的特征信息,然后选择合适的信息收集方法, 将收集到的信息存入数据库。对于海量数据,选择一个合适的数据存储和管理的数据仓库是至关重要的。 |
2 | 收集 | 数据集成 | 把不同来源、格式、特点性质的数据在逻辑上或物理上有机地集中,从而为企业提供全面的数据共享。 |
3 | 预处理 | 数据规约 | 数据规约技术可以用来得到数据集的规约表 示,它小得多,但仍然接近于保持原数据的完整性,并且规约后执行数据挖掘结果与规约前执行结果相同或几乎相同。 |
4 | 预处理 | 数据清理 | 在数据库中的数据有一些是不完整的 (有些感兴趣的属性缺少属性值)、含噪声的(包含错误的属性值),并且是不一致的(同样的信息不同的表示方式),因此需要进行数据清理,将完整、正确、一致的数据信息存入数据仓库中。 |
5 | 预处理 | 数据变换 | 通过平滑聚集、数据概化、规范化等 方式将数据转换成适用于数据挖掘的形式。对于有些实数型数据,通过概念分层和数据的离散化来转换数据也是重要的一步 |
6 | 挖掘 | 挖掘过程 | 根据数据仓库中的数据信息,选择合适的分析工具,应用统计方法、事例推理、决策树、规则推理、模糊集,甚至神经网络、遗传算法的方法处理信息,得出有用的分析信息。 |
7 | 挖掘 | 模式评估 | 从商业角度,由行业专家来验证数据挖掘结果的正确性。 |
8 | 挖掘 | 知识表示 | 将数据挖掘所得到的分析信息以可视化的方式呈现给用户,或作为新的知识存放在知识库中,供其他应用程序使用。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
# | |
# 脚本名: NumberGuess.rb | |
# 版本号: 1.0 | |
# 作者: Yan | |
# 日期: June 2013 | |
# | |
# 描述: 一个猜数字的游戏,尽快猜中Ta | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
# | |
# 脚本名: WordGuess.rb | |
# 版本号: 1.0 | |
# 作者: Yan | |
# 日期: June 2013 | |
# | |
# 描述: 一个猜单词的游戏,尽快猜中Ta | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'nokogiri' # Nokogiri 是 Ruby 上的一個 HTML, XML, SAX 的 parser | |
class ColorPalette | |
@@site_name # 类变量 | |
def initialize(url) # 构造函数 | |
url = check_url(url) | |
@@site_name = URI.parse(url).host # 从url中取得网址 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# MVC(Model - View - Control)框架实例之秒表设计 | |
require 'observer' # 使用观察者模式 | |
# 模型(Model),时间计算 | |
class WatchModel | |
include Observable # 继承Observable接口,使WatchModel成为Observer模式中的观察对象 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# 同步调用、异步调用、回调 | |
# 实例:老大 和 手下,电话联系 | |
class Boss | |
def initialize | |
@phone = 85268744150 | |
@workerA = Worker.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
require_relative '../lib/game' # 用 require_relative 加载本地文件,省略后缀 | |
class MyTest < Test::Unit::TestCase # 三个测试用例 | |
def test_room() | |
gold = Room.new("GoldRoom", """This room has gold in it you can grab. There's a door to the north.""") | |
assert_equal(gold.name, "GoldRoom") # 断言 | |
assert_equal(gold.paths, {}) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--> started at 2013-06-27 19:14:48 +0800 | |
counter1 : 367240 | |
counter2 : 367240 | |
difference : 0 | |
--> end at 2013-06-27 19:14:49 +0800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
rake 会在当前目录下寻找Rakefile/rakefile/Rakefile.rb/rakefile.rb等rake文件 | |
* rake --tasks: 列出所有任务 | |
* rake [TASK_NAME]:执行特定任务 | |
--- --- | |
Rails中的rake任务: | |
存在于rails目录的lib/tasks目录下,以.rake作为后缀名 | |
=end | |
task :default => [:today] # 默认的任务,rake即可调用 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
中文: Hiragino Sans GB, 很常用,即冬青黑体简体 | |
英文: 从Google Fonts找 | |
代码: Source Code Pro, Adobe的开源字体,编程必备 |
OlderNewer