Questions tagged [linear-algebra]

A field of mathematics concerned with the study of finite dimensional vector spaces, including matrices and their manipulation, which are important in statistics.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Can reducing information improve regression prediction?

Variable A is either 0 or 1. It is 0 if the sum of variables a + b + c + d … is less than some constant threshold, and is 1 if the sum of variables a + b + c + d … is greater than some constant ...
BigMistake's user avatar
0 votes
0 answers
19 views

Calculating the solution of OLS efficiently when adding one feature at a time

We know that the analytical solution for an OLS problem is $𝛽̂ =(𝐗^T𝐗)^{-1}𝐗^𝑇𝐲$. I am looking for an efficient algorithm to solve for $𝛽̂$ when I add one feature at a time. More specifically, ...
Ali s.k's user avatar
  • 101
0 votes
1 answer
82 views

About the last decoder layer in transformer architecture

So, in the decoder layer of transfomer, suppose I have predicted 3 words till now, including the start token then the last decoder layer will produce 3 vectors of size d-model, and only the last ...
Nishan Poudel's user avatar
0 votes
0 answers
10 views

Rotate vector anticlockwise

I'm learning mathematics for Machine Learning, and there given a vector [ 1 0 ] and [ 0 1 ]. The vector is packed on a matrix, ...
Rickyslash's user avatar
0 votes
0 answers
10 views

Plus sign inside circle, there seem to be many meaning. Are they all related?

In Linear algebra plus sign inside a circle refers to direct sum. In a paper "Towards Neural Mixture Recommender for Long Range Dependent User Sequences" it seems to refer to concatenation. ...
haneulkim's user avatar
  • 457
0 votes
1 answer
502 views

How is weight matrix calculated in a neural network?

Context: I am a pure mathematician trying to understand machine learning. I am studying it from various sources, now focusing on NLP and word embeddings. My question: What is the weight matrix for a ...
Tereza Tizkova's user avatar
0 votes
0 answers
19 views

SVD of multivariate time series interpretation

I have multivariate timeseries data represented in matrix format. I have matrix A of MxN where M is number of timestamp and N is number of sensor. Time series data is sampled at very 1 hour. Each ...
user140192's user avatar
0 votes
0 answers
17 views

Derive quadratic form of this laplacian matrix

