- 博客(164)
- 收藏
- 关注
原创 关于用postman测试上传文件出现500错误The current request is not a multipart request的讨论
Controller中的代码是这样的: @RequestMapping(path={"/upload_image/"},method={RequestMethod.POST}) @ResponseBody public String uploadImage(@RequestParam("file") MultipartFile file)后面是方法主体。测试时使...
2020-03-08 16:56:29 3446
原创 LeetCode in Java [15]*: 102. Binary Tree Level Order Traversal 二叉树层次遍历
102.Binary Tree Level Order TraversalMedium215858Add to ListShareGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For exam...
2020-01-21 16:18:51 155
原创 LeetCode in Java [14]*: 98. Validate Binary Search Tree 检查是否是二叉搜索树
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keysless thanthe node's key. ...
2020-01-20 19:45:14 165
原创 LeetCode in Java [12]*: 91. Decode Ways
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given anon-emptystring containing only digits, determine ...
2020-01-08 14:02:25 101
原创 LeetCode in Java [11]: 90. Subsets II
Given a collection of integers that might contain duplicates,nums, return all possible subsets (the power set).Note:The solution set must not contain duplicate subsets.Example:Input: [1,2,2]...
2020-01-07 18:52:16 172
原创 LeetCode in Java [10]: 86. Partition List
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the original relative order of the nodes in each of ...
2020-01-07 18:17:19 100
原创 LeetCode in Java [9]: 74. Search a 2D Matrix
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from left to right. The first integer of each ro...
2019-12-20 18:19:13 77
原创 LeetCode in Java [8]: 73. Set Matrix Zeroes*
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do itin-place.Example 1:Input: [ [1,1,1], [1,0,1], [1,1,1]]Output: [ [1,0,1], [0,0,0], [1,0,1]]...
2019-12-17 20:24:09 93
原创 LeetCode in Java [7]: 64. Minimum Path Sum
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:You can only move either down or right at ...
2019-12-17 19:56:49 111 1
原创 LeetCode in Java [6]: 63. Unique Paths II
A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the b...
2019-12-17 19:45:01 89
原创 LeetCode in Java [5]: 62. Unique Paths
A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the b...
2019-12-17 19:34:21 87
原创 LeetCode in Java [4]: 61. Rotate List
Example 1:Input: 1->2->3->4->5->NULL, k = 2Output: 4->5->1->2->3->NULLExplanation:rotate 1 steps to the right: 5->1->2->3->4->NULLrotate 2 steps to...
2019-12-17 19:07:57 67
原创 LeetCode in Java [3]: 60. Permutation Sequence
The set[1,2,3,...,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order, we get the following sequence forn= 3:"123" "132" "213" "231" "312...
2019-12-17 18:41:48 96
原创 LeetCode in Java [2]: 59. Spiral Matrix II
Given a positive integern, generate a square matrix filled with elements from 1 ton2in spiral order.Example:Input: 3Output:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ]]设置上下左右四个限制器就行,结束标志是...
2019-12-16 19:47:25 72
原创 LeetCode in java [1]: 56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlap...
2019-12-16 19:29:14 82
原创 从零开始的LC刷题(134): Spiral Matrix
原题;Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.Example 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output: [1,2,3,6,9,8,7,...
2019-11-15 20:16:30 88
原创 从零开始的LC刷题(133): Pow(x, n)
原题:Implementpow(x,n), which calculatesxraised to the powern(xn).Example 1:Input: 2.00000, 10Output: 1024.00000Example 2:Input: 2.10000, 3Output: 9.26100Example 3:Input: 2.0...
2019-11-15 19:37:35 138
原创 【机器学习】讨论SGD,BGD和牛顿法在逻辑回归中的效果
因为随机梯度下降,批梯度下降和牛顿法都可以用在线性回归中,所以想比较一下三者的效果。原理:SGD,BGD:https://blog.csdn.net/cyr429/article/details/102300105牛顿法:https://blog.csdn.net/cyr429/article/details/102624860先放出来原数据的散点图:需要原数据的:http...
2019-11-15 19:14:14 310
原创 【CS229机器学习】 Lecture7:最优裕度分类器(最优间隔分类器),拉格朗日对偶,KKT条件,SVM支持向量机
接上次:https://blog.csdn.net/cyr429/article/details/1030082034. 最优裕度分类器-上给出一组训练集,基于之前的讨论我们很自然的会去找一个决策边界线使得几何裕度最大,因为这样的决策线体现了我们对于分类的信心很强同时也是原数据很好的拟合。这样做的结果是一个用沟壑把正样本和负样本分开的分类器。目前我们先假设数据是线性可分的,也就是数据一...
2019-11-15 18:02:51 454
原创 从零开始的LC刷题(132): Rotate Image
原题:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the imagein-place, which means you have to modify the input 2D ma...
2019-11-11 19:03:44 125
原创 【CS229机器学习】 Lecture6:多项事件模型与文本分类,关于SVM的函数裕度与几何裕度
接上次:https://blog.csdn.net/cyr429/article/details/1028730312.3 多项事件模型与文本分类之前讨论了将朴素贝叶斯运用于多元伯努利分布来实现文本分类的问题,但是这个模型有个问题就是不会统计某个词在一封邮件中出现的次数,所以我们考虑另一种模型。首先改变的是表示一封邮件的方式,之前我们用0011000...这样的布尔向量表达一封邮件,序...
2019-11-11 16:17:18 354
原创 从零开始的LC刷题(131): Permutations II
原题:Given a collection of numbers that might contain duplicates, return all possible unique permutations.Example:Input: [1,1,2]Output:[ [1,1,2], [1,2,1], [2,1,1]]给出有重复数字的数列的全排列,在上一题...
2019-11-08 20:06:24 102
原创 从零开始的LC刷题(130): Permutations
原题:Given a collection ofdistinctintegers, return all possible permutations.Example:Input: [1,2,3]Output:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]求出给出数列的全排列,递归...
2019-11-08 19:34:48 107
原创 从零开始的LC刷题(129): Multiply Strings
原题:Given two non-negative integersnum1andnum2represented as strings, return the product ofnum1andnum2, also represented as a string.Example 1:Input: num1 = "2", num2 = "3"Output: "6"...
2019-11-08 18:49:11 129
原创 从零开始的LC刷题(128): Combination Sum II
原题:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations incandidateswhere the candidate numbers sums totarget.Each number incandidat...
2019-11-07 19:18:59 104
原创 从零开始的LC刷题(127): Combination Sum
原题:Given asetof candidate numbers (candidates)(without duplicates)and a target number (target), find all unique combinations incandidateswhere the candidate numbers sums totarget.Thesame...
2019-11-07 19:01:56 191
原创 【CS229机器学习】 Lecture5:生成学习算法,生成模型,高斯判别分析模型,多元高斯分布,朴素贝叶斯,拉普拉斯平滑
接上次:https://blog.csdn.net/cyr429/article/details/102624860Part4:生成算法模型至今给出的算法都是求在theta为参数条件下给出x的y的概率,比如逻辑回归和线性回归,现在要讨论一种不太一样的算法。假设有一个分类问题要我们基于一些特征区别大象(y=1)和狗(y=0)。如果有一系列的训练集,逻辑回归或者感知机算法会试图找出一个分界...
2019-11-07 14:58:01 341
原创 【CS229机器学习】作业 Problem Set #1 有监督学习
本次的作业包含了逻辑回归,指数族函数,高斯判别分析和weighted linear regression的考察,并且有两个数据集供分析。作业原题链接:https://github.com/cyr429/Machine-Learning-master/blob/master/CS229/ps1/ps1.pdf数据集链接:https://github.com/cyr429/Machine-Le...
2019-11-07 12:32:25 3401 4
原创 从零开始的LC刷题(126): Valid Sudoku
原题:Determine if a9x9 Sudoku boardis valid.Only the filled cells need to be validatedaccording to the following rules:Each rowmust contain thedigits1-9without repetition. Each column must...
2019-10-31 18:00:34 97
原创 从零开始的LC刷题(125): Find First and Last Position of Element in Sorted Array
原题:Given an array of integersnumssorted in ascending order, find the starting and ending position of a giventargetvalue.Your algorithm's runtime complexity must be in the order ofO(logn).I...
2019-10-31 15:31:23 85
原创 从零开始的LC刷题(124): Search in Rotated Sorted Array 位移后的已排序数列中的二分查找
原题:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e.,[0,1,2,4,5,6,7]might become[4,5,6,7,0,1,2]).You are given a target value to search. If ...
2019-10-31 14:42:29 109
原创 从零开始的LC刷题(123): Next Permutation
原题:Implementnext permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest poss...
2019-10-30 19:44:10 102
原创 【机器学习】实战逻辑回归模型
今天大概看了一下还没做的ps1,里面第一个道题的数据集正好可以拿来做一次逻辑回归的实战,正好学到现在还没正儿八经写过代码,所以打算拿这个练练手,具体数据集我新建了一个GitHub账号给大家分享,里面也有详细的代码和一些思路:https://github.com/cyr429/Machine-Learning-master/tree/master/ML-others/LogisticRegres...
2019-10-30 12:12:26 215
原创 从零开始的LC刷题(122): Swap Nodes in Pairs
原题;Given alinked list, swap every two adjacent nodes and return its head.You maynotmodify the values in the list's nodes, only nodes itself may be changed.Example:Given 1->2->3-&...
2019-10-28 19:33:12 91
原创 从零开始的LC刷题(121): Generate Parentheses
原题:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:[ "((()))", "(()())", "(())()", "(...
2019-10-28 19:15:33 146
原创 从零开始的LC刷题(120): Remove Nth Node From End of List 移除链表中倒数第n个元素
原题:Given a linked list, remove then-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the ...
2019-10-28 18:13:35 140 1
原创 【CS229机器学习】 Lecture4:牛顿法,广义线性模型,指数族分布,Softmax回归
接上次:https://blog.csdn.net/cyr429/article/details/102458430最近开组会耽误了一些进度。6.题外话:感知机算法这一部分在公开的课程视频中并没有讲到,我只能按我的理解来说了。如果我们强迫逻辑回归的输出为0或1,会“自然而然”地使用阈值函数代替原来的g(z):如果我们再结合前面使用过的,我们会得到一个新的参数更新规则:...
2019-10-24 15:35:08 376
原创 从零开始的LC刷题(119): Letter Combinations of a Phone Number
原题:Given a string containing digits from2-9inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) ...
2019-10-16 19:10:30 207
原创 从零开始的LC刷题(118): 3Sum Closest
原题:Given an arraynumsofnintegers and an integertarget, find three integers innumssuch that the sum is closest totarget. Return the sum of the three integers. You may assume that each input ...
2019-10-16 19:01:22 80
原创 从零开始的LC刷题(117)*: 3Sum
原题:Given an arraynumsofnintegers, are there elementsa,b,cinnumssuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must no...
2019-10-15 19:39:33 162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人