question
stringlengths
6
3.53k
text
stringlengths
17
2.05k
source
stringclasses
1 value
In Support Vector Machines (SVM), we want to maximize the margin
Computing the (soft-margin) SVM classifier amounts to minimizing an expression of the form We focus on the soft-margin classifier since, as noted above, choosing a sufficiently small value for λ {\displaystyle \lambda } yields the hard-margin classifier for linearly classifiable input data. The classical approach, which involves reducing (2) to a quadratic programming problem, is detailed below. Then, more recent approaches such as sub-gradient descent and coordinate descent will be discussed.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Support Vector Machines (SVM), we want to maximize the margin
See support vector machines and maximum-margin hyperplane for details.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement the function `check_words` that checks if the words of a strings have common words with a list. Write your code in python. Your code should be agnostic to lower/upper case.
CLASS words ideally would be a very short list of data types relevant to a particular application. Common CLASS words might be: NO (number), ID (identifier), TXT (text), AMT (amount), QTY (quantity), FL (flag), CD (code), W (work) and so forth. In practice, the available CLASS words would be a list of less than two dozen terms.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement the function `check_words` that checks if the words of a strings have common words with a list. Write your code in python. Your code should be agnostic to lower/upper case.
The system can check the data in the CDMS and compare them to the dictionaries. Items that do not match can be flagged for further checking. Some systems allow for the storage of synonyms to allow the system to match common abbreviations and map them to the correct term.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When using linear regression, how do you help prevent numerical instabilities? (One or multiple answers)
In these cases, the least squares estimate amplifies the measurement noise and may be grossly inaccurate. Various regularization techniques can be applied in such cases, the most common of which is called ridge regression. If further information about the parameters is known, for example, a range of possible values of β ^ {\displaystyle \mathbf {\hat {\boldsymbol {\beta }}} } , then various techniques can be used to increase the stability of the solution.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When using linear regression, how do you help prevent numerical instabilities? (One or multiple answers)
The numerical methods for linear least squares are important because linear regression models are among the most important types of model, both as formal statistical models and for exploration of data-sets. The majority of statistical computer packages contain facilities for regression analysis that make use of linear least squares computations. Hence it is appropriate that considerable effort has been devoted to the task of ensuring that these computations are undertaken efficiently and with due regard to round-off error.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Hypothesize a reason for the difference in performance between the Linear regression and the Gradient Boosting Regressor.
"Improved Boosting Algorithms Using Confidence-rated Predictions". Machine Learning. 37 (3): 297–336.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Hypothesize a reason for the difference in performance between the Linear regression and the Gradient Boosting Regressor.
"Improved Boosting Algorithms Using Confidence-rated Predictions". Machine Learning. 37 (3): 297–336.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You write a Python code to optimize the weights of your linear regression with 10 features \textbf{using gradient descent} for 500 epochs. What is the minimum number of for-loops you need to perform your optimization?
Another possible training algorithm is gradient descent. In gradient descent training, the weights are adjusted at each time step by moving them in a direction opposite from the gradient of the objective function (thus allowing the minimum of the objective function to be found), w ( t + 1 ) = w ( t ) − ν d d w H t ( w ) {\displaystyle \mathbf {w} (t+1)=\mathbf {w} (t)-\nu {\frac {d}{d\mathbf {w} }}H_{t}(\mathbf {w} )} where ν {\displaystyle \nu } is a "learning parameter." For the case of training the linear weights, a i {\displaystyle a_{i}} , the algorithm becomes a i ( t + 1 ) = a i ( t ) + ν ρ ( ‖ x ( t ) − c i ‖ ) {\displaystyle a_{i}(t+1)=a_{i}(t)+\nu {\big }\rho {\big (}\left\Vert \mathbf {x} (t)-\mathbf {c} _{i}\right\Vert {\big )}} in the unnormalized case and a i ( t + 1 ) = a i ( t ) + ν u ( ‖ x ( t ) − c i ‖ ) {\displaystyle a_{i}(t+1)=a_{i}(t)+\nu {\big }u{\big (}\left\Vert \mathbf {x} (t)-\mathbf {c} _{i}\right\Vert {\big )}} in the normalized case. For local-linear-architectures gradient-descent training is e i j ( t + 1 ) = e i j ( t ) + ν v i j ( x ( t ) − c i ) {\displaystyle e_{ij}(t+1)=e_{ij}(t)+\nu {\big }v_{ij}{\big (}\mathbf {x} (t)-\mathbf {c} _{i}{\big )}}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You write a Python code to optimize the weights of your linear regression with 10 features \textbf{using gradient descent} for 500 epochs. What is the minimum number of for-loops you need to perform your optimization?
Many improvements on the basic stochastic gradient descent algorithm have been proposed and used. In particular, in machine learning, the need to set a learning rate (step size) has been recognized as problematic. Setting this parameter too high can cause the algorithm to diverge; setting it too low makes it slow to converge.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which loss function(s) should you use? (One or multiple answers)
For most optimization algorithms, it is desirable to have a loss function that is globally continuous and differentiable. Two very commonly used loss functions are the squared loss, L ( a ) = a 2 {\displaystyle L(a)=a^{2}} , and the absolute loss, L ( a ) = | a | {\displaystyle L(a)=|a|} . However the absolute loss has the disadvantage that it is not differentiable at a = 0 {\displaystyle a=0} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which loss function(s) should you use? (One or multiple answers)
In mathematical optimization and decision theory, a loss function or cost function (sometimes also called an error function) is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cost" associated with the event. An optimization problem seeks to minimize a loss function. An objective function is either a loss function or its opposite (in specific domains, variously called a reward function, a profit function, a utility function, a fitness function, etc.), in which case it is to be maximized.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In a nutshell, the "second album syndrome" is a theory that states that the second album of a band always sucks You have the following regression output regarding the score_diff: the difference in scores between the second and the first album (second - first): Dep. Variable: score_diff R-squared: -0.000 Interpret the 𝑅2 in your regression here. Do these analyses suggest that the "second album syndrome" exists? Why?
The first is a failure to distinguish between systems of notation (which may have both additive and divisive aspects) and the music notated under such a system. The second involves a failure to understand the divisive and additive aspects of meter itself. Winold recommends that, "metric structure is best described through detailed analysis of pulse groupings on various levels rather than through attempts to represent the organization with a single term".Sub-Saharan African music and most European (Western) music is divisive, while Indian and other Asian musics may be considered as primarily additive. However, many pieces of music cannot be clearly labeled divisive or additive.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In a nutshell, the "second album syndrome" is a theory that states that the second album of a band always sucks You have the following regression output regarding the score_diff: the difference in scores between the second and the first album (second - first): Dep. Variable: score_diff R-squared: -0.000 Interpret the 𝑅2 in your regression here. Do these analyses suggest that the "second album syndrome" exists? Why?
Searching for other aspects of hierarchical structure of music there is a controversial discussion, if the organization of tension and resolution in music can be described as hierarchical structure or only as a purely sequential structure. According to Patel research in this area has produced apparently contradictory evidence, and more research is needed to answer this question. The question concerning the kind of structure that features tension and resolution in music is linked very close to the relationship between order and meaning in music. Considering tension and resolution as one possible kind of meaning in music a hierarchical structure would imply that a change of order of musical elements would have an influence on the meaning of the music.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Fill the missing line of code: (one answer)\\ \hspace*{.5cm} \#code missing\\ \hspace*{.5cm} np.mean(np.random.randn(1000))\\
Line 7, for example, cannot be reached again. For your understanding, you can imagine 2 different variables d: As a result, you could get something like this. The variable d1 would be replaced by b
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Fill the missing line of code: (one answer)\\ \hspace*{.5cm} \#code missing\\ \hspace*{.5cm} np.mean(np.random.randn(1000))\\
An example of the recent code would be more like this: RANDOMIZE SET WINDOW 0,20,0,20 SET COLOR 5 !Set the pen and text colour to 5 as true basic has 0-15 colours PRINT "Welcome To ..." !Print "Welcome To ..." on the user's screen. DO !Begin the loop LET x=rnd*20 !Let the value 'x' equal a random number between '0' and '20' LET y=rnd*20 !Let the value 'y' equal a random number between '0' and '20' Pause .1 !Waits 1/10 of a second PLOT TEXT, at x, y: "Fabulous Wikipedia!" !Plot 'Fabulous Wikipedia!'
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The [t-statistic](https://en.wikipedia.org/wiki/T-statistic) is the ratio of the departure of the estimated value of a parameter from its hypothesized value to its standard error. In a t-test, the higher the t-statistic, the more confidently we can reject the null hypothesis. Use `numpy.random` to create four samples, each of size 30: - $X \sim Uniform(0,1)$ - $Y \sim Uniform(0,1)$ - $Z = X/2 + Y/2 + 0.1$ - $K = Y + 0.1$
In statistics, the t-statistic is the ratio of the departure of the estimated value of a parameter from its hypothesized value to its standard error. It is used in hypothesis testing via Student's t-test. The t-statistic is used in a t-test to determine whether to support or reject the null hypothesis.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The [t-statistic](https://en.wikipedia.org/wiki/T-statistic) is the ratio of the departure of the estimated value of a parameter from its hypothesized value to its standard error. In a t-test, the higher the t-statistic, the more confidently we can reject the null hypothesis. Use `numpy.random` to create four samples, each of size 30: - $X \sim Uniform(0,1)$ - $Y \sim Uniform(0,1)$ - $Z = X/2 + Y/2 + 0.1$ - $K = Y + 0.1$
A t-test is a type of statistical analysis used to compare the averages of two groups and determine if the differences between them are more likely to arise from random chance. It is any statistical hypothesis test in which the test statistic follows a Student's t-distribution under the null hypothesis. It is most commonly applied when the test statistic would follow a normal distribution if the value of a scaling term in the test statistic were known (typically, the scaling term is unknown and is therefore a nuisance parameter). When the scaling term is estimated based on the data, the test statistic—under certain conditions—follows a Student's t distribution. The t-test's most common application is to test whether the means of two populations are different.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The data contains information about submissions to a prestigious machine learning conference called ICLR. Columns: year, paper, authors, ratings, decisions, institution, csranking, categories, authors_citations, authors_publications, authors_hindex, arxiv. The data is stored in a pandas.DataFrame format. Create 3 new fields in the dataframe corresponding to the median value of the number of citations per author, the number of publications per author, and the h-index per author. So for instance, for the row authors_publications, you will create an additional column, e.g. authors_publications_median, containing the median number of publications per author in each paper.
This series started publishing in 1972 and publishes papers related to computational statistics. It publishes 6 issues each year. Based on Web of Science, the five most cited papers in the journal are: Iman RL, Conover WJ. A distribution-free approach to inducing rank correlation among input variables, 1982, 519 cites.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The data contains information about submissions to a prestigious machine learning conference called ICLR. Columns: year, paper, authors, ratings, decisions, institution, csranking, categories, authors_citations, authors_publications, authors_hindex, arxiv. The data is stored in a pandas.DataFrame format. Create 3 new fields in the dataframe corresponding to the median value of the number of citations per author, the number of publications per author, and the h-index per author. So for instance, for the row authors_publications, you will create an additional column, e.g. authors_publications_median, containing the median number of publications per author in each paper.
pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series. It is free software released under the three-clause BSD license.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
/True or false:/ Is the following statement true or false? Justify your answer. "The node with the highest clustering coefficient in an undirected graph is the node that belongs to the largest number of triangles.:"
A high clustering coefficient for a network is another indication of a small world. The clustering coefficient of the i {\displaystyle i} 'th node is C i = 2 e i k i ( k i − 1 ) , {\displaystyle C_{i}={2e_{i} \over k_{i}{(k_{i}-1)}}\,,} where k i {\displaystyle k_{i}} is the number of neighbours of the i {\displaystyle i} 'th node, and e i {\displaystyle e_{i}} is the number of connections between these neighbours.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
/True or false:/ Is the following statement true or false? Justify your answer. "The node with the highest clustering coefficient in an undirected graph is the node that belongs to the largest number of triangles.:"
In graph theory, a clustering coefficient is a measure of the degree to which nodes in a graph tend to cluster together. Evidence suggests that in most real-world networks, and in particular social networks, nodes tend to create tightly knit groups characterised by a relatively high density of ties; this likelihood tends to be greater than the average probability of a tie randomly established between two nodes (Holland and Leinhardt, 1971; Watts and Strogatz, 1998). Two versions of this measure exist: the global and the local. The global version was designed to give an overall indication of the clustering in the network, whereas the local gives an indication of the embeddedness of single nodes.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What is the output of the following block of Python code? (one answer) \\ \verb|my_string = `computational'| \\ \verb|print(my_string[1])|\\ \verb|print(my_string[3:5])| \vspace{0.25cm}
Python has a "string format" operator % that functions analogously to printf format strings in C—e.g. "spam=%s eggs=%d" % ("blah", 2) evaluates to "spam=blah eggs=2". In Python 2.6+ and 3+, this was supplemented by the format() method of the str class, e.g. "spam={0} eggs={1}".format("blah", 2).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What is the output of the following block of Python code? (one answer) \\ \verb|my_string = `computational'| \\ \verb|print(my_string[1])|\\ \verb|print(my_string[3:5])| \vspace{0.25cm}
If P is a program which outputs a string x, then P is a description of x. The length of the description is just the length of P as a character string, multiplied by the number of bits in a character (e.g., 7 for ASCII). We could, alternatively, choose an encoding for Turing machines, where an encoding is a function which associates to each Turing Machine M a bitstring . If M is a Turing Machine which, on input w, outputs string x, then the concatenated string w is a description of x. For theoretical analysis, this approach is more suited for constructing detailed formal proofs and is generally preferred in the research literature.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Machine Learning, we want to learn the \textbf{parameters W} for the mapping function f: $y=f(x,W) +\epsilon$ where x is the input, y the output, and $\epsilon$ the error term.\\ (One or multiple answers)
In the setting of supervised learning, a function of f: X → Y {\displaystyle f:X\to Y} is to be learned, where X {\displaystyle X} is thought of as a space of inputs and Y {\displaystyle Y} as a space of outputs, that predicts well on instances that are drawn from a joint probability distribution p ( x , y ) {\displaystyle p(x,y)} on X × Y {\displaystyle X\times Y} . In reality, the learner never knows the true distribution p ( x , y ) {\displaystyle p(x,y)} over instances. Instead, the learner usually has access to a training set of examples ( x 1 , y 1 ) , … , ( x n , y n ) {\displaystyle (x_{1},y_{1}),\ldots ,(x_{n},y_{n})} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Machine Learning, we want to learn the \textbf{parameters W} for the mapping function f: $y=f(x,W) +\epsilon$ where x is the input, y the output, and $\epsilon$ the error term.\\ (One or multiple answers)
Of course, we cannot hope to do so perfectly, since the y i {\displaystyle y_{i}} contain noise ε {\displaystyle \varepsilon } ; this means we must be prepared to accept an irreducible error in any function we come up with. Finding an f ^ {\displaystyle {\hat {f}}} that generalizes to points outside of the training set can be done with any of the countless algorithms used for supervised learning. It turns out that whichever function f ^ {\displaystyle {\hat {f}}} we select, we can decompose its expected error on an unseen sample x {\displaystyle x} (i.e. conditional to x) as follows:: 34: 223 E D , ε ⁡ = ( Bias D ⁡ ) 2 + Var D ⁡ + σ 2 {\displaystyle \operatorname {E} _{D,\varepsilon }{\Big }={\Big (}\operatorname {Bias} _{D}{\big }{\Big )}^{2}+\operatorname {Var} _{D}{\big }+\sigma ^{2}} where Bias D ⁡ = E D ⁡ = E D ⁡ − E y | x ⁡ , {\displaystyle \operatorname {Bias} _{D}{\big }=\operatorname {E} _{D}{\big }=\operatorname {E} _{D}{\big }-\operatorname {E} _{y|x}{\big },} Var D ⁡ = E D ⁡ − f ^ ( x ; D ) ) 2 ] .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Principle Component Analysis (PCA) is a technique for...
Principal component analysis (PCA) is a widely used method for factor extraction, which is the first phase of EFA. Factor weights are computed to extract the maximum possible variance, with successive factoring continuing until there is no further meaningful variance left. The factor model must then be rotated for analysis.Canonical factor analysis, also called Rao's canonical factoring, is a different method of computing the same model as PCA, which uses the principal axis method. Canonical factor analysis seeks factors that have the highest canonical correlation with the observed variables.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Principle Component Analysis (PCA) is a technique for...
Principal component analysis (PCA) is a popular technique for analyzing large datasets containing a high number of dimensions/features per observation, increasing the interpretability of data while preserving the maximum amount of information, and enabling the visualization of multidimensional data. Formally, PCA is a statistical technique for reducing the dimensionality of a dataset. This is accomplished by linearly transforming the data into a new coordinate system where (most of) the variation in the data can be described with fewer dimensions than the initial data. Many studies use the first two principal components in order to plot the data in two dimensions and to visually identify clusters of closely related data points.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In order to summarize the degree distribution in a single number, would you recommend using the average degree? Why, or why not? If not, what alternatives can you think of? Please elaborate!
For many practical purposes, a degree is a small enough angle that whole degrees provide sufficient precision. When this is not the case, as in astronomy or for geographic coordinates (latitude and longitude), degree measurements may be written using decimal degrees (DD notation); for example, 40.1875°. Alternatively, the traditional sexagesimal unit subdivisions can be used: one degree is divided into 60 minutes (of arc), and one minute into 60 seconds (of arc). Use of degrees-minutes-seconds is also called DMS notation.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In order to summarize the degree distribution in a single number, would you recommend using the average degree? Why, or why not? If not, what alternatives can you think of? Please elaborate!
The number is usually slightly larger than the degree because some were found twice or mistakes were made. The number could be less if some zeros were missed. Stage two is more traditional than the other two.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are using a 3-layer fully-connected neural net with \textbf{ReLU activations}. Your input data has components in [0, 1]. \textbf{You initialize all your weights to -10}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
This is particularly helpful when training data are limited, because poorly initialized weights can significantly hinder learning. These pre-trained weights end up in a region of the weight space that is closer to the optimal weights than random choices. This allows for both improved modeling and faster ultimate convergence.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are using a 3-layer fully-connected neural net with \textbf{ReLU activations}. Your input data has components in [0, 1]. \textbf{You initialize all your weights to -10}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
Even if the cost function has globally continuous gradient, good estimate of the Lipschitz constant for the cost functions in deep learning may not be feasible or desirable, given the very high dimensions of deep neural networks. Hence, there is a technique of fine-tuning of learning rates in applying standard GD or SGD. One way is to choose many learning rates from a grid search, with the hope that some of the learning rates can give good results.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are working on a dataset with lots of outliers, and want to perform a regression task. Everything else being equal, and assuming that you do not do any pre-processing, which loss function will be less affected by these outliers?
The squared loss has the disadvantage that it has the tendency to be dominated by outliers—when summing over a set of a {\displaystyle a} 's (as in ∑ i = 1 n L ( a i ) {\textstyle \sum _{i=1}^{n}L(a_{i})} ), the final sum tends to be the result of a few particularly large a-values, rather than an expression of the average a-value. The choice of a loss function is not arbitrary. It is very restrictive and sometimes the loss function may be characterized by its desirable properties.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are working on a dataset with lots of outliers, and want to perform a regression task. Everything else being equal, and assuming that you do not do any pre-processing, which loss function will be less affected by these outliers?
The square loss function is both convex and smooth. However, the square loss function tends to penalize outliers excessively, leading to slower convergence rates (with regards to sample complexity) than for the logistic loss or hinge loss functions. In addition, functions which yield high values of f ( x → ) {\displaystyle f({\vec {x}})} for some x ∈ X {\displaystyle x\in X} will perform poorly with the square loss function, since high values of y f ( x → ) {\displaystyle yf({\vec {x}})} will be penalized severely, regardless of whether the signs of y {\displaystyle y} and f ( x → ) {\displaystyle f({\vec {x}})} match.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
/True or false:/ Is the following statement true or false? Justify your answer. "The node with the highest clustering coefficient in an undirected graph is the node that belongs to the largest number of triangles."
A high clustering coefficient for a network is another indication of a small world. The clustering coefficient of the i {\displaystyle i} 'th node is C i = 2 e i k i ( k i − 1 ) , {\displaystyle C_{i}={2e_{i} \over k_{i}{(k_{i}-1)}}\,,} where k i {\displaystyle k_{i}} is the number of neighbours of the i {\displaystyle i} 'th node, and e i {\displaystyle e_{i}} is the number of connections between these neighbours.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
/True or false:/ Is the following statement true or false? Justify your answer. "The node with the highest clustering coefficient in an undirected graph is the node that belongs to the largest number of triangles."
In graph theory, a clustering coefficient is a measure of the degree to which nodes in a graph tend to cluster together. Evidence suggests that in most real-world networks, and in particular social networks, nodes tend to create tightly knit groups characterised by a relatively high density of ties; this likelihood tends to be greater than the average probability of a tie randomly established between two nodes (Holland and Leinhardt, 1971; Watts and Strogatz, 1998). Two versions of this measure exist: the global and the local. The global version was designed to give an overall indication of the clustering in the network, whereas the local gives an indication of the embeddedness of single nodes.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Split the given data into a training set (70%) and a testing set (30%). We refer to these as "random split" in the subsequent tasks. The data is in a pandas.DataFrame format.
This halves reliability estimate is then stepped up to the full test length using the Spearman–Brown prediction formula. There are several ways of splitting a test to estimate reliability. For example, a 40-item vocabulary test could be split into two subtests, the first one made up of items 1 through 20 and the second made up of items 21 through 40.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Split the given data into a training set (70%) and a testing set (30%). We refer to these as "random split" in the subsequent tasks. The data is in a pandas.DataFrame format.
Then, of all the randomly generated splits, the split that yields the highest score is chosen to split the node. Similar to ordinary random forests, the number of randomly selected features to be considered at each node can be specified. Default values for this parameter are p {\displaystyle {\sqrt {p}}} for classification and p {\displaystyle p} for regression, where p {\displaystyle p} is the number of features in the model.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
A model you trained seems to be overfitting. You decide to significantly increase the strength of the regularization. This will always improve the test error.
Increasing M reduces the error on training set, but setting it too high may lead to overfitting. An optimal value of M is often selected by monitoring prediction error on a separate validation data set. Besides controlling M, several other regularization techniques are used. Another regularization parameter is the depth of the trees. The higher this value the more likely the model will overfit the training data.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
A model you trained seems to be overfitting. You decide to significantly increase the strength of the regularization. This will always improve the test error.
The overfitting occurs because the model attempts to fit the (stochastic or deterministic) noise (that part of the data that it cannot model) at the expense of fitting that part of the data which it can model. When either type of noise is present, it is usually advisable to regularize the learning algorithm to prevent overfitting the model to the data and getting inferior performance. Regularization typically results in a lower variance model at the expense of bias.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are using a 3-layer fully-connected neural, and you are using \textbf{$f(x) = 2x$ as your activation function} . Your input data has components in [0, 1]. \textbf{You initialize your weights using Kaiming (He) initialization}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
Consider a multilayer perceptron (MLP) with one hidden layer and m {\displaystyle m} hidden units with mapping from input x ∈ R d {\displaystyle x\in R^{d}} to a scalar output described as F x ( W ~ , Θ ) = ∑ i = 1 m θ i ϕ ( x T w ~ ( i ) ) {\displaystyle F_{x}({\tilde {W}},\Theta )=\sum _{i=1}^{m}\theta _{i}\phi (x^{T}{\tilde {w}}^{(i)})} , where w ~ ( i ) {\displaystyle {\tilde {w}}^{(i)}} and θ i {\displaystyle \theta _{i}} are the input and output weights of unit i {\displaystyle i} correspondingly, and ϕ {\displaystyle \phi } is the activation function and is assumed to be a tanh function. The input and output weights could then be optimized with m i n W ~ , Θ ( f N N ( W ~ , Θ ) = E y , x ) {\displaystyle min_{{\tilde {W}},\Theta }(f_{NN}({\tilde {W}},\Theta )=E_{y,x})} , where l {\displaystyle l} is a loss function, W ~ = { w ~ ( 1 ) , . . .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are using a 3-layer fully-connected neural, and you are using \textbf{$f(x) = 2x$ as your activation function} . Your input data has components in [0, 1]. \textbf{You initialize your weights using Kaiming (He) initialization}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
Consider a multilayer perceptron (MLP) with one hidden layer and m {\displaystyle m} hidden units with mapping from input x ∈ R d {\displaystyle x\in R^{d}} to a scalar output described as F x ( W ~ , Θ ) = ∑ i = 1 m θ i ϕ ( x T w ~ ( i ) ) {\displaystyle F_{x}({\tilde {W}},\Theta )=\sum _{i=1}^{m}\theta _{i}\phi (x^{T}{\tilde {w}}^{(i)})} , where w ~ ( i ) {\displaystyle {\tilde {w}}^{(i)}} and θ i {\displaystyle \theta _{i}} are the input and output weights of unit i {\displaystyle i} correspondingly, and ϕ {\displaystyle \phi } is the activation function and is assumed to be a tanh function. The input and output weights could then be optimized with m i n W ~ , Θ ( f N N ( W ~ , Θ ) = E y , x ) {\displaystyle min_{{\tilde {W}},\Theta }(f_{NN}({\tilde {W}},\Theta )=E_{y,x})} , where l {\displaystyle l} is a loss function, W ~ = { w ~ ( 1 ) , . . .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What is a good representation for scores when classifying these three target classes: Car, Bike and Bus, in the context of logistic regression. (One or multiple answers)
Because CART analysis is not only binary, but also recursive, the result can be that a predictor variable will be divided again, yielding two cutoff scores. The standard form for each predictor is that a score of one is added when CART analysis creates a partition. One study (Kerby, 2003) selected as predictors the five traits of the Big five personality traits, predicting a multi-valued measure of suicidal ideation.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
What is a good representation for scores when classifying these three target classes: Car, Bike and Bus, in the context of logistic regression. (One or multiple answers)
Instead, it represents them as specific to a Car. We can model this notion using inner classes as follows: We have the top-level class Car. Instances of class Car are composed of four instances of the class Wheel.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Decision trees...
Decision trees are a popular method for various machine learning tasks. Tree learning "come closest to meeting the requirements for serving as an off-the-shelf procedure for data mining", say Hastie et al., "because it is invariant under scaling and various other transformations of feature values, is robust to inclusion of irrelevant features, and produces inspectable models. However, they are seldom accurate". : 352 In particular, trees that are grown very deep tend to learn highly irregular patterns: they overfit their training sets, i.e. have low bias, but very high variance. Random forests are a way of averaging multiple deep decision trees, trained on different parts of the same training set, with the goal of reducing the variance. : 587–588 This comes at the expense of a small increase in the bias and some loss of interpretability, but generally greatly boosts the performance in the final model.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Decision trees...
J.R. Quinlan (1986). "Induction of Decision Trees". Machine Learning.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
$L_1$ regularization often results in sparser solutions than $L_2$ regularization.
Such ℓ 1 {\displaystyle \ell _{1}} regularization problems are interesting because they induce sparse solutions, that is, solutions w {\displaystyle w} to the minimization problem have relatively few nonzero components. Lasso can be seen to be a convex relaxation of the non-convex problem min w ∈ R d 1 n ∑ i = 1 n ( y i − ⟨ w , x i ⟩ ) 2 + λ ‖ w ‖ 0 , {\displaystyle \min _{w\in \mathbb {R} ^{d}}{\frac {1}{n}}\sum _{i=1}^{n}(y_{i}-\langle w,x_{i}\rangle )^{2}+\lambda \|w\|_{0},} where ‖ w ‖ 0 {\displaystyle \|w\|_{0}} denotes the ℓ 0 {\displaystyle \ell _{0}} "norm", which is the number of nonzero entries of the vector w {\displaystyle w} . Sparse solutions are of particular interest in learning theory for interpretability of results: a sparse solution can identify a small number of important factors.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
$L_1$ regularization often results in sparser solutions than $L_2$ regularization.
Such ℓ 1 {\displaystyle \ell _{1}} regularization problems are interesting because they induce sparse solutions, that is, solutions w {\displaystyle w} to the minimization problem have relatively few nonzero components. Lasso can be seen to be a convex relaxation of the non-convex problem min w ∈ R d 1 n ∑ i = 1 n ( y i − ⟨ w , x i ⟩ ) 2 + λ ‖ w ‖ 0 , {\displaystyle \min _{w\in \mathbb {R} ^{d}}{\frac {1}{n}}\sum _{i=1}^{n}(y_{i}-\langle w,x_{i}\rangle )^{2}+\lambda \|w\|_{0},} where ‖ w ‖ 0 {\displaystyle \|w\|_{0}} denotes the ℓ 0 {\displaystyle \ell _{0}} "norm", which is the number of nonzero entries of the vector w {\displaystyle w} . Sparse solutions are of particular interest in learning theory for interpretability of results: a sparse solution can identify a small number of important factors.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which method can be used for dimensionality reduction ?
Dimensionality reduction, as the name suggests, is reducing the number of random variables using various mathematical methods from statistics and machine learning. Dimensionality reduction is often used to reduce the problem of managing and manipulating large data sets. Dimensionality reduction techniques generally use linear transformations in determining the intrinsic dimensionality of the manifold as well as extracting its principal directions. For this purpose there are various related techniques, including: principal component analysis, linear discriminant analysis, canonical correlation analysis, discrete cosine transform, random projection, etc. Random projection is a simple and computationally efficient way to reduce the dimensionality of data by trading a controlled amount of error for faster processing times and smaller model sizes. The dimensions and distribution of random projection matrices are controlled so as to approximately preserve the pairwise distances between any two samples of the dataset.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which method can be used for dimensionality reduction ?
Dimensionality reduction, or dimension reduction, is the transformation of data from a high-dimensional space into a low-dimensional space so that the low-dimensional representation retains some meaningful properties of the original data, ideally close to its intrinsic dimension. Working in high-dimensional spaces can be undesirable for many reasons; raw data are often sparse as a consequence of the curse of dimensionality, and analyzing the data is usually computationally intractable (hard to control or deal with). Dimensionality reduction is common in fields that deal with large numbers of observations and/or large numbers of variables, such as signal processing, speech recognition, neuroinformatics, and bioinformatics.Methods are commonly divided into linear and nonlinear approaches. Approaches can also be divided into feature selection and feature extraction. Dimensionality reduction can be used for noise reduction, data visualization, cluster analysis, or as an intermediate step to facilitate other analyses.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Having the following stats: - $X \sim Uniform(0,1)$ - $Y \sim Uniform(0,1)$ - $Z = X/2 + Y/2 + 0.1$ - $K = Y + 0.1$ What are the expected values and the variance of 𝑋, 𝑌, 𝑍, and 𝐾?
We can model our uncertainty of x {\displaystyle x} by an aprior uniform distribution over an interval {\displaystyle } , and thus x {\displaystyle x} will have variance of σ X 2 = x 0 2 / 3. {\displaystyle \sigma _{X}^{2}=x_{0}^{2}/3.} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Having the following stats: - $X \sim Uniform(0,1)$ - $Y \sim Uniform(0,1)$ - $Z = X/2 + Y/2 + 0.1$ - $K = Y + 0.1$ What are the expected values and the variance of 𝑋, 𝑌, 𝑍, and 𝐾?
The expected value is: E ⁡ ( X ( k ) ) = k n + 1 . {\displaystyle \operatorname {E} (X_{(k)})={k \over n+1}.} This fact is useful when making Q–Q plots. The variance is: V ⁡ ( X ( k ) ) = k ( n − k + 1 ) ( n + 1 ) 2 ( n + 2 ) . {\displaystyle \operatorname {V} (X_{(k)})={k(n-k+1) \over (n+1)^{2}(n+2)}.}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When are paired t-tests helpful? Justify.
Paired samples t-tests typically consist of a sample of matched pairs of similar units, or one group of units that has been tested twice (a "repeated measures" t-test). A typical example of the repeated measures t-test would be where subjects are tested prior to a treatment, say for high blood pressure, and the same subjects are tested again after treatment with a blood-pressure-lowering medication. By comparing the same patient's numbers before and after treatment, we are effectively using each patient as their own control. That way the correct rejection of the null hypothesis (here: of no difference made by the treatment) can become much more likely, with statistical power increasing simply because the random interpatient variation has now been eliminated.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When are paired t-tests helpful? Justify.
Testing cycle time is reduced and analysis is simpler. Test cases are balanced, so it's straightforward to isolate defects and assess performance. This provides a significant cost savings over pair-wise testing.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Mean Square Error loss:
For the squared error loss case, the result is δ ( x ) = ∫ − ∞ ∞ θ f ( x 1 − θ , … , x n − θ ) d θ ∫ − ∞ ∞ f ( x 1 − θ , … , x n − θ ) d θ . {\displaystyle \delta (x)={\frac {\int _{-\infty }^{\infty }\theta f(x_{1}-\theta ,\dots ,x_{n}-\theta )d\theta }{\int _{-\infty }^{\infty }f(x_{1}-\theta ,\dots ,x_{n}-\theta )d\theta }}.}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Mean Square Error loss:
The use of mean squared error without question has been criticized by the decision theorist James Berger. Mean squared error is the negative of the expected value of one specific utility function, the quadratic utility function, which may not be the appropriate utility function to use under a given set of circumstances. There are, however, some scenarios where mean squared error can serve as a good approximation to a loss function occurring naturally in an application.Like variance, mean squared error has the disadvantage of heavily weighting outliers. This is a result of the squaring of each term, which effectively weights large errors more heavily than small ones. This property, undesirable in many applications, has led researchers to use alternatives such as the mean absolute error, or those based on the median.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You need to debug your Stochastic Gradient Descent update for a classification of three bridge types. Manually compute the model output for the feature vector $x=(1, 0, 0, 0, 0)$ and $W$ contains only zeros. The model is logistic regression, \textit{i.e.}, $\textrm{softmax}(Wx)$. Remember: \begin{equation} \textrm{softmax}_i(s) = \frac{e^{s_i}}{\sum_k e^{s_k}} \end{equation} (One answer!!!!!!)
Lasso, elastic net, group and fused lasso construct the penalty functions from the ℓ 1 {\displaystyle \ell ^{1}} and ℓ 2 {\displaystyle \ell ^{2}} norms (with weights, if necessary). The bridge regression utilises general ℓ p {\displaystyle \ell ^{p}} norms ( p ≥ 1 {\displaystyle p\geq 1} ) and quasinorms ( 0 < p < 1 {\displaystyle 0
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You need to debug your Stochastic Gradient Descent update for a classification of three bridge types. Manually compute the model output for the feature vector $x=(1, 0, 0, 0, 0)$ and $W$ contains only zeros. The model is logistic regression, \textit{i.e.}, $\textrm{softmax}(Wx)$. Remember: \begin{equation} \textrm{softmax}_i(s) = \frac{e^{s_i}}{\sum_k e^{s_k}} \end{equation} (One answer!!!!!!)
A global optimum is guaranteed because the objective function is convex. The gradient of log likelihood is represented by: ∂ L ( w ) ∂ w = ∑ i ϕ ( x i , y i ) − E p ( y | x i ; w ) ϕ ( x i , y ) {\displaystyle {\frac {\partial L(w)}{\partial w}}=\textstyle \sum _{i}\displaystyle \phi (x^{i},y^{i})-E_{p(y|x^{i};w)}\phi (x^{i},y)} where E p ( y | x i ; w ) {\displaystyle E_{p(y|x^{i};w)}} is the expectation of p ( y | x i ; w ) {\displaystyle p(y|x^{i};w)} . The above method will provide efficient computation for the relative small number of classification.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For this homework you will use a dataset of 18,403 music reviews scraped from Pitchfork¹, including relevant metadata such as review author, review date, record release year, review score, and genre, along with the respective album's audio features pulled from Spotify's API. The data consists of the following columns: artist, album, recordlabel, releaseyear, score, reviewauthor, reviewdate, genre, key, acousticness, danceability, energy, instrumentalness, liveness, loudness, speechiness, valence, tempo. Create a new column 'album_number' which indicates how many albums the artist has produced before this one (before the second album, the artist has already produced one album).
The main idea of the website is to allow the users to add albums, EPs, singles, videos and bootlegs to the database and to rate them. The rating system uses a scale of minimum a half-star (or 0.5 points) to maximum five stars (or 5 points). Users can likewise leave reviews for RYM entries as well as create user profiles. Rate Your Music is generated jointly by the registered user community (artists, releases, biographies, etc.); however, the majority of new, edited content must be approved by a moderator to prevent virtual vandalism.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For this homework you will use a dataset of 18,403 music reviews scraped from Pitchfork¹, including relevant metadata such as review author, review date, record release year, review score, and genre, along with the respective album's audio features pulled from Spotify's API. The data consists of the following columns: artist, album, recordlabel, releaseyear, score, reviewauthor, reviewdate, genre, key, acousticness, danceability, energy, instrumentalness, liveness, loudness, speechiness, valence, tempo. Create a new column 'album_number' which indicates how many albums the artist has produced before this one (before the second album, the artist has already produced one album).
Automatic methods of musical similarity detection, based on data mining and co-occurrence analysis, have been developed to classify music titles for electronic music distribution.Glenn McDonald, the employee of The Echo Nest, music intelligence and data platform, owned by Spotify, has created a categorical perception spectrum of genres and subgenres based on "an algorithmically generated, readability-adjusted scatter-plot of the musical genre-space, based on data tracked and analyzed for 5,315 genre-shaped distinctions by Spotify" called Every Noise at Once.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following PyTorch code: class ThreeLayerNet (nn.Module): def __init__(): super().__init__() def forward(x): x = nn.Linear(100, 10)(x) x = nn.ReLU()(x) x = nn.Linear(10, 200)(x) x = nn.ReLU()(x) x = nn.Linear(200, 1)(x) return x Suppose that inputs are 100-dimensional, and outputs are 1-dimensional. What will happen if we try to train this network?
BRNNs can be trained using similar algorithms to RNNs, because the two directional neurons do not have any interactions. However, when back-propagation through time is applied, additional processes are needed because updating input and output layers cannot be done at once. General procedures for training are as follows: For forward pass, forward states and backward states are passed first, then output neurons are passed. For backward pass, output neurons are passed first, then forward states and backward states are passed next. After forward and backward passes are done, the weights are updated.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following PyTorch code: class ThreeLayerNet (nn.Module): def __init__(): super().__init__() def forward(x): x = nn.Linear(100, 10)(x) x = nn.ReLU()(x) x = nn.Linear(10, 200)(x) x = nn.ReLU()(x) x = nn.Linear(200, 1)(x) return x Suppose that inputs are 100-dimensional, and outputs are 1-dimensional. What will happen if we try to train this network?
Pseudocode for a stochastic gradient descent algorithm for training a three-layer network (one hidden layer): initialize network weights (often small random values) do for each training example named ex do prediction = neural-net-output(network, ex) // forward pass actual = teacher-output(ex) compute error (prediction - actual) at the output units compute Δ w h {\displaystyle \Delta w_{h}} for all weights from hidden layer to output layer // backward pass compute Δ w i {\displaystyle \Delta w_{i}} for all weights from input layer to hidden layer // backward pass continued update network weights // input layer not modified by error estimate until error rate becomes acceptably low return the network The lines labeled "backward pass" can be implemented using the backpropagation algorithm, which calculates the gradient of the error of the network regarding the network's modifiable weights. == References ==
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Does the disparity in class proportions hurt the model? If yes, how can you fix it? If not, justify the reasons behind your choice. Hint: The learning objective of a classifier can be modified by altering the importance of each class in the computation of the loss function. Based you answer on the following confusion matrix: |precision | recall | f1-score | support| |-|-|-|-| | 0 | 0.973 | 0.997 | 0.985 | 330| | 1 | 0.750 | 0.250 | 0.375 | 12|
Deviations from the identity function indicate a poorly-calibrated classifier for which the predicted probabilities or scores can not be used as probabilities. In this case one can use a method to turn these scores into properly calibrated class membership probabilities. For the binary case, a common approach is to apply Platt scaling, which learns a logistic regression model on the scores. An alternative method using isotonic regression is generally superior to Platt's method when sufficient training data is available.In the multiclass case, one can use a reduction to binary tasks, followed by univariate calibration with an algorithm as described above and further application of the pairwise coupling algorithm by Hastie and Tibshirani.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Does the disparity in class proportions hurt the model? If yes, how can you fix it? If not, justify the reasons behind your choice. Hint: The learning objective of a classifier can be modified by altering the importance of each class in the computation of the loss function. Based you answer on the following confusion matrix: |precision | recall | f1-score | support| |-|-|-|-| | 0 | 0.973 | 0.997 | 0.985 | 330| | 1 | 0.750 | 0.250 | 0.375 | 12|
You ran a classification on the same dataset which led to the following values for the confusion matrix categories: TP = 90, FP = 4; TN = 1, FN = 5.In this example, the classifier has performed well in classifying positive instances, but was not able to correctly recognize negative data elements. Again, the resulting F1 score and accuracy scores would be extremely high: accuracy = 91%, and F1 score = 95.24%. Similarly to the previous case, if a researcher analyzed only these two score indicators, without considering the MCC, they would wrongly think the algorithm is performing quite well in its task, and would have the illusion of being successful.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Write modular code (i.e., a function) to divide your training data into 𝑁 folds and perform cross-validation. For each possible combination of the two hyperparameters (see below for the range of values that you should try for each hyperparameter), train your model in a cross-validation setup with 𝑁=20 folds.
In 2-fold cross-validation, we randomly shuffle the dataset into two sets d0 and d1, so that both sets are equal size (this is usually implemented by shuffling the data array and then splitting it in two). We then train on d0 and validate on d1, followed by training on d1 and validating on d0. When k = n (the number of observations), k-fold cross-validation is equivalent to leave-one-out cross-validation.In stratified k-fold cross-validation, the partitions are selected so that the mean response value is approximately equal in all the partitions.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Write modular code (i.e., a function) to divide your training data into 𝑁 folds and perform cross-validation. For each possible combination of the two hyperparameters (see below for the range of values that you should try for each hyperparameter), train your model in a cross-validation setup with 𝑁=20 folds.
In 2-fold cross-validation, we randomly shuffle the dataset into two sets d0 and d1, so that both sets are equal size (this is usually implemented by shuffling the data array and then splitting it in two). We then train on d0 and validate on d1, followed by training on d1 and validating on d0. When k = n (the number of observations), k-fold cross-validation is equivalent to leave-one-out cross-validation.In stratified k-fold cross-validation, the partitions are selected so that the mean response value is approximately equal in all the partitions.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are using a 3-layer fully-connected neural net with \textbf{ReLU activations}. Your input data has components in [0, 1]. \textbf{You initialize your weights by sampling from $\mathcal{N}(-10, 0.1)$ (Gaussians of mean -10 and variance 0.1)}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
This is particularly helpful when training data are limited, because poorly initialized weights can significantly hinder learning. These pre-trained weights end up in a region of the weight space that is closer to the optimal weights than random choices. This allows for both improved modeling and faster ultimate convergence.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
You are using a 3-layer fully-connected neural net with \textbf{ReLU activations}. Your input data has components in [0, 1]. \textbf{You initialize your weights by sampling from $\mathcal{N}(-10, 0.1)$ (Gaussians of mean -10 and variance 0.1)}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
Weight initialization is another approach that has been proposed to reduce the vanishing gradient problem in deep networks. Kumar suggested that the distribution of initial weights should vary according to activation function used and proposed to initialize the weights in networks with the logistic activation function using a Gaussian distribution with a zero mean and a standard deviation of 3.6/sqrt(N), where N is the number of neurons in a layer.Recently, Yilmaz and Poli performed a theoretical analysis on how gradients are affected by the mean of the initial weights in deep neural networks using the logistic activation function and found that gradients do not vanish if the mean of the initial weights is set according to the formula: max(−1,-8/N). This simple strategy allows networks with 10 or 15 hidden layers to be trained very efficiently and effectively using the standard backpropagation.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The data contains information about submissions to a prestigious machine learning conference called ICLR. Columns: year, paper, authors, ratings, decisions, institution, csranking, categories, authors_citations, authors_publications, authors_hindex, arxiv. The data is stored in a pandas.DataFrame format. Create two fields called has_top_company and has_top_institution. The field has_top_company equals 1 if the article contains an author in the following list of companies ["Facebook", "Google", "Microsoft", "Deepmind"], and 0 otherwise. The field has_top_institution equals 1 if the article contains an author in the top 10 institutions according to CSRankings.
pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series. It is free software released under the three-clause BSD license.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The data contains information about submissions to a prestigious machine learning conference called ICLR. Columns: year, paper, authors, ratings, decisions, institution, csranking, categories, authors_citations, authors_publications, authors_hindex, arxiv. The data is stored in a pandas.DataFrame format. Create two fields called has_top_company and has_top_institution. The field has_top_company equals 1 if the article contains an author in the following list of companies ["Facebook", "Google", "Microsoft", "Deepmind"], and 0 otherwise. The field has_top_institution equals 1 if the article contains an author in the top 10 institutions according to CSRankings.
For example, this “fractional count” (FC) received by each author would be 0.1 for an article with 10 authors. If an author is affiliated with more than one institution, that author’s FC is then subdivided equally across their affiliated institutions. The process is similar for countries and regions, though the fact that some institutions have overseas labs makes the process more complicated, with such labs being counted towards their appropriate host countries.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Interpreting the results obtained throughout this homework, create a short text (max. 250 words) where you: Present and explain a credible causal diagram capturing the relationship between the variables below, and justify your causal diagram given the questions answered in this homework: "Skill": an individual's innate talent towards a sport. "Relative Age": how old an individual was in comparison to his or her peers. "Success before adulthood": how successful the individual is as an athlete as a child/teenager. "Success as an adult": how successful the individual is as an athlete as an adult. Discuss: Consider two equally successful children athletes, one born on March 31 and the other on April 1 — which will likely be more successful as an adult? Your answer should be consistent with your causal diagram.
Relative age effects are caused by birth date eligibility rules but can be affected by parents, coaches and athletes through other mechanisms, the Pygmalian effect, Galatea effect, and Matthew effect are examples of effects which impact player motivation.In addition to these social factors contextual differences change the distribution with decreased effects in female sports, unpopular sports, at different ages, individual sports or sports with a lower reliance on body size with an expected increased effect in male sports, popular sports, or competitive sports. The sports popularity in a geographical or cultural area will affect the relative age distribution relative with examples seen in Volleyball, and American football.The early maturation levels giving physical advantages to first quarter individuals can create the bias seen in players height in Basketball, dominant hand in Tennis, or size in a Cricket position, but physical size isn't always the cause. The older individuals also gaining more competence and self-efficacy increasing the performance gap, these advantages leading to increased dropout rates for Q1 births. However, the bias for sports where height and mass impedes flexibility, rotational speed and the strength to mass ratio, maturational delay may be preferred as seen in Gymnastics.With an adult group the relative age has the opposite meaning, as performance declines in age and is more significant with more physically demanding sports, depending on what age the average peak performance level is, in that sport. The "underdog effect" has shown that those late birth individuals may see better chances if they are selected to play, with the advantage decreasing after selection.Playing position, federation membership, and individual and team performance also contribute to the effect with older players having a higher risk of injury.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Interpreting the results obtained throughout this homework, create a short text (max. 250 words) where you: Present and explain a credible causal diagram capturing the relationship between the variables below, and justify your causal diagram given the questions answered in this homework: "Skill": an individual's innate talent towards a sport. "Relative Age": how old an individual was in comparison to his or her peers. "Success before adulthood": how successful the individual is as an athlete as a child/teenager. "Success as an adult": how successful the individual is as an athlete as an adult. Discuss: Consider two equally successful children athletes, one born on March 31 and the other on April 1 — which will likely be more successful as an adult? Your answer should be consistent with your causal diagram.
Attribution theory has been applied to a variety of sports and exercise contexts, such as children's motivation for physical activity and African soccer, where attributions are placed toward magic and rituals, such as what magicians are consulted before the game begins, rather than the technical and mechanical aspects of playing football.Using Heider's classifications for causal attribution, being the locus of causality, stability, and controllability is another way to explain Attribution theory's role in health. Older women make up the largest percentage of inactive people due to health reasons. A study was conducted to explain the factors behind low motivation in older women. This study was made up of 37 elderly women with a mean age of 80.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Calculate the mean of individuals who remain alive in the data. The data is stored in a pandas.DataFrame and the respective column is "alive".
For an extinct or completed cohort (all people born in the year 1850, for example), it can of course simply be calculated by averaging the ages at death. For cohorts with some survivors, it is estimated by using mortality experience in recent years. The estimates are called period cohort life expectancies.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Calculate the mean of individuals who remain alive in the data. The data is stored in a pandas.DataFrame and the respective column is "alive".
The form of the estimator stated at the beginning of the article can be obtained by some further algebra. For this, write q ^ ( s ) = 1 − d ( s ) / n ( s ) {\displaystyle {\hat {q}}(s)=1-d(s)/n(s)} where, using the actuarial science terminology, d ( s ) = | { 1 ≤ k ≤ n: τ k = s } | {\displaystyle d(s)=|\{1\leq k\leq n\,:\,\tau _{k}=s\}|} is the number of known deaths at time s {\displaystyle s} , while n ( s ) = | { 1 ≤ k ≤ n: τ ~ k ≥ s } | {\displaystyle n(s)=|\{1\leq k\leq n\,:\,{\tilde {\tau }}_{k}\geq s\}|} is the number of those persons who are alive (and not being censored) at time s − 1 {\displaystyle s-1} . Note that if d ( s ) = 0 {\displaystyle d(s)=0} , q ^ ( s ) = 1 {\displaystyle {\hat {q}}(s)=1} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For this homework you will use a dataset of 18,403 music reviews scraped from Pitchfork¹, including relevant metadata such as review author, review date, record release year, review score, and genre, along with the respective album's audio features pulled from Spotify's API. The data consists of the following columns: artist, album, recordlabel, releaseyear, score, reviewauthor, reviewdate, genre, key, acousticness, danceability, energy, instrumentalness, liveness, loudness, speechiness, valence, tempo. Create a new dataframe containing one row per 1st-2nd album pair. The dataframe should contain rows: score_diff: the difference in scores between the second and the first album (second - first). time_diff: the number of days elapsed between the first and the second album. did_style_change: a dummy variable that indicates whether the style of the music has changed. To obtain it, first, calculate the standardized euclidean distance of music-related numerical features¹ between the second and the first album. Second, assign 1 to the 20% most distant 1st-2nd album pairs and 0 to all others.
Style modeling implies building a computational representation of the musical surface that captures important stylistic features from data. Statistical approaches are used to capture the redundancies in terms of pattern dictionaries or repetitions, which are later recombined to generate new musical data. Style mixing can be realized by analysis of a database containing multiple musical examples in different styles.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For this homework you will use a dataset of 18,403 music reviews scraped from Pitchfork¹, including relevant metadata such as review author, review date, record release year, review score, and genre, along with the respective album's audio features pulled from Spotify's API. The data consists of the following columns: artist, album, recordlabel, releaseyear, score, reviewauthor, reviewdate, genre, key, acousticness, danceability, energy, instrumentalness, liveness, loudness, speechiness, valence, tempo. Create a new dataframe containing one row per 1st-2nd album pair. The dataframe should contain rows: score_diff: the difference in scores between the second and the first album (second - first). time_diff: the number of days elapsed between the first and the second album. did_style_change: a dummy variable that indicates whether the style of the music has changed. To obtain it, first, calculate the standardized euclidean distance of music-related numerical features¹ between the second and the first album. Second, assign 1 to the 20% most distant 1st-2nd album pairs and 0 to all others.
It tracks styles, genres, and subgenres, along with the tone of the music and the platforms on which the music is sold. It then connects that data together, in a way that can intelligently tell you about an entire type of music, whether a massive genre like classical, or a tiny one like sadcore.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Your friend Charlie was training a neural net, and observed something very curious. During training, the same network, with the same exact weights, doesn't always give the same prediction for a given example. What can cause this behavior?
Neural networks learn (or are trained) by processing examples, each of which contains a known "input" and "result", forming probability-weighted associations between the two, which are stored within the data structure of the net itself. The training of a neural network from a given example is usually conducted by determining the difference between the processed output of the network (often a prediction) and a target output. This difference is the error. The network then adjusts its weighted associations according to a learning rule and using this error value.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Your friend Charlie was training a neural net, and observed something very curious. During training, the same network, with the same exact weights, doesn't always give the same prediction for a given example. What can cause this behavior?
That is to say that given the same input stimulus, you will not get the same output from the network. The dynamics of these networks are governed by probabilities so we treat them as stochastic (random) processes so that we can capture these kinds of dynamics between different areas of the brain.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We saw in class that we can quickly decrease the spatial size of the representation using pooling layers. Is there another way to do this without pooling?
A major drawback to Dropout is that it does not have the same benefits for convolutional layers, where the neurons are not fully connected. Even before Dropout, in 2013 a technique called stochastic pooling, the conventional deterministic pooling operations were replaced with a stochastic procedure, where the activation within each pooling region is picked randomly according to a multinomial distribution, given by the activities within the pooling region. This approach is free of hyperparameters and can be combined with other regularization approaches, such as dropout and data augmentation. An alternate view of stochastic pooling is that it is equivalent to standard max pooling but with many copies of an input image, each having small local deformations. This is similar to explicit elastic deformations of the input images, which delivers excellent performance on the MNIST data set. Using stochastic pooling in a multilayer model gives an exponential number of deformations since the selections in higher layers are independent of those below.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We saw in class that we can quickly decrease the spatial size of the representation using pooling layers. Is there another way to do this without pooling?
Pooling: In a CNN's pooling layers, feature maps are divided into rectangular sub-regions, and the features in each rectangle are independently down-sampled to a single value, commonly by taking their average or maximum value. In addition to reducing the sizes of feature maps, the pooling operation grants a degree of local translational invariance to the features contained therein, allowing the CNN to be more robust to variations in their positions.Together, these properties allow CNNs to achieve better generalization on vision problems. Weight sharing dramatically reduces the number of free parameters learned, thus lowering the memory requirements for running the network and allowing the training of larger, more powerful networks.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The \textbf{parameters} (weights \textbf{W}) are learned with ... (One answer)
In "prefix-tuning" or "prompt tuning", floating-point-valued vectors are searched directly by gradient descent, to maximize the log-probability on outputs. Formally, let E = { e 1 , … , e k } {\displaystyle \mathbf {E} =\{\mathbf {e_{1}} ,\dots ,\mathbf {e_{k}} \}} be a set of soft prompt tokens (tunable embeddings), while X = { x 1 , … , x m } {\displaystyle \mathbf {X} =\{\mathbf {x_{1}} ,\dots ,\mathbf {x_{m}} \}} and Y = { y 1 , … , y n } {\displaystyle \mathbf {Y} =\{\mathbf {y_{1}} ,\dots ,\mathbf {y_{n}} \}} be the token embeddings of the input and output respectively. During training, the tunable embeddings, input, and output tokens are concatenated into a single sequence concat ( E ; X ; Y ) {\displaystyle {\text{concat}}(\mathbf {E} ;\mathbf {X} ;\mathbf {Y} )} , and fed to the large language models (LLM). The losses are computed over the Y {\displaystyle \mathbf {Y} } tokens; the gradients are backpropagated to prompt-specific parameters: in prefix-tuning, they are parameters associated with the prompt tokens at each layer; in prompt tuning, they are merely the soft tokens added to the vocabulary.With more math details, let an LLM be written as L L M ( X ) = F ( E ( X ) ) {\displaystyle LLM(X)=F(E(X))} , where X {\displaystyle X} is a sequence of linguistic tokens, E {\displaystyle E} is the token-to-vector function, and F {\displaystyle F} is the rest of the model.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The \textbf{parameters} (weights \textbf{W}) are learned with ... (One answer)
In supervised learning, a sequence of training examples ( x 1 , y 1 ) , … , ( x p , y p ) {\displaystyle (x_{1},y_{1}),\dots ,(x_{p},y_{p})} produces a sequence of weights w 0 , w 1 , … , w p {\displaystyle w_{0},w_{1},\dots ,w_{p}} starting from some initial weight w 0 {\displaystyle w_{0}} , usually chosen at random. These weights are computed in turn: first compute w i {\displaystyle w_{i}} using only ( x i , y i , w i − 1 ) {\displaystyle (x_{i},y_{i},w_{i-1})} for i = 1 , … , p {\displaystyle i=1,\dots ,p} . The output of the algorithm is then w p {\displaystyle w_{p}} , giving a new function x ↦ f N ( w p , x ) {\displaystyle x\mapsto f_{N}(w_{p},x)} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The \textbf{hyperparameters} are learned with ... (One answer)
The traditional way of performing hyperparameter optimization has been grid search, or a parameter sweep, which is simply an exhaustive searching through a manually specified subset of the hyperparameter space of a learning algorithm. A grid search algorithm must be guided by some performance metric, typically measured by cross-validation on the training set or evaluation on a hold-out validation set.Since the parameter space of a machine learner may include real-valued or unbounded value spaces for certain parameters, manually set bounds and discretization may be necessary before applying grid search. For example, a typical soft-margin SVM classifier equipped with an RBF kernel has at least two hyperparameters that need to be tuned for good performance on unseen data: a regularization constant C and a kernel hyperparameter γ. Both parameters are continuous, so to perform grid search, one selects a finite set of "reasonable" values for each, say C ∈ { 10 , 100 , 1000 } {\displaystyle C\in \{10,100,1000\}} γ ∈ { 0.1 , 0.2 , 0.5 , 1.0 } {\displaystyle \gamma \in \{0.1,0.2,0.5,1.0\}} Grid search then trains an SVM with each pair (C, γ) in the Cartesian product of these two sets and evaluates their performance on a held-out validation set (or by internal cross-validation on the training set, in which case multiple SVMs are trained per pair). Finally, the grid search algorithm outputs the settings that achieved the highest score in the validation procedure. Grid search suffers from the curse of dimensionality, but is often embarrassingly parallel because the hyperparameter settings it evaluates are typically independent of each other.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The \textbf{hyperparameters} are learned with ... (One answer)
Sometimes, hyperparameters cannot be learned from the training data because they aggressively increase the capacity of a model and can push the loss function to an undesired minimum (overfitting to, and picking up noise in the data), as opposed to correctly mapping the richness of the structure in the data. For example, if we treat the degree of a polynomial equation fitting a regression model as a trainable parameter, the degree would increase until the model perfectly fit the data, yielding low training error, but poor generalization performance.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We report the final performance (e.g., accuracy) on the ... (One answer)
The cycle is repeated, finishing with a final workshop. At this stage the Participants are requested to submit not their self reported results, but the actual executables (or SDKs) to their algorithms. The Challenge Team then runs these algorithms through a battery of tests on large sequestered datasets. This phase ultimately determines the performance levels of the participant’s algorithms. A final report is issued by the Team which is used by Industries and Governments to determine the actual state of the art in a given field and to provide participating organizations a basis for showing their performance within that field.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We report the final performance (e.g., accuracy) on the ... (One answer)
Some were told that their early guesses were accurate. Others were told that their successes were distributed evenly through the thirty trials. Afterwards, they were surveyed about their performance.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following matrix-factorization problem. For the observed ratings $r_{u m}$ for a given pair $(u, m)$ of a user $u$ and a movie $m$, one typically tries to estimate the score by $$ f_{u m}=\left\langle\mathbf{v}_{u}, \mathbf{w}_{m}\right\rangle+b_{u}+b_{m} $$ Here $\mathbf{v}_{u}$ and $\mathbf{w}_{m}$ are vectors in $\mathbb{R}^{D}$ and $b_{u}$ and $b_{m}$ are scalars, indicating the bias. How could you address the problem of potentially recommending a new movie without any ratings to users? [As in the previous point, this is also not a math question.]
After the most like-minded users are found, their corresponding ratings are aggregated to identify the set of items to be recommended to the target user. The most important disadvantage of taking context into recommendation model is to be able to deal with larger dataset that contains much more missing values in comparison to user-item rating matrix. Therefore, similar to matrix factorization methods, tensor factorization techniques can be used to reduce dimensionality of original data before using any neighborhood-based methods.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following matrix-factorization problem. For the observed ratings $r_{u m}$ for a given pair $(u, m)$ of a user $u$ and a movie $m$, one typically tries to estimate the score by $$ f_{u m}=\left\langle\mathbf{v}_{u}, \mathbf{w}_{m}\right\rangle+b_{u}+b_{m} $$ Here $\mathbf{v}_{u}$ and $\mathbf{w}_{m}$ are vectors in $\mathbb{R}^{D}$ and $b_{u}$ and $b_{m}$ are scalars, indicating the bias. How could you address the problem of potentially recommending a new movie without any ratings to users? [As in the previous point, this is also not a math question.]
Specifically, the predicted rating user u will give to item i is computed as: r ~ u i = ∑ f = 0 n f a c t o r s H u , f W f , i {\displaystyle {\tilde {r}}_{ui}=\sum _{f=0}^{nfactors}H_{u,f}W_{f,i}} It is possible to tune the expressive power of the model by changing the number of latent factors. It has been demonstrated that a matrix factorization with one latent factor is equivalent to a most popular or top popular recommender (e.g. recommends the items with the most interactions without any personalization). Increasing the number of latent factors will improve personalization, therefore recommendation quality, until the number of factors becomes too high, at which point the model starts to overfit and the recommendation quality will decrease.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a classification problem on linearly separable data. We train an SVM model and a logistic regression model. For logistic regression (LR) we add a small regularization term (penalty on weights) in order to make the optimum well-defined. Each model gives us a margin. Consider a datapoint $\mathbf{x}_{0}$ that is correctly classified and strictly outside both margins Which one of the following statements is incorrect ?
Recall that the (soft-margin) SVM classifier w ^ , b: x ↦ sgn ⁡ ( w ^ T x − b ) {\displaystyle {\hat {\mathbf {w} }},b:\mathbf {x} \mapsto \operatorname {sgn}({\hat {\mathbf {w} }}^{\mathsf {T}}\mathbf {x} -b)} is chosen to minimize the following expression: In light of the above discussion, we see that the SVM technique is equivalent to empirical risk minimization with Tikhonov regularization, where in this case the loss function is the hinge loss From this perspective, SVM is closely related to other fundamental classification algorithms such as regularized least-squares and logistic regression. The difference between the three lies in the choice of loss function: regularized least-squares amounts to empirical risk minimization with the square-loss, ℓ s q ( y , z ) = ( y − z ) 2 {\displaystyle \ell _{sq}(y,z)=(y-z)^{2}} ; logistic regression employs the log-loss,
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a classification problem on linearly separable data. We train an SVM model and a logistic regression model. For logistic regression (LR) we add a small regularization term (penalty on weights) in order to make the optimum well-defined. Each model gives us a margin. Consider a datapoint $\mathbf{x}_{0}$ that is correctly classified and strictly outside both margins Which one of the following statements is incorrect ?
For proper loss functions, the loss margin can be defined as μ ϕ = − ϕ ′ ( 0 ) ϕ ″ ( 0 ) {\displaystyle \mu _{\phi }=-{\frac {\phi '(0)}{\phi ''(0)}}} and shown to be directly related to the regularization properties of the classifier. Specifically a loss function of larger margin increases regularization and produces better estimates of the posterior probability. For example, the loss margin can be increased for the logistic loss by introducing a γ {\displaystyle \gamma } parameter and writing the logistic loss as 1 γ log ⁡ ( 1 + e − γ v ) {\displaystyle {\frac {1}{\gamma }}\log(1+e^{-\gamma v})} where smaller 0 < γ < 1 {\displaystyle 0<\gamma <1} increases the margin of the loss. It is shown that this is directly equivalent to decreasing the learning rate in gradient boosting F m ( x ) = F m − 1 ( x ) + γ h m ( x ) , {\displaystyle F_{m}(x)=F_{m-1}(x)+\gamma h_{m}(x),} where decreasing γ {\displaystyle \gamma } improves the regularization of the boosted classifier. The theory makes it clear that when a learning rate of γ {\displaystyle \gamma } is used, the correct formula for retrieving the posterior probability is now η = f − 1 ( γ F ( x ) ) {\displaystyle \eta =f^{-1}(\gamma F(x))} . In conclusion, by choosing a loss function with larger margin (smaller γ {\displaystyle \gamma } ) we increase regularization and improve our estimates of the posterior probability which in turn improves the ROC curve of the final classifier.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a learning algorithm that has the property that it depends only very weakly on the input data. E.g., this could be SGD where we choose a very small step size and only run for very few iterations. To go to the extreme, you can imagine a learning algorithm that always outputs the same model irrespective of the training set. Presumably such a learning algorithm will not give us good results. Why is that?
This is particularly helpful when training data are limited, because poorly initialized weights can significantly hinder learning. These pre-trained weights end up in a region of the weight space that is closer to the optimal weights than random choices. This allows for both improved modeling and faster ultimate convergence.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a learning algorithm that has the property that it depends only very weakly on the input data. E.g., this could be SGD where we choose a very small step size and only run for very few iterations. To go to the extreme, you can imagine a learning algorithm that always outputs the same model irrespective of the training set. Presumably such a learning algorithm will not give us good results. Why is that?
To achieve this, the learning algorithm is presented some training examples that demonstrate the intended relation of input and output values. Then the learner is supposed to approximate the correct output, even for examples that have not been shown during training. Without any additional assumptions, this problem cannot be solved since unseen situations might have an arbitrary output value.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the Poisson distribution with parameter $\lambda$. It has a probability mass function given by $p(i)=\frac{\lambda^{i} e^{-\lambda}}{i !}$, $i=0,1, \cdots$ (i) Write $p(i)$ in the form of an exponential distribution $p(i)=h(i) e^{\eta \phi(i)-A(\eta)}$. Explicitly specify $h, \eta, \phi$, and $A(\eta)$ (ii) Compute $\frac{d A(\eta)}{d \eta}$ and $\frac{d^{2} A(\eta)}{d \eta^{2}}$ ? Is this the result you expected?
Given a set of parameters θ and an input vector x, the mean of the predicted Poisson distribution, as stated above, is given by λ := E ⁡ ( Y ∣ x ) = e θ ′ x , {\displaystyle \lambda :=\operatorname {E} (Y\mid x)=e^{\theta 'x},\,} and thus, the Poisson distribution's probability mass function is given by p ( y ∣ x ; θ ) = λ y y ! e − λ = e y θ ′ x e − e θ ′ x y ! {\displaystyle p(y\mid x;\theta )={\frac {\lambda ^{y}}{y! }}e^{-\lambda }={\frac {e^{y\theta 'x}e^{-e^{\theta 'x}}}{y!}}}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the Poisson distribution with parameter $\lambda$. It has a probability mass function given by $p(i)=\frac{\lambda^{i} e^{-\lambda}}{i !}$, $i=0,1, \cdots$ (i) Write $p(i)$ in the form of an exponential distribution $p(i)=h(i) e^{\eta \phi(i)-A(\eta)}$. Explicitly specify $h, \eta, \phi$, and $A(\eta)$ (ii) Compute $\frac{d A(\eta)}{d \eta}$ and $\frac{d^{2} A(\eta)}{d \eta^{2}}$ ? Is this the result you expected?
The Poisson family of distributions is parametrized by a single number λ > 0: P = { p λ ( j ) = λ j j ! e − λ , j = 0 , 1 , 2 , 3 , … | λ > 0 } , {\displaystyle {\mathcal {P}}={\Big \{}\ p_{\lambda }(j)={\tfrac {\lambda ^{j}}{j! }}e^{-\lambda },\ j=0,1,2,3,\dots \ {\Big |}\;\;\lambda >0\ {\Big \}},} where pλ is the probability mass function. This family is an exponential family.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We consider a classification problem on linearly separable data. Our dataset had an outlier---a point that is very far from the other datapoints in distance (and also far from margins in SVM but still correctly classified by the SVM classifier). We trained the SVM, logistic regression and 1-nearest-neighbour models on this dataset. We tested trained models on a test set that comes from the same distribution as training set, but doesn't have any outlier points. For any vector $ v \in \R^D$ let $\| v\|_2 := \sqrt{v_1^2 + \dots + v_D^2}$ denote the Euclidean norm. The hard-margin SVM problem for linearly separable points in $\R^D$ is to minimize the Euclidean norm $\| \wv \|_2$ under some constraints. What are the additional constraints for this optimization problem?
Computing the (soft-margin) SVM classifier amounts to minimizing an expression of the form We focus on the soft-margin classifier since, as noted above, choosing a sufficiently small value for λ {\displaystyle \lambda } yields the hard-margin classifier for linearly classifiable input data. The classical approach, which involves reducing (2) to a quadratic programming problem, is detailed below. Then, more recent approaches such as sub-gradient descent and coordinate descent will be discussed.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We consider a classification problem on linearly separable data. Our dataset had an outlier---a point that is very far from the other datapoints in distance (and also far from margins in SVM but still correctly classified by the SVM classifier). We trained the SVM, logistic regression and 1-nearest-neighbour models on this dataset. We tested trained models on a test set that comes from the same distribution as training set, but doesn't have any outlier points. For any vector $ v \in \R^D$ let $\| v\|_2 := \sqrt{v_1^2 + \dots + v_D^2}$ denote the Euclidean norm. The hard-margin SVM problem for linearly separable points in $\R^D$ is to minimize the Euclidean norm $\| \wv \|_2$ under some constraints. What are the additional constraints for this optimization problem?
Whereas the original problem may be stated in a finite-dimensional space, it often happens that the sets to discriminate are not linearly separable in that space. For this reason, it was proposed that the original finite-dimensional space be mapped into a much higher-dimensional space, presumably making the separation easier in that space. To keep the computational load reasonable, the mappings used by SVM schemes are designed to ensure that dot products of pairs of input data vectors may be computed easily in terms of the variables in the original space, by defining them in terms of a kernel function k ( x , y ) {\displaystyle k(x,y)} selected to suit the problem.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Fitting a Gaussian Mixture Model with a single Gaussian ($K=1$) will converge after one step of Expectation-Maximization.
However, the one-dimensional case has limited real world applications. Also, the convergence of the algorithm in higher dimensions with a finite number of the stationary (or isolated) points has been proved. However, sufficient conditions for a general kernel function to have finite stationary (or isolated) points have not been provided. Gaussian Mean-Shift is an Expectation–maximization algorithm.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Fitting a Gaussian Mixture Model with a single Gaussian ($K=1$) will converge after one step of Expectation-Maximization.
A more complex model will usually be able to explain the data better, which makes choosing the appropriate model complexity inherently difficult. One prominent method is known as Gaussian mixture models (using the expectation-maximization algorithm). Here, the data set is usually modeled with a fixed (to avoid overfitting) number of Gaussian distributions that are initialized randomly and whose parameters are iteratively optimized to better fit the data set.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The primal formulation of the soft-margin SVM is NOT equivalent to $\ell_2$ adversarial training for a linear model trained with the hinge loss ($\ell(z) = \max\{0, 1 - z\}$).
Computing the (soft-margin) SVM classifier amounts to minimizing an expression of the form We focus on the soft-margin classifier since, as noted above, choosing a sufficiently small value for λ {\displaystyle \lambda } yields the hard-margin classifier for linearly classifiable input data. The classical approach, which involves reducing (2) to a quadratic programming problem, is detailed below. Then, more recent approaches such as sub-gradient descent and coordinate descent will be discussed.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The primal formulation of the soft-margin SVM is NOT equivalent to $\ell_2$ adversarial training for a linear model trained with the hinge loss ($\ell(z) = \max\{0, 1 - z\}$).
Consider a binary classification problem with a dataset (x1, y1), ..., (xn, yn), where xi is an input vector and yi ∈ {-1, +1} is a binary label corresponding to it. A soft-margin support vector machine is trained by solving a quadratic programming problem, which is expressed in the dual form as follows: max α ∑ i = 1 n α i − 1 2 ∑ i = 1 n ∑ j = 1 n y i y j K ( x i , x j ) α i α j , {\displaystyle \max _{\alpha }\sum _{i=1}^{n}\alpha _{i}-{\frac {1}{2}}\sum _{i=1}^{n}\sum _{j=1}^{n}y_{i}y_{j}K(x_{i},x_{j})\alpha _{i}\alpha _{j},} subject to: 0 ≤ α i ≤ C , for i = 1 , 2 , … , n , {\displaystyle 0\leq \alpha _{i}\leq C,\quad {\mbox{ for }}i=1,2,\ldots ,n,} ∑ i = 1 n y i α i = 0 {\displaystyle \sum _{i=1}^{n}y_{i}\alpha _{i}=0} where C is an SVM hyperparameter and K(xi, xj) is the kernel function, both supplied by the user; and the variables α i {\displaystyle \alpha _{i}} are Lagrange multipliers.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus