Publish to my blog (weekly)
-
- 선형 함수의 그래프는 직선
- 비선형은 곡선이며 각 섹션의 기울기는 다릅니다
- 선형 함수는 다음과 같습니다.
C = Ax + By - A / B는 선형 함수 그래프의 기울기
-
-
Mathematics for Artificial Intelligence – Linear Algebra
- linear algebra
- scalar, vector, matrix, and tensor
- every record in a dataset can be represented as a vector
- parameters of neural networks are abstracted as matrices
- one simple number
- Scalar
- They have lowercase italic names
- an ordered array of scalars
- Vector
- points in space
- vector space
- each element having an index
- lowercase bold names
- Matrix
- a two-dimensional array of scalars with an uppercase bold name
- added or subtracted
- only if they have the same number of rows and columns
- Matrices
- the number of the columns of the first matrix is equal to the number of the rows of the second one
- multiplied
- dot product
- distributive
- associative
- multiply matrices element-wise.
- Hadamard product and is denoted as A
∘ B - multiplied with a scalar element-wise
- a product of matrix and vector is a vector
- a multidimensional array of numbers
- Tensor
- matrices are also tensors with two dimensions.
- transpose operation
- 전치연산 (전치 행렬을 만드는 연산)
- transpose matrix
- 전치행렬
- a mirror image of the matrix across the main diagonal line
- Transpose matrix of the matrix A is denoted as
AT (alternatively: A′, Atr, tA or At). - identity matrix
- 단위행렬
- Identity matrix and its example
- Inverse matrix
- number*reciprocal number = 1
- Moore-Penrose pseudoinverse
- 무어 - 펜로스 의사 역행렬
- diagonal matrix
- 대각 행렬
- the diagonal matrix has values different than 1. We can say that the identity matrix is one type of diagonal matrix. These matrixes are exceptionally useful for some algorithms.
- map the matrix into a scalar
- determinant – det(A) or |A|
- Detrminant
- linear dependency
- https://ko.khanacademy.org/math/linear-algebra/vectors-and-spaces/linear-independence/v/linear-algebra-introduction-to-linear-independence벡터 x, y는 2차원 벡터인 경우 방향에 상관없이 하나의 직선상에 존재하는 좌표를 위미하며, 3차원 벡터인 경우 동일 2차원 평면상에 존재하는 좌표를 의미한다.
- the size of the vector
- functions that are called norms – Ln
- The most well-known norm is the norm in two-dimensional space – L2 norm or Euclidian norm.
- Norm
- the triangle inequality
- absolutely scalable
- positive definite
- L1 norm
- This function is simple and keeps the same growth rate in all points of a vector space
- Frobenius norm:
- Frobenius norm
-
-
[번역] 머신러닝 속 수학 · mingrammer's note
- 머신러닝에서 사용되는 최적화 방법들을 이해하기 위해 필요한 개념
- 머신러닝 알고리즘의 계산 효율성과 확장성을 이해하고 데이터셋의 희소성을 활용
-
-
What is the Difference Between Hadoop and Spark? | DIMENSIONLESS TECHNOLOGIES PVT.LTD.
- It does not have its own storage system like Hadoop has, so it requires a storage platform like HDFS.
- ‘Spark Context’.
- ‘driver program’
- Spark Context acts as a gateway for the execution of Spark application.
- distributes them to slave nodes called ‘Worker Nodes’.
- breaks a job into multiple tasks
- executors
- The cluster manager launches the executors. Then the driver sends the tasks to executors and monitors their end to end execution.
- If a node fails, the cluster manager will assign that task to another node, thus, making RDD’s fault tolerant
- immutable
- transformations
- actions
- computations
- send the result back to the driver
- dataset organized in named columns
- a table in a relational database.
- immutable
- a particular schema
- perform SQL like queries
- structured or semi-structured data
- a combination of RDD and dataframe
- can be manipulated using transformations
- can be created from JVM objects
- datasets are strongly typed
- structured and unstructured data
- fault recovery
- supports RDD
- task scheduling
- memory management
- distribution of jobs across worker nodes
- process data which streams in real time
- SQL queries
- machine learning algorithms
- data visualization in the form of the graph
- While in Spark, the data is stored in RAM which makes reading and writing data highly faster. Spark is 100 times faster than Hadoop.
- it will initially read from disk and save the output in RAM, so in the second job, the input is read from RAM and output stored in RAM and so on
- more suitable for batch processing
- predicting the consumer tastes
- identify patterns in data
- forecasting
- supply planning
- research
- calculating aggregates over a period of time
- real-time processing
- batch processing
- trending hashtags
- fraud detection
- digital marketing
- stock market analysis
- Spark programming framework is much simpler than MapReduce
- Hive, Pig, Sqoop, HBase which are very easy to use
- Those blocks have duplicate copies stored in other nodes with the default replication factor as 3. So, if a node goes down, the data can be retrieved from other nodes. This way, Hadoop achieves fault tolerance.
- vertices represent RDDs
- edges represents the operations to be applied on RDD
- So if a node fails, the task will be assigned to another node based on DAG. Since RDDs are immutable, so if any RDD partition is lost, it can be recomputed from the original dataset using lineage graph. This way Spark achieves fault tolerance.
- a more efficient way to achieve fault tolerance is by saving the state of spark application in reliable storage.
- his is called checkpointing
- Spark can recover the data from the checkpoint directory when a node crashes and continue the process.
- Spark can also integrate with other storage systems like S3 bucket.
- Spark only supports authentication via shared secret password authentication.
- Kerberos network authentication protocol
- Access Control Lists (ACLs) permissions.
- Spark has a popular machine learning library while Hadoop has ETL oriented tools
-
-
-
나이브 베이즈 분류 - 위키백과, 우리 모두의 백과사전
-
- 첫째, 일부의 확률 모델에서 나이브 베이즈 분류는 지도 학습 (Supervised Learning) 환경에서 매우 효율적으로 훈련 될 수 있다.
- 둘째, 분류에 필요한 파라미터를 추정하기 위한 트레이닝 데이터의 양이 매우 적다
- 셋째, 간단한 디자인과 단순한 가정에도 불구하고, 나이브 베이즈 분류는 많은 복잡한 실제 상황에서 잘 작동한다
-
- 는 특성값들이 주어진 경우 상수가 되는, 즉 에만 의존하는 스케일링 팩터
- 공통적인 규칙은 가장 가능성 높은 가설을 선택 하는 것이다. 이것은 사후 또는 MAP 결정 규칙의 최대치를 선택하는 것이다.
- 나이브 베이즈 분류는 이 확률 모델과 결정 규칙을 조합 한 것
- 나이브 베이즈 분류에서는 클래스 k, 즉 에 대해서 다음 식을 통해 최대 확률을 갖는 클래스 k를 찾아낸다
- 주어진 클래스 C에 대하여 문서 D가 속할 확률은 다음과 같다.
- "문서 D가 주어졌을 때, 클래스 C 에 속할 확률은 얼마인가?"
- 다시말해서, 를 구하고자 한다.
- "로그 우도 비(로그 가능 비)"라고 불리는 이 기술은 통계학 에서 일반적인 기술이다.
-
-
- 측도가 1인 측도 공간
- 확률 공간
-
-
-
- ㅗ: 모순, 항상 거짓.
-
-
- 시행에 대해서 일어날 수 있는 모든 경우의 수가 N가지이고, 어떤 사건이 일어나는 경우의 수가 K가지 일 때, 어떤 사건이 일어나는 확률이 인 것을 뜻하며, 선험적 확률 이라고도 한다.
- 따라서 실제로 같은 시행을 여러 번 반복하여 얻을 수 있는 횟수를 통해 나오는 확률이 통계적 확률(empirical probability)이다.
- "어떤 독립시행에서 사건 K가 일어날 횟수를 k라고 하고 시행 횟수를 n이라고 하면, 통계적 확률에 따른 확률 는 n이 한없이 커질 때 는 일정한 값 a에 가까워진다"
- 큰수의 법칙(law of large number)은 통계적 확률과 수학적 확률 사이의 관계를 나타내는 정리이며, 대수의 법칙이라고도 한다
-
-
- 주관주의 확률 이론의 관점으로 보면 지식의 상태는 개인적인 믿음의 정도(degree of belief)로 측정할 수 있다
- 객관적 관점에서 베이즈 통계의 법칙은 이성적 보편적으로 증명될 수 있으며 논리의 확장으로 설명될 수 있다
- 현대적 기계 학습 방법은 객관적 베이즈 원리에 따라 만들어졌다.
- 어떤 가설의 확률을 평가하기 위해서 사전 확률을 먼저 밝히고 새로운 관련 데이터에 의한 새로운 확률값을 변경한다
- <p>사후확률은 사전확률과 가능도의 곱에 비례한다.<br/></p><br/><dl><dd><span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle P(H|D)={\frac {P(D|H)\;P(H)}{P(D)}}}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>H</mi><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mo stretchy="false">|</mo><br/> </mrow><br/> <mi>D</mi><br/> <mo stretchy="false">)</mo><br/> <mo>=</mo><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mfrac><br/> <mrow><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>D</mi><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mo stretchy="false">|</mo><br/> </mrow><br/> <mi>H</mi><br/> <mo stretchy="false">)</mo><br/> <mspace width="thickmathspace"></mspace><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>H</mi><br/> <mo stretchy="false">)</mo><br/> </mrow><br/> <mrow><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>D</mi><br/> <mo stretchy="false">)</mo><br/> </mrow><br/> </mfrac><br/> </mrow><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle P(H|D)={\frac {P(D|H)\;P(H)}{P(D)}}}</annotation><br/> </semantics><br/></math></span><img alt="P(H|D)={\frac {P(D|H)\;P(H)}{P(D)}}" style="vertical-align: -2.671ex; width:26.577ex; height:6.509ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/eea20682301f4c614bff02e229a02f076561a272"></span></dd></dl><br/><p>여기서<br/></p><br/><ul><li><span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle H}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>H</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle H}</annotation><br/> </semantics><br/></math></span><img alt="H" style="vertical-align: -0.338ex; width:2.064ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/75a9edddcca2f782014371f75dca39d7e13a9c1b"></span>는 가설이다. <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle D}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>D</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle D}</annotation><br/> </semantics><br/></math></span><img alt="D" style="vertical-align: -0.338ex; width:1.924ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f34a0c600395e5d4345287e21fb26efd386990e6"></span>는 데이터이다.</li><br/><li><span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle P(H)}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>H</mi><br/> <mo stretchy="false">)</mo><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle P(H)}</annotation><br/> </semantics><br/></math></span><img alt="P(H)" style="vertical-align: -0.838ex; width:5.618ex; height:2.843ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bd7c4e1deccceac8c85d862b60dc64545d67b82e"></span> 는 <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle H}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>H</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle H}</annotation><br/> </semantics><br/></math></span><img alt="H" style="vertical-align: -0.338ex; width:2.064ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/75a9edddcca2f782014371f75dca39d7e13a9c1b"></span>의 <a rel="nofollow" href="/wiki/%EC%82%AC%EC%A0%84_%ED%99%95%EB%A5%A0" title="사전 확률">사전 확률</a>이다. <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle D}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>D</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle D}</annotation><br/> </semantics><br/></math></span><img alt="D" style="vertical-align: -0.338ex; width:1.924ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f34a0c600395e5d4345287e21fb26efd386990e6"></span>가 보이기 전까지(관측전)의 <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle H}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>H</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle H}</annotation><br/> </semantics><br/></math></span><img alt="H" style="vertical-align: -0.338ex; width:2.064ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/75a9edddcca2f782014371f75dca39d7e13a9c1b"></span>가 참일 확률이다.</li><br/><li><span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle P(D|H)}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>D</mi><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mo stretchy="false">|</mo><br/> </mrow><br/> <mi>H</mi><br/> <mo stretchy="false">)</mo><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle P(D|H)}</annotation><br/> </semantics><br/></math></span><img alt="P(D|H)" style="vertical-align: -0.838ex; width:8.189ex; height:2.843ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7f4e4eb99635077bd630ad6805d77f99ccc23a1f"></span>는 <a rel="nofollow" href="/wiki/%EA%B0%80%EB%8A%A5%EB%8F%84" title="가능도">가능도</a>(Likelihood)이다. <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle H}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>H</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle H}</annotation><br/> </semantics><br/></math></span><img alt="H" style="vertical-align: -0.338ex; width:2.064ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/75a9edddcca2f782014371f75dca39d7e13a9c1b"></span>가 참일 때, <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle D}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>D</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle D}</annotation><br/> </semantics><br/></math></span><img alt="D" style="vertical-align: -0.338ex; width:1.924ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f34a0c600395e5d4345287e21fb26efd386990e6"></span>를 보게 될 조건부 확률이다.</li><br/><li><span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle P(D)}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>D</mi><br/> <mo stretchy="false">)</mo><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle P(D)}</annotation><br/> </semantics><br/></math></span><img alt="P(D)" style="vertical-align: -0.838ex; width:5.479ex; height:2.843ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8eb4a5cc3182bd0e266ab80b8a93ee339de710a5"></span>는 <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle D}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>D</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle D}</annotation><br/> </semantics><br/></math></span><img alt="D" style="vertical-align: -0.338ex; width:1.924ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f34a0c600395e5d4345287e21fb26efd386990e6"></span>의 경계 확률이다.</li><br/><li><span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle P(H|D)}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>P</mi><br/> <mo stretchy="false">(</mo><br/> <mi>H</mi><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mo stretchy="false">|</mo><br/> </mrow><br/> <mi>D</mi><br/> <mo stretchy="false">)</mo><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle P(H|D)}</annotation><br/> </semantics><br/></math></span><img alt="P(H|D)" style="vertical-align: -0.838ex; width:8.189ex; height:2.843ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d762cc4a424df51aec09d99de7f30c1ba374d99a"></span>는 <a rel="nofollow" href="/wiki/%EC%82%AC%ED%9B%84_%ED%99%95%EB%A5%A0" title="사후 확률" class="mw-redirect">사후 확률</a>이다. <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle D}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>D</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle D}</annotation><br/> </semantics><br/></math></span><img alt="D" style="vertical-align: -0.338ex; width:1.924ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f34a0c600395e5d4345287e21fb26efd386990e6"></span>가 보이고 나서의 <span class="mwe-math-element"><span style="display: none;" class="mwe-math-mathml-inline mwe-math-mathml-a11y"><math alttext="{\displaystyle H}" xmlns="http://www.w3.org/1998/Math/MathML"><br/> <semantics><br/> <mrow class="MJX-TeXAtom-ORD"><br/> <mstyle displaystyle="true" scriptlevel="0"><br/> <mi>H</mi><br/> </mstyle><br/> </mrow><br/> <annotation encoding="application/x-tex">{\displaystyle H}</annotation><br/> </semantics><br/></math></span><img alt="H" style="vertical-align: -0.338ex; width:2.064ex; height:2.176ex;" aria-hidden="true" class="mwe-math-fallback-image-inline" src="https://wikimedia.org/api/rest_v1/media/math/render/svg/75a9edddcca2f782014371f75dca39d7e13a9c1b"></span>가 참일 조건부 확률이다.</li></ul>
-
댓글