自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 Logistic回归的基本思想与公式推导

讲前小碎话Logistic回归是一种线性分类模型,通常用来解决线性二分类或多分类问题。无论是在李航老师的《统计学习方法》书中,还是在吴恩达老师的机器学习课程中,都是先假设随机变量x服从Logistic分布,即有如下的分布函数和概率密度函数:可是为什么定义这样的分布函数和概率密度函数,对于初学者来说,还是很难理解的。我们从Logistic回归的来源(也就是从贝叶斯学习发展来的)来理解...

2018-11-25 21:52:08 14493 1

原创 Deep Learning花书学习笔记-------第3章 概率与信息论

第3章 概率与信息论3.1 为什么使用概率频率派概率:概率直接与事件发生的频率相联系,如果一个事件发生的概率为p,p是可以通过反复试验由频率确定的。此时的概率p可以理解为一个参数可以通过试验确定。频率派进行推断时,依赖于数据的分布,以及试验观察获得的结果,通过似然函数进行推断。对于似然函数p(x|w),频率派认为w是一个确定的参数,通过极大似然估计法确定w。 贝叶斯概率:概率用来表示一种...

2019-03-13 00:00:28 323

原创 找出数组中的重复数字--解题总结

题目数组长度为n + 1,数组中的数大小均在1~n的范围内,则数组中至少会存在一个重复数字。要求找出其中一个重复数组。例如,如果输入长度为7的数组{2,3,1,0,2,5,3},那么对应的输出重复的数字是2或者3,输出其中一个即可。思路1:可直接将数组排序,遍历数组,找到其中一个重复数字即可。时间复杂度是O(nlogn)。def findDuplicates(nums): i...

2019-03-11 22:45:59 1978

原创 Deep Learning花书学习笔记-------第2章 线性代数

第2章 线性代数2.1 标量、向量、矩阵和张量标量(scalar):标量是单独的数,只有大小没有方向。 向量(vector):向量是既有大小又有方向的量,它可以形象化地表示为带箭头的线段。一个向量是一个数列(有序排列的数)。可以把向量看作空间中的点,每个元素是不同坐标轴上的坐标。 矩阵(matrix):矩阵是一个二维数组。 张量(tensor):坐标超过两维的数组。数组元素分布在多...

2019-03-11 00:31:55 354

原创 LeetCode572. Subtree of Another Tree

题目描述:Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of th...

2019-02-19 16:04:35 146

原创 LeetCode438. Find All Anagrams in a String

题目描述:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowercase English letters only and the length of both strings s and p will not b...

2019-02-19 15:05:40 79

原创 LeetCode437. Path Sum III

题目描述:You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but...

2019-02-19 11:30:44 125

原创 LeetCode101. Symmetric Tree

题目描述:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 ...

2019-02-19 09:53:16 92

原创 LeetCode896. Monotonic Array ---Python三种思路

题目描述:An array is monotonic if it is either monotone increasing or monotone decreasing.An array A is monotone increasing if for all i <= j, A[i] <= A[j].  An array A is monotone decreasing if...

2019-01-29 22:54:23 193

原创 LeetCode763. Partition Labels

题目描述:A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers represen...

2018-11-26 16:14:13 243

原创 LeetCode921. Minimum Add to Make Parentheses Valid

题目描述:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting parentheses string is valid.Formally, a parent...

2018-11-26 11:52:31 93

原创 LeetCode122. Best Time to Buy and Sell Stock II

题目描述:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e.,...

2018-11-25 22:21:57 96

原创 LeetCode860. Lemonade Change

题目描述:At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills).Each customer will only buy one lem...

2018-11-23 18:27:25 109

原创 LeetCode455. Assign Cookies

题目描述:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size o...

2018-11-23 17:05:23 91

原创 LeetCode605. Can Place Flowers

class Solution: """ :type flowerbed: List[int] :type n: int :rtype: bool """ def canPlaceFlowers(self, flowerbed, n): i = sum = 0 if n == 0: return ...

2018-04-25 13:20:15 159

原创 LeetCode169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element always...

2018-04-11 12:07:16 108

原创 LeetCode 561. Array Partition I

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as poss...

2018-04-09 19:14:38 150 1

空空如也

空空如也

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

TA关注的人

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