假设(基于二维) 训练集 $$ \begin{bmatrix} 1&x_{11}&{\cdots}&x_{1n}\\ 1&x_{21}&{\cdots}&x_{2n}\\ {\vdots}&{\vdots}&{\ddots}&{\vdots}\\ 1&x_{m1}&{\cdots}&x_{mn}\\ ...
分类:
编程语言 时间:
2019-12-10 22:18:40
阅读次数:
126
过拟合问题 导致结果不正确。 解决办法 使$\theta$的取值尽量小,已达到曲线平滑。 但当$\theta$取值过小会导致 欠拟合 改变代价函数 线性回归: $$J(\theta)=\frac{1}{2m}(\sum_{i=1}^{m}({h_\theta(x^i) y(x^i)})^2+\lam ...
分类:
其他好文 时间:
2019-12-10 22:13:33
阅读次数:
106
###第一周:R基础 rm(list = ls()) #ctr+L###矩阵相乘,函数diag()a=matrix(1:12,nrow=3,ncol=4)b=matrix(1:12,nrow=4,ncol=3)a%*%ba=matrix(1:16,nrow=4,ncol=4)diag(a)#返回对角 ...
分类:
编程语言 时间:
2019-12-10 15:01:10
阅读次数:
103
Medium Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corne ...
分类:
其他好文 时间:
2019-12-10 13:31:21
阅读次数:
84
原题链接在这里:https://leetcode.com/problems/diagonal-traverse/ 题目: Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix i ...
分类:
其他好文 时间:
2019-12-10 13:02:21
阅读次数:
98
Problem Statement Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, ...
分类:
其他好文 时间:
2019-12-10 12:49:52
阅读次数:
109
给定一个 n × n 的二维矩阵表示一个图像。 将图像顺时针旋转 90 度。 说明: 你必须在原地旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要使用另一个矩阵来旋 转图像。 示例 1: 给定 matrix = [ [1,2,3], [4,5,6], [7,8,9] ], 原地旋转输入矩阵,使 ...
分类:
其他好文 时间:
2019-12-09 11:45:41
阅读次数:
118
#include "opencv2/core.hpp" #include "opencv2/highgui.hpp" #include "opencv2/videoio.hpp" #include "opencv2/imgproc.hpp" #include "iostream" #include ...
分类:
其他好文 时间:
2019-12-08 23:28:05
阅读次数:
127
最后习题 答案 $$ \begin{equation} \nonumber V = \left[ \begin{matrix} 2 & 2 \\ 1 + \sqrt{5} & 1 \sqrt{5} \\ \end{matrix} \right ], A = \left[ \begin{matrix} ...
分类:
其他好文 时间:
2019-12-08 17:29:39
阅读次数:
90
给一个矩阵mat,每个格子都是0或1,翻转一个格子会将该格子以及相邻的格子(有共同边)全部翻转(0变为1,1变为0) 求问最少需要翻转几次将所有格子全部置为0。 这题的重点是数据范围,比赛结束看了眼数据范围想把自己锤死= = m == mat.length n == mat[0].length 1 ...
分类:
其他好文 时间:
2019-12-08 15:55:36
阅读次数:
154