Lets look at the following laplacian: $L = I - \frac{1}{d}A$ and the graph $H = (U, V)$. I am trying to derive the known quadratic form of this laplacian $x^T Lx = \frac{1}{d}\sum_{u, v \in H}(x_u - ...
user100101's user avatar
0 votes
1 answer
25 views

What (in the world) is well-conditioned vs. low rank fat-tail singular profile?

Scikit learn has a make_regression data generator. Can someone explain it to me like I'm 5 what is meant in the help docs by "The input set can either be well ...
Snehal Patel's user avatar
0 votes
1 answer
31 views

Proof of perpendicular distance of an observation from the Maximal Margin Hyperplane

I was reading about Maximal Margin Classifiers in "Introduction to Statistical Learning" and could not understand how is the perpendicular distance of an observation (which is a vector) from ...
Circuit_Breaker0.7's user avatar
1 vote
1 answer
49 views

Plot a matrix as a single point in space

I have a dataset of drugs represented as a graph, each of which is described by three non-square matrices: edge index (A), an 2xe matrix, where e are the bonds of the molecule, the first line ...
Gianmarco Luchetti 's user avatar
0 votes
1 answer
56 views

Beginner Question on Understanding Linear Classifier

I have been trying to understand the math behind Linear classifier for images and I'm hitting a roadblock to understanding this image below: I can to some extent agree that we stretch the pixels into ...
joesan's user avatar
  • 137
2 votes
0 answers
188 views

Multi-dimensional Euclidian R^2 squared - reasonable?

I have a high-dimensional space, say $\mathbb{R}^{1000}$, and I have samples $y_1, \ldots , y_n \in \mathbb{R}^{1000}$ and $\hat{y}_1, \ldots , \hat{y}_n \in \mathbb{R}^{1000}$. Would $$ R^2 = 1 - \...
AspiringToAspire's user avatar
0 votes
1 answer
32 views

What what will happen if all the layers of a MLP or any DL architecture are set as same in the beginning?

Setting the initial weights as all zeros will have the output dependent on the bias and setting the weights of all the neurons of a layer as same, will update the gradients in same way thus removing ...
Deshwal's user avatar
  • 323
1 vote
0 answers
19 views

Nearest neighbor face recognition in eigenspace when using dot product of test set with eigenvectors does not match the performance when using sklearn

I am trying to perform Face recognition using PCA (eigenfaces). I have a set of N training images (of dimensions M=wxh), which I have pre-processed into a vertical ...
zr0gravity7's user avatar
0 votes
1 answer
83 views

If an SVM decision boundary is the perpendicular bisector of the line connecting the support vectors, why iterate for it using a loss function?

Would it not make more sense to do some linear algebra to find the vector of the decision boundary? Is that more computationally expensive?
user132380's user avatar
1 vote
1 answer
148 views

Why linear model cannot understand the interaction between any two input features?

The book Deep Learning by Ian Goodfellow states that: ...
Gull Noor's user avatar
0 votes
0 answers
20 views

NCHW input matrix to Dm conversion logic for convolution in cuDNN

I have been trying to understand the convolution lowering operation shown in the cuDNN paper. I was able to understand most of it by reading through and mapping various parameters to the image below. ...
Rajesh Shashi Kumar's user avatar
1 vote
0 answers
52 views

Pseudo inverse of the covariance matrix?

I've been looking for methods to compute a pseudo inverse of a covariance matrix. And found that one way is to construct a regularized inverse matrix. By constructing the eigen system, and removing ...
nimo96's user avatar
  • 11
5 votes
0 answers
82 views

How is image convolution actually implemented in deep learning libraries using simple linear algebra?

As a clarifier, I want to implement cross-correlation, but the machine learning literature keeps referring to it as convolution so I will stick with it. I am trying to implement image convolution ...
Jozef Nagy's user avatar
1 vote
1 answer
189 views

Understanding Lagrangian equation for SVM

I was trying to understand Lagrangian from SVM section of Andrew Ng's Stanford CS229 course notes. On page 17 and 18, he says: Given the problem $$\begin{align} min_w & \quad f(w) \\ s.t. &...
Mahesha999's user avatar
0 votes
1 answer
83 views

Understanding SVM mathematics

I was referring SVM section of Andrew Ng's course notes for Stanford CS229 Machine Learning course. On pages 14 and 15, he says: Consider the picture below: How can we find the value of $\gamma^{(i)}...
Rnj's user avatar
  • 205
1 vote
1 answer
112 views

What are some application of Google's PageRank Algorithm in Data Science

I came across a topic on computational linear algebra that talks about iterative algorithms to compute eigenvalues. I've worked with power method which is an iterative algorithm that converges a ...
SPARSE's user avatar
  • 115
0 votes
0 answers
128 views

Inverting a matrix using a convolutional neural network

Just for a fun exercise, I am trying to invert a matrix, say size 28x28 (or even 5x5) with a neural network. The way I approached this (quite naively) is as follows: I built a fully convolutional ...
Ashesh's user avatar
  • 90
-1 votes
1 answer
57 views

Why do we use 'T' when we are to say matrix-vector product? [closed]

On the first picture author uses $T$ meaning matrix-vector product But other website do not use $T$, but says that $x$ is a vector, I do not understand if it is important or not
Vladislav Kruglikov's user avatar
2 votes
1 answer
4k views

3d input for Dense Layer Keras

Is there any example of how Keras Dense layer handles 3D input. The documentation explains the following: ...
data_person's user avatar
2 votes
1 answer
1k views

Difference between FDA and LDA

I have asked this question in Mathematics Stackexchange, thought however that it might be more fit for here: I am currently taking a Data-Analysis course and I learned about both the terms LDA (Linear ...
Nestroy's user avatar
  • 21
0 votes
0 answers
77 views

What is the Intuition behind weight vector W which is normal to the plane? Is the weight vector W same as the W which is normal to the plane π?

In an interview, I was asked the intuition behind the weight vector. I told the weight vector is a vector which we try to minimize to a local minima with the help of regulariser so we don't overfit. ...
Vinit Sutar's user avatar
1 vote
1 answer
613 views

How does the equation "dW = - (2 * (X^T ).dot(Y - Y_hat)) / m" comes in Linear Regression (using Matrix + Gradient Descent)?

I was trying to code the Linear Regression in Python using Matrix Multiplication method using Gradient Descent and followed a code where there was no mention what is the loss but just a code as Per ...
Deshwal's user avatar
  • 323
0 votes
1 answer
31 views

How does tree-based algorithms handle linearly combined features?

While I am aware that tree-based algorithms (e.g., DT, RF, XGBoost) are 'immune' to multi-collinearity, how do they handle linearly combined features? For example, is there is any additional value or ...
thereandhere1's user avatar
2 votes
0 answers
136 views

Geometric classification models

In class we have been presented with a Geometric classification model such that the goal is to construct a linear decision boundary $\bf{w} \cdot \bf{x} = t$; where $\bf{w}$ is the vector from the ...
Zafir Stojanovski's user avatar
1 vote
1 answer
1k views

Dot product and linear regression

I'm studying PCA and my professor said something about finding the linear regression by doing the dot product of both axis. Could someone explain to me why? The dot product returns a number. What's ...
leoperassoli's user avatar
0 votes
0 answers
66 views

Why do we usually have fully connected layers of same sizes in CNNs?

Is there any specific reason that we observe in CNNs, the fully connected layers usually have the same sizes? You can verify this for many CNNs. I'm aware that if, for instance, we have a vector of ...
Green Falcon's user avatar
  • 13.9k
1 vote
1 answer
223 views

Hypothesis vs Hyperplane in Machine Learning

I am finding it hard to understand the clear difference between Hypothesis and Hyperplane. I know that Hypothesis is a candidate model that maps inputs to outputs after training. And, Hyperplane is ...
AnonymousMe's user avatar
1 vote
1 answer
168 views

Confusion with Notation in the Book on Deep Learning by Ian Goodfellow et al

In chapter 6.1 on 'Example: Learning XOR', the bottom of page 168 mentions: The activation function $g$ is typically chosen to be a function that is applied element-wise, with $h_i = g(x^TW_{:,i}+c_i)...
KGhatak's user avatar
  • 123
2 votes
0 answers
98 views

Deriving vectorized form of linear regression

We first have the weights of a D dimensional vector $w$ and a D dimensional predictor vector $x$, which are all indexed by $j$. There are $N$ observations, all D dimensional. $t$ is our targets, i.e, ...
user2793618's user avatar
1 vote
2 answers
2k views

Removing constant from the regression model

I am trying to calibrate two variables $(X,Y)$ of different measuring techniques from two instruments, the result of the linear regression analysis appears as shown in the image. The result shows the ...
Yazan Alatoom's user avatar
0 votes
1 answer
35 views

Understanding the algebra behind a specific partial derivative equation

I am following this article about neural networks. Given: Until here I understand everything, but then he continues to: I don't understand how he got to that conclusion. I think he skipped some ...
Alon's user avatar
  • 23
1 vote
2 answers
5k views

Dose finding slope/intercept using the formula of m,b gives best fit line always In linear regression?

In liner regression We have to fit different lines and chose one with minimum error so What is the motive of having a formula for m,b that can give slope and intercept value in the regression line ,...
star's user avatar
  • 1,431
0 votes
1 answer
76 views

Normal equation for linear regression is illogical

Currently I'm taking Andrew Ng's course. He gives a following formula to find solution for linear regression analytically: $θ = (X^T * X)^{-1} * X^T * у$ He doesn't explain it so I searched for it and ...
Martian's user avatar
  • 123
1 vote
1 answer
398 views

When is it useful to measure the Frobenius norm of a matrix?

In Deep Learning section 2.5 the author review some measures for the size of vectors and matrices. When in general is it useful for someone to know these? For instance they give the example of the ...
nid's user avatar
  • 131
2 votes
0 answers
63 views

Intuition behind understanding eigenvectors and Machine Learning [closed]

I am struggling to understand linear algebra application in machine learning, and I am not able to answer the following question. Is the model learned in Machine Learning the eigenvector of the ...
Hermes Morales's user avatar
1 vote
1 answer
43 views

Can all known ML algorithms be written as a sequence of matrix operations?

I keep hearing that machine learning is just linear algebra. Does that mean all known (and all possible?) ML algos, from random forest, to support-vector machines, to recursive neural networks, can ...
SubstantialRange's user avatar
2 votes
4 answers
474 views

How to solve Ax = b for A [closed]

Given two know vector x, and b (dimension 3*1 for example), what are the ways to approximate the matrix ...
silkAdmin's user avatar
  • 143
1 vote
3 answers
516 views

Why transpose of independent feature matrix is necessary in case of linear regression?

I can follow classical linear regression steps: $Xw=y$ $X^{-1}Xw=X^{-1}y$ $Iw=X^{-1}y$ $w=X^{-1}y$ However, on implementing in Python, I see that instead of simply using ...
Fredrik's user avatar
  • 987
1 vote
2 answers
895 views

Linear regression with a fixed intercept and everything is in log

I have a set of values for a surface (in pixels) that becomes bigger over time (exponentially). The surface consists of cells that divide over time. After doing some modelling, I came up with the ...
a0142204's user avatar
3 votes
2 answers
53 views

Backpropagation with a different sized training set?

I'm trying to create a NN whose input is a (length m) array of 3d vectors $$\vec{x}_i = [x_{i,1},x_{i,2},x_{i,3}], \hspace{5mm}i=1:m $$ and whose output is a similarly sized array: $$\vec{h}_{\theta,...
Spinach's user avatar
  • 31
1 vote
0 answers
54 views

What's wrong with my backpropagation through time (BTT) calculation or how to multiple a scaled vector and a matrix without matching dimensions?

I am trying to make a pretty simple RNN from scracth, using only Numpy library of Python. At this moment I am having troubles with BTT as I do not know how to proceed with situation when a ...
été's user avatar
  • 19
3 votes
1 answer
116 views

How to incorporate the uncertainty of the model coefficients in the prediction interval of a multiple linear regression

I'm dealing with modeling small experimental data sets. As most experimental work does not generate thousands of samples, but rather a handful, I need to be inventive about how to deal with this small ...
DannyVanpoucke's user avatar
1 vote
0 answers
58 views

How effective is Moore Penrose for solving regression problems with overdetermined system of equations?

For regression problems with #Predictors > #observations, I recently read about Moore Penrose (pseudo inverse method) which solves the problem of non invertible matrix in OLS for regression problems. ...
Preetham_tsp's user avatar