
算法
文章平均质量分 66
wx_cookie
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
递归算法介绍和使用
递归算法介绍和使用原创 2017-07-07 15:55:50 · 654 阅读 · 0 评论 -
[LeetCode]448. Find All Numbers Disappeared in an Array
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this array.原创 2017-08-09 15:35:21 · 248 阅读 · 0 评论 -
[LeetCode]442. Find All Duplicates in an Array
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could you do it without ex原创 2017-08-09 16:00:30 · 292 阅读 · 0 评论 -
[LeetCode]41. First Missing Positive
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant原创 2017-08-09 17:54:40 · 210 阅读 · 0 评论 -
机器学习-神经网络简单Demo
本文通过编写神经网络对鸢尾花数据进行训练和分类。通过搜集鸢尾花的数据,并将数据可视化,可以发现通过鸢尾花的花瓣长度和花径长度可以将鸢尾花的品种进行区分。 1.数据样本可视化处理 使用如下代码将数据可视化: file = "~/Desktop/Iris.csv" import pandas as pd df = pd.read_csv(file, header=None) df.head(10原创 2017-07-28 10:40:54 · 903 阅读 · 0 评论 -
K-Means++
k-means++算法选择初始seeds的基本思想就是:初始的聚类中心之间的相互距离要尽可能的远。 算法步骤如下 1.从输入的数据点集合中随机选择一个点作为第一个聚类中心 2.对于数据集中的每一个点x,计算它与聚类中心(指已选择的聚类中心)的距离D(x),并将D(x)求和。 3.选择一个新的数据点作为新的聚类中心,选择的原则是:D(x)较大的点,被选取作为聚类中心的概率较大 4.重复原创 2017-09-04 11:51:16 · 378 阅读 · 0 评论