question
stringlengths
6
3.53k
text
stringlengths
17
2.05k
source
stringclasses
1 value
Which of the following is wrong regarding Ontologies?
Many of those who doubt the possibility of developing wide agreement on a common upper ontology fall into one of two traps: they assert that there is no possibility of universal agreement on any conceptual scheme; but they argue that a practical common ontology does not need to have universal agreement, it only needs a large enough user community (as is the case for human languages) to make it profitable for developers to use it as a means to general interoperability, and for third-party developer to develop utilities to make it easier to use; and they point out that developers of data schemes find different representations congenial for their local purposes; but they do not demonstrate that these different representations are in fact logically inconsistent.In fact, different representations of assertions about the real world (though not philosophical models), if they accurately reflect the world, must be logically consistent, even if they focus on different aspects of the same physical object or phenomenon. If any two assertions about the real world are logically inconsistent, one or both must be wrong, and that is a topic for experimental investigation, not for ontological representation. In practice, representations of the real world are created as and known to be approximations to the basic reality, and their use is circumscribed by the limits of error of measurements in any given practical application. Ontologies are entirely capable of representing approximations, and are also capable of representing situations in which different approximations have different utility.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following is wrong regarding Ontologies?
Many of those who doubt the possibility of developing wide agreement on a common upper ontology fall into one of two traps: they assert that there is no possibility of universal agreement on any conceptual scheme; but they argue that a practical common ontology does not need to have universal agreement, it only needs a large enough user community (as is the case for human languages) to make it profitable for developers to use it as a means to general interoperability, and for third-party developer to develop utilities to make it easier to use; and they point out that developers of data schemes find different representations congenial for their local purposes; but they do not demonstrate that these different representations are in fact logically inconsistent.In fact, different representations of assertions about the real world (though not philosophical models), if they accurately reflect the world, must be logically consistent, even if they focus on different aspects of the same physical object or phenomenon. If any two assertions about the real world are logically inconsistent, one or both must be wrong, and that is a topic for experimental investigation, not for ontological representation. In practice, representations of the real world are created as and known to be approximations to the basic reality, and their use is circumscribed by the limits of error of measurements in any given practical application. Ontologies are entirely capable of representing approximations, and are also capable of representing situations in which different approximations have different utility.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following statements is correct concerning the use of Pearson’s Correlation for user- based collaborative filtering?
The collaborative filtering method: Collected user data may be assessed in aggregate (across multiple users) using machine learning techniques to cluster interaction patterns to user models and classify specific user patterns to such models. The website may then be adapted to target clusters of users. In this approach, the models are explicitly created from historic user information with new users are classified to an existing model and a pre-defined mapping is used for existing content and content organization.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following statements is correct concerning the use of Pearson’s Correlation for user- based collaborative filtering?
These predictions are specific to the user, but use information gleaned from many users. This differs from the simpler approach of giving an average (non-specific) score for each item of interest, for example based on its number of votes. In the more general sense, collaborative filtering is the process of filtering for information or patterns using techniques involving collaboration among multiple agents, viewpoints, data sources, etc. Applications of collaborative filtering typically involve very large data sets. Collaborative filtering methods have been applied to many different kinds of data including: sensing and monitoring data, such as in mineral exploration, environmental sensing over large areas or multiple sensors; financial data, such as financial service institutions that integrate many financial sources; or in electronic commerce and web applications where the focus is on user data, etc. The remainder of this discussion focuses on collaborative filtering for user data, although some of the methods and approaches may apply to the other major applications as well.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
After the join step, the number of k+1-itemsets
If the item is less than entry Fk−1, discard the elements from positions Fk−1 + 1 to n. Set k = k − 1 and return to step 2. If the item is greater than entry Fk−1, discard the elements from positions 1 to Fk−1. Renumber the remaining elements from 1 to Fk−2, set k = k − 2, and return to step 2.Alternative implementation (from "Sorting and Searching" by Knuth): Given a table of records R1, R2, ..., RN whose keys are in increasing order K1 < K2 < ... < KN, the algorithm searches for a given argument K. Assume N+1 = Fk+1Step 1. i ← Fk, p ← Fk-1, q ← Fk-2 (throughout the algorithm, p and q will be consecutive Fibonacci numbers) Step 2.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
After the join step, the number of k+1-itemsets
The final list in this sequence, M k {\displaystyle M_{k}} , is equal to L k {\displaystyle L_{k}} ; each earlier list M i {\displaystyle M_{i}} is formed by merging L i {\displaystyle L_{i}} with every second item from M i + 1 {\displaystyle M_{i+1}} . With each item x {\displaystyle x} in this merged list, we store two numbers: the position resulting from searching for x {\displaystyle x} in L i {\displaystyle L_{i}} and the position resulting from searching for x {\displaystyle x} in M i + 1 {\displaystyle M_{i+1}} . For the data above, this would give us the following lists: M 1 {\displaystyle M_{1}} = 24, 25, 35, 64, 65, 79, 80, 93 M 2 {\displaystyle M_{2}} = 23, 25, 26, 35, 62, 79 M 3 {\displaystyle M_{3}} = 13, 35, 44, 62, 66, 79 M 4 {\displaystyle M_{4}} = 11, 35, 46, 79, 81Suppose we wish to perform a query in this structure, for q = 50 {\displaystyle q=50} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which is true about the use of entropy in decision tree induction?
Machine learning techniques arise largely from statistics and also information theory. In general, entropy is a measure of uncertainty and the objective of machine learning is to minimize uncertainty. Decision tree learning algorithms use relative entropy to determine the decision rules that govern the data at each node. The Information gain in decision trees I G ( Y , X ) {\displaystyle IG(Y,X)} , which is equal to the difference between the entropy of Y {\displaystyle Y} and the conditional entropy of Y {\displaystyle Y} given X {\displaystyle X} , quantifies the expected information, or the reduction in entropy, from additionally knowing the value of an attribute X {\displaystyle X} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which is true about the use of entropy in decision tree induction?
J.R. Quinlan (1986). "Induction of Decision Trees". Machine Learning.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement User-based collaborative filtering using the following formula: \begin{equation} {r}_{x}(a) = \bar{r}_{x} + \frac{\sum\limits_{y \in N_{U}(x)} sim(x, y) (r_{y}(a) - \bar{r}_{y})}{\sum\limits_{y \in N_{U}(x)}|sim(x, y)|} \end{equation} You will create a function that takes as input the ratings and the similarity matrix and gives as output the predicted ratings.
Collaborative filtering systems have many forms, but many common systems can be reduced to two steps: Look for users who share the same rating patterns with the active user (the user whom the prediction is for). Use the ratings from those like-minded users found in step 1 to calculate a prediction for the active userThis falls under the category of user-based collaborative filtering. A specific application of this is the user-based Nearest Neighbor algorithm. Alternatively, item-based collaborative filtering (users who bought x also bought y), proceeds in an item-centric manner: Build an item-item matrix determining relationships between pairs of items Infer the tastes of the current user by examining the matrix and matching that user's dataSee, for example, the Slope One item-based collaborative filtering family.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement User-based collaborative filtering using the following formula: \begin{equation} {r}_{x}(a) = \bar{r}_{x} + \frac{\sum\limits_{y \in N_{U}(x)} sim(x, y) (r_{y}(a) - \bar{r}_{y})}{\sum\limits_{y \in N_{U}(x)}|sim(x, y)|} \end{equation} You will create a function that takes as input the ratings and the similarity matrix and gives as output the predicted ratings.
The authors provide three types of scores: Similar users: this score is proportional to the similarity in behavior of users for visiting places. Mathematically, the similarity score between two users is computed as follows:Where s ( u , i ) {\textstyle s(u,i)} denotes the probability of visiting place i {\textstyle i} by user u {\textstyle u} . This value could be computed based on the idea of user-based collaborative filtering as below: Similar friends: this score is calculated by the cosine similarity of users based on their mutual connections (i.e.: friendships) in social media.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which statement is false about clustering?
There is no objectively "correct" clustering algorithm, but as it was noted, "clustering is in the eye of the beholder." The most appropriate clustering algorithm for a particular problem often needs to be chosen experimentally, unless there is a mathematical reason to prefer one cluster model over another. An algorithm that is designed for one kind of model will generally fail on a data set that contains a radically different kind of model. For example, k-means cannot find non-convex clusters.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which statement is false about clustering?
There is no objectively "correct" clustering algorithm, but as it was noted, "clustering is in the eye of the beholder." The most appropriate clustering algorithm for a particular problem often needs to be chosen experimentally, unless there is a mathematical reason to prefer one cluster model over another. An algorithm that is designed for one kind of model will generally fail on a data set that contains a radically different kind of model. For example, k-means cannot find non-convex clusters.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Modularity clustering will end up always with the same community structure?
The inspiration for this method of community detection is the optimization of modularity as the algorithm progresses. Modularity is a scale value between −0.5 (non-modular clustering) and 1 (fully modular clustering) that measures the relative density of edges inside communities with respect to edges outside communities. Optimizing this value theoretically results in the best possible grouping of the nodes of a given network.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Modularity clustering will end up always with the same community structure?
Biological networks, including animal brains, exhibit a high degree of modularity. However, modularity maximization is not statistically consistent, and finds communities in its own null model, i.e. fully random graphs, and therefore it cannot be used to find statistically significant community structures in empirical networks. Furthermore, it has been shown that modularity suffers a resolution limit and, therefore, it is unable to detect small communities.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement weigthing estimation of kNN classification
In fault detection and diagnosis, mathematical classification models which in fact belong to supervised learning methods, are trained on the training set of a labeled dataset to accurately identify the redundancies, faults and anomalous samples. During the past decades, there are different classification and preprocessing models that have been developed and proposed in this research area. K-nearest-neighbors algorithm (kNN) is one of the oldest techniques which has been used to solve fault detection and diagnosis problems. Despite the simple logic that this instance-based algorithm has, there are some problems with large dimensionality and processing time when it is used on large datasets.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement weigthing estimation of kNN classification
The k-NN algorithm is a well known pattern recognition algorithm where a set of predetermined prototypes {pk} are used during the sample, or testing phase, of a supposed event. The prototypes model the events that are of interest in the application. The distance between each test vector and each prototype is calculated and the k test vectors closest to the prototype vectors are taken as the most likely classification or group of classifications. From there the probability that x belongs to the prototype event can be calculated. This approach, however, requires much memory and processing power as the number of prototypes increases and thus it is not a very practical choice for WSNs. It does however act as a good baseline to gauge performance of other classifiers since it is well known and that probability of misclassification when k=1 approaches twice the optimal Bayes error.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For his awesome research, Tugrulcan is going to use the Pagerank with teleportation and HITS algorithm, not on a network of webpages but on the retweet network of Twitter! The retweet network is a directed graph, where nodes are users and an edge going out from a user A and to a user B means that "User A retweeted User B". Which one is FALSE about a Twitter bot that retweeted other users frequently but got never retweeted by other users or by itself?
A Twitter bot is a computer program that can automatically tweet, retweet, and follow other accounts. Twitter's open application programming interface and the availability of cloud servers make it possible for Twitter bots to exist within the social networking site. Benign Twitter bots may generate creative content and relevant product updates whereas malicious bots can make unpopular people seem popular, push irrelevant products on users and spread misinformation, spam or slander. Bots amass significant influence and have been noted to sway elections, influence the stock market, public appeal, and attack governments. As of 2013, Twitter said there were 20 million fake accounts on Twitter, representing less than 5% of active users. A 2020 estimate put the figure at 15% of all accounts or around 48 million accounts.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For his awesome research, Tugrulcan is going to use the Pagerank with teleportation and HITS algorithm, not on a network of webpages but on the retweet network of Twitter! The retweet network is a directed graph, where nodes are users and an edge going out from a user A and to a user B means that "User A retweeted User B". Which one is FALSE about a Twitter bot that retweeted other users frequently but got never retweeted by other users or by itself?
It is sometimes desirable to identify when a Twitter account is controlled by a internet bot. Following a test period, Twitter rolled out labels to identify bot accounts and automated tweets in February 2022.Detecting non-human Twitter users has been of interest to academics.In a 2012 paper, Chu et al. propose the following criteria that indicate that an account may be a bot (they were designing an automated system): "Periodic and regular timing" of tweets; Whether the tweet content contains known spam; and The ratio of tweets from mobile versus desktop, as compared to an average human Twitter user.Emilio Ferrara at the University of Southern California used artificial intelligence to identify Twitter bots. He found that humans reply to other tweets four or five times more than bots and that bots continue to post longer tweets over time. Bots also post at more regular time gaps, for example, tweeting at 30-minute or 60-minute intervals.Indiana University has developed a free service called Botometer (formerly BotOrNot), which scores Twitter handles based on their likelihood of being a Twitterbot.Recent research from EPFL argued that classifying a Twitter account as bot or not may not be always possible because hackers take over human accounts and use them as bots temporarily or permanently and in parallel to the owner of the account in some cases.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement kNN function (finding k nearest documents for a given document)
k-nearest neighbor (k-NN) query takes the cardinality of the input set as an input parameter. For a given query object Q ∈ D and an integer k ≥ 1, the k-NN query NN(Q, k) selects the k indexed objects which have the shortest distance from Q, according to the distance function d.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement kNN function (finding k nearest documents for a given document)
function knn_search is input: t, the target point for the query k, the number of nearest neighbors of t to search for Q, max-first priority queue containing at most k points B, a node, or ball, in the tree output: Q, containing the k nearest neighbors from within B if distance(t, B.pivot) - B.radius ≥ distance(t, Q.first) then return Q unchanged else if B is a leaf node then for each point p in B do if distance(t, p) < distance(t, Q.first) then add p to Q if size(Q) > k then remove the furthest neighbor from Q end if end if repeat else let child1 be the child node closest to t let child2 be the child node furthest from t knn_search(t, k, Q, child1) knn_search(t, k, Q, child2) end if return Q end function
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Following the notation used in class, let us denote the set of terms by $T=\{k_i|i=1,...,m\}$, the set of documents by $D=\{d_j |j=1,...,n\}$, and let $d_i=(w_{1j},w_{2j},...,w_{mj})$. We are also given a query $q=(w_{1q},w_{2q},...,w_{mq})$. In the lecture we studied that, $sim(q,d_j) = \sum^m_{i=1} \frac{w_{ij}}{|d_j|}\frac{w_{iq}}{|q|}$ . (1) Another way of looking at the information retrieval problem is using a probabilistic approach. The probabilistic view of information retrieval consists of determining the conditional probability $P(q|d_j)$ that for a given document $d_j$ the query by the user is $q$. So, practically in probabilistic retrieval when a query $q$ is given, for each document it is evaluated how probable it is that the query is indeed relevant for the document, which results in a ranking of the documents. In order to relate vector space retrieval to a probabilistic view of information retrieval, we interpret the weights in Equation (1) as follows: - $w_{ij}/|d_j|$ can be interpreted as the conditional probability $P(k_i|d_j)$ that for a given document $d_j$ the term $k_i$ is important (to characterize the document $d_j$). - $w_{iq}/|q|$ can be interpreted as the conditional probability $P(q|k_i)$ that for a given term $k_i$ the query posed by the user is $q$. Intuitively, $P(q|k_i)$ gives the amount of importance given to a particular term while querying. With this interpretation you can rewrite Equation (1) as follows: $sim(q,d_j) = \sum^m_{i=1} P(k_i|d_j)P(q|k_i)$ (2) Using the expression derived for $P(q|d_j)$ in (a), obtain a ranking (documents sorted in descending order of their scores) for the documents $P(k_i|d_1) = (0, 1/3, 2/3)$, $P(k_i|d_2) =(1/3, 2/3, 0)$, $P(k_i|d_3) = (1/2, 0, 1/2)$, and $P (k_i|d_4) = (3/4, 1/4, 0)$ and the query $P(q|k_i) = (1/5, 0, 2/3)$.
Similarities are computed as probabilities that a document is relevant for a given query. Probabilistic theorems like the Bayes' theorem are often used in these models. Binary Independence Model Probabilistic relevance model on which is based the okapi (BM25) relevance function Uncertain inference Language models Divergence-from-randomness model Latent Dirichlet allocation Feature-based retrieval models view documents as vectors of values of feature functions (or just features) and seek the best way to combine these features into a single relevance score, typically by learning to rank methods. Feature functions are arbitrary functions of document and query, and as such can easily incorporate almost any other retrieval model as just another feature.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Following the notation used in class, let us denote the set of terms by $T=\{k_i|i=1,...,m\}$, the set of documents by $D=\{d_j |j=1,...,n\}$, and let $d_i=(w_{1j},w_{2j},...,w_{mj})$. We are also given a query $q=(w_{1q},w_{2q},...,w_{mq})$. In the lecture we studied that, $sim(q,d_j) = \sum^m_{i=1} \frac{w_{ij}}{|d_j|}\frac{w_{iq}}{|q|}$ . (1) Another way of looking at the information retrieval problem is using a probabilistic approach. The probabilistic view of information retrieval consists of determining the conditional probability $P(q|d_j)$ that for a given document $d_j$ the query by the user is $q$. So, practically in probabilistic retrieval when a query $q$ is given, for each document it is evaluated how probable it is that the query is indeed relevant for the document, which results in a ranking of the documents. In order to relate vector space retrieval to a probabilistic view of information retrieval, we interpret the weights in Equation (1) as follows: - $w_{ij}/|d_j|$ can be interpreted as the conditional probability $P(k_i|d_j)$ that for a given document $d_j$ the term $k_i$ is important (to characterize the document $d_j$). - $w_{iq}/|q|$ can be interpreted as the conditional probability $P(q|k_i)$ that for a given term $k_i$ the query posed by the user is $q$. Intuitively, $P(q|k_i)$ gives the amount of importance given to a particular term while querying. With this interpretation you can rewrite Equation (1) as follows: $sim(q,d_j) = \sum^m_{i=1} P(k_i|d_j)P(q|k_i)$ (2) Using the expression derived for $P(q|d_j)$ in (a), obtain a ranking (documents sorted in descending order of their scores) for the documents $P(k_i|d_1) = (0, 1/3, 2/3)$, $P(k_i|d_2) =(1/3, 2/3, 0)$, $P(k_i|d_3) = (1/2, 0, 1/2)$, and $P (k_i|d_4) = (3/4, 1/4, 0)$ and the query $P(q|k_i) = (1/5, 0, 2/3)$.
Zhao and Callan (2010) were perhaps the first to quantitatively study the vocabulary mismatch problem in a retrieval setting. Their results show that an average query term fails to appear in 30-40% of the documents that are relevant to the user query. They also showed that this probability of mismatch is a central probability in one of the fundamental probabilistic retrieval models, the Binary Independence Model. They developed novel term weight prediction methods that can lead to potentially 50-80% accuracy gains in retrieval over strong keyword retrieval models. Further research along the line shows that expert users can use Boolean Conjunctive Normal Form expansion to improve retrieval performance by 50-300% over unexpanded keyword queries.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement Latent Semantic Indexing by selecting the first x largest singular values of the term document matrix Hint 1: np.linalg.svd(M, full_matrices=False) performs SVD on the matrix $\mathbf{M}$ and returns $\mathbf{K}, \mathbf{S}, \mathbf{D}^T$ - $\mathbf{K}, \mathbf{D}^T$ are matrices with orthonormal columns - $\mathbf{S}$ is a **vector** of singular values in a **descending** order
A rank-reduced, singular value decomposition is performed on the matrix to determine patterns in the relationships between the terms and concepts contained in the text. The SVD forms the foundation for LSI. It computes the term and document vector spaces by approximating the single term-frequency matrix, A {\displaystyle A} , into three other matrices— an m by r term-concept vector matrix T {\displaystyle T} , an r by r singular values matrix S {\displaystyle S} , and a n by r concept-document vector matrix, D {\displaystyle D} , which satisfy the following relations: A ≈ T S D T {\displaystyle A\approx TSD^{T}} T T T = I r D T D = I r {\displaystyle T^{T}T=I_{r}\quad D^{T}D=I_{r}} S 1 , 1 ≥ S 2 , 2 ≥ … ≥ S r , r > 0 S i , j = 0 where i ≠ j {\displaystyle S_{1,1}\geq S_{2,2}\geq \ldots \geq S_{r,r}>0\quad S_{i,j}=0\;{\text{where}}\;i\neq j} In the formula, A is the supplied m by n weighted matrix of term frequencies in a collection of text where m is the number of unique terms, and n is the number of documents. T is a computed m by r matrix of term vectors where r is the rank of A—a measure of its unique dimensions ≤ min(m,n).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement Latent Semantic Indexing by selecting the first x largest singular values of the term document matrix Hint 1: np.linalg.svd(M, full_matrices=False) performs SVD on the matrix $\mathbf{M}$ and returns $\mathbf{K}, \mathbf{S}, \mathbf{D}^T$ - $\mathbf{K}, \mathbf{D}^T$ are matrices with orthonormal columns - $\mathbf{S}$ is a **vector** of singular values in a **descending** order
The computed Tk and Dk matrices define the term and document vector spaces, which with the computed singular values, Sk, embody the conceptual information derived from the document collection. The similarity of terms or documents within these spaces is a factor of how close they are to each other in these spaces, typically computed as a function of the angle between the corresponding vectors. The same steps are used to locate the vectors representing the text of queries and new documents within the document space of an existing LSI index. By a simple transformation of the A = T S DT equation into the equivalent D = AT T S−1 equation, a new vector, d, for a query or for a new document can be created by computing a new column in A and then multiplying the new column by T S−1.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When searching for an entity 𝑒𝑛𝑒𝑤 that has a given relationship 𝑟 with a given entity 𝑒
This is called reification of a relationship. Like any other entity, it must be an instance of an entity type.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When searching for an entity 𝑒𝑛𝑒𝑤 that has a given relationship 𝑟 with a given entity 𝑒
For example, “I’m looking for a male sister” refers to no actual entity. However, the ambiguity of its specificity (are you looking for a particular male sister, or any male sister?) is retained.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement the modularity metric for communities.
The inspiration for this method of community detection is the optimization of modularity as the algorithm progresses. Modularity is a scale value between −0.5 (non-modular clustering) and 1 (fully modular clustering) that measures the relative density of edges inside communities with respect to edges outside communities. Optimizing this value theoretically results in the best possible grouping of the nodes of a given network.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement the modularity metric for communities.
Seed product to attract a community Multiple stakeholders for a variety of contributions Modularity to attract contributors and users
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following graph analysis techniques do you believe would be most appropriate to identify communities on a social graph?
The problem of detecting the community features is one of the main issues in the study of networking systems. Social networks naturally tend to divide themselves into communities or modules. However, some world networks are too big so they must be simplified before information can be extracted. As a result, an effective way of dealing with this drawback for smaller communities is by using modularity algorithms in order to partition users into even smaller groups.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following graph analysis techniques do you believe would be most appropriate to identify communities on a social graph?
The evaluation of algorithms, to detect which are better at detecting community structure, is still an open question. It must be based on analyses of networks of known structure. A typical example is the "four groups" test, in which a network is divided into four equally-sized groups (usually of 32 nodes each) and the probabilities of connection within and between groups varied to create more or less challenging structures for the detection algorithm. Such benchmark graphs are a special case of the planted l-partition model of Condon and Karp, or more generally of "stochastic block models", a general class of random network models containing community structure.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following models for generating vector representations for text require to precompute the frequency of co-occurrence of words from the vocabulary in the document collection
Considering observations in the form of co-occurrences ( w , d ) {\displaystyle (w,d)} of words and documents, PLSA models the probability of each co-occurrence as a mixture of conditionally independent multinomial distributions: P ( w , d ) = ∑ c P ( c ) P ( d | c ) P ( w | c ) = P ( d ) ∑ c P ( c | d ) P ( w | c ) {\displaystyle P(w,d)=\sum _{c}P(c)P(d|c)P(w|c)=P(d)\sum _{c}P(c|d)P(w|c)} with c {\displaystyle c} being the words' topic. Note that the number of topics is a hyperparameter that must be chosen in advance and is not estimated from the data. The first formulation is the symmetric formulation, where w {\displaystyle w} and d {\displaystyle d} are both generated from the latent class c {\displaystyle c} in similar ways (using the conditional probabilities P ( d | c ) {\displaystyle P(d|c)} and P ( w | c ) {\displaystyle P(w|c)} ), whereas the second formulation is the asymmetric formulation, where, for each document d {\displaystyle d} , a latent class is chosen conditionally to the document according to P ( c | d ) {\displaystyle P(c|d)} , and a word is then generated from that class according to P ( w | c ) {\displaystyle P(w|c)} . Although we have used words and documents in this example, the co-occurrence of any couple of discrete variables may be modelled in exactly the same way.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following models for generating vector representations for text require to precompute the frequency of co-occurrence of words from the vocabulary in the document collection
Considering observations in the form of co-occurrences ( w , d ) {\displaystyle (w,d)} of words and documents, PLSA models the probability of each co-occurrence as a mixture of conditionally independent multinomial distributions: P ( w , d ) = ∑ c P ( c ) P ( d | c ) P ( w | c ) = P ( d ) ∑ c P ( c | d ) P ( w | c ) {\displaystyle P(w,d)=\sum _{c}P(c)P(d|c)P(w|c)=P(d)\sum _{c}P(c|d)P(w|c)} with c {\displaystyle c} being the words' topic. Note that the number of topics is a hyperparameter that must be chosen in advance and is not estimated from the data. The first formulation is the symmetric formulation, where w {\displaystyle w} and d {\displaystyle d} are both generated from the latent class c {\displaystyle c} in similar ways (using the conditional probabilities P ( d | c ) {\displaystyle P(d|c)} and P ( w | c ) {\displaystyle P(w|c)} ), whereas the second formulation is the asymmetric formulation, where, for each document d {\displaystyle d} , a latent class is chosen conditionally to the document according to P ( c | d ) {\displaystyle P(c|d)} , and a word is then generated from that class according to P ( w | c ) {\displaystyle P(w|c)} . Although we have used words and documents in this example, the co-occurrence of any couple of discrete variables may be modelled in exactly the same way.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For which document classifier the training cost is low and inference is expensive?
The authors note that using support vector machines (SVM) and hundreds of documents give inferior performance, but does not specify which features or documents the SVM was trained/tested on. A fair comparison would use the same features and document sets as those used by the manual threshold classifier. == References ==
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For which document classifier the training cost is low and inference is expensive?
The textual data's ever-growing nature makes the task overwhelmingly difficult for the researchers to complete the task on time.Previously, the research mainly focused on document level classification. However, classifying a document level suffers less accuracy, as an article may have diverse types of expressions involved. Researching evidence suggests a set of news articles that are expected to dominate by the objective expression, whereas the results show that it consisted of over 40% of subjective expression.To overcome those challenges, researchers conclude that classifier efficacy depends on the precisions of patterns learner.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
A word embedding for given corpus
In natural language processing (NLP), a word embedding is a representation of a word. The embedding is used in text analysis. Typically, the representation is a real-valued vector that encodes the meaning of the word in such a way that words that are closer in the vector space are expected to be similar in meaning. Word embeddings can be obtained using language modeling and feature learning techniques, where words or phrases from the vocabulary are mapped to vectors of real numbers. Methods to generate this mapping include neural networks, dimensionality reduction on the word co-occurrence matrix, probabilistic models, explainable knowledge base method, and explicit representation in terms of the context in which words appear.Word and phrase embeddings, when used as the underlying input representation, have been shown to boost the performance in NLP tasks such as syntactic parsing and sentiment analysis.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
A word embedding for given corpus
Unsupervised word sense disambiguation rivaling supervised methods. In Proc. of the 33rd Annual Meeting of the Association for Computational Linguistics.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Ranked Retrieval, the result at position k is non-relevant and at k+1 is relevant. Which of the following is always true? Hint: P@k and R@k are the precision and recall of the result set consisting of the k top-ranked documents.
For modern (web-scale) information retrieval, recall is no longer a meaningful metric, as many queries have thousands of relevant documents, and few users will be interested in reading all of them. Precision at k documents (P@k) is still a useful metric (e.g., P@10 or "Precision at 10" corresponds to the number of relevant results among the top 10 retrieved documents), but fails to take into account the positions of the relevant documents among the top k. Another shortcoming is that on a query with fewer relevant results than k, even a perfect system will have a score less than 1. It is easier to score manually since only the top k results need to be examined to determine if they are relevant or not.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Ranked Retrieval, the result at position k is non-relevant and at k+1 is relevant. Which of the following is always true? Hint: P@k and R@k are the precision and recall of the result set consisting of the k top-ranked documents.
For modern (web-scale) information retrieval, recall is no longer a meaningful metric, as many queries have thousands of relevant documents, and few users will be interested in reading all of them. Precision at k documents (P@k) is still a useful metric (e.g., P@10 or "Precision at 10" corresponds to the number of relevant results among the top 10 retrieved documents), but fails to take into account the positions of the relevant documents among the top k. Another shortcoming is that on a query with fewer relevant results than k, even a perfect system will have a score less than 1. It is easier to score manually since only the top k results need to be examined to determine if they are relevant or not.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Regarding the Expectation-Maximization algorithm, which one of the following false?
Via a modification of an expectation-maximization algorithm. This does not require derivatives of the posterior density. Via a Monte Carlo method using simulated annealing
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Regarding the Expectation-Maximization algorithm, which one of the following false?
In statistics, an expectation–maximization (EM) algorithm is an iterative method to find (local) maximum likelihood or maximum a posteriori (MAP) estimates of parameters in statistical models, where the model depends on unobserved latent variables. The EM iteration alternates between performing an expectation (E) step, which creates a function for the expectation of the log-likelihood evaluated using the current estimate for the parameters, and a maximization (M) step, which computes parameters maximizing the expected log-likelihood found on the E step. These parameter-estimates are then used to determine the distribution of the latent variables in the next E step.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For an item that has not received any ratings, which method can make a prediction?
How does an analyst compare something rated a 1 to something rated a 2? Is one twice as good as the other? Again there is no theoretical way of aggregating the data.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For an item that has not received any ratings, which method can make a prediction?
How does an analyst compare something rated a 1 to something rated a 2? Is one twice as good as the other? Again there is no theoretical way of aggregating the data.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following sentences: ```Aphrodite and Eros are Gods.``` ```Aphrodite is a parent of Eros.``` ```Aphrodite is beautiful.``` ```Aphrodite is happy.``` Specify which are the *classes*, the *instances* and the *properties* in the above statements.
However, in first-order logic, these two sentences may be couched as statements that a certain individual or non-logical object has a property. In this example, both sentences happen to have the common form isPhil ( x ) {\displaystyle {\text{isPhil}}(x)} for some individual x {\displaystyle x} , in the first sentence the value of the variable x is "Socrates", and in the second sentence it is "Plato".
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following sentences: ```Aphrodite and Eros are Gods.``` ```Aphrodite is a parent of Eros.``` ```Aphrodite is beautiful.``` ```Aphrodite is happy.``` Specify which are the *classes*, the *instances* and the *properties* in the above statements.
These properties are formalized, statements (such as conditionals) are formed using them, and those statements taken together are the definition of the term. Consider a sentence such as "There's an electron in the sink." This means something along the lines of: "There exist some properties P1, P2, ..., Pn ( one for every theoretical property involved in the scientific theory, with 'electronhood' (which roughly corresponds to the essence of an electron included as P1) such that... (a statement in the scientific theory, but with P1, ..., Pn substituted for the specific terms such as 'charge', 'is an electron', etc. employed by the theory), and there is something in the sink that has P1."
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement Discounted Cumulative Gain. DCG is a retrieval metric that also takes into account the ordering of the result. The DCG accumulated at a rank $k$ is defined as: $DCG_k = \sum_{i=1}^k \frac{grade[i]}{log_2(i+1)}$ where $grade[i]$ is the relevance score given by the user for the result at position $i$. Hint: the logarithm is computed using the function np.log2
DCG uses a graded relevance scale of documents from the result set to evaluate the usefulness, or gain, of a document based on its position in the result list. The premise of DCG is that highly relevant documents appearing lower in a search result list should be penalized as the graded relevance value is reduced logarithmically proportional to the position of the result. The DCG accumulated at a particular rank position p {\displaystyle p} is defined as: D C G p = ∑ i = 1 p r e l i log 2 ⁡ ( i + 1 ) . {\displaystyle \mathrm {DCG_{p}} =\sum _{i=1}^{p}{\frac {rel_{i}}{\log _{2}(i+1)}}.}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement Discounted Cumulative Gain. DCG is a retrieval metric that also takes into account the ordering of the result. The DCG accumulated at a rank $k$ is defined as: $DCG_k = \sum_{i=1}^k \frac{grade[i]}{log_2(i+1)}$ where $grade[i]$ is the relevance score given by the user for the result at position $i$. Hint: the logarithm is computed using the function np.log2
DCG uses a graded relevance scale of documents from the result set to evaluate the usefulness, or gain, of a document based on its position in the result list. The premise of DCG is that highly relevant documents appearing lower in a search result list should be penalized as the graded relevance value is reduced logarithmically proportional to the position of the result. The DCG accumulated at a particular rank position p {\displaystyle p} is defined as: D C G p = ∑ i = 1 p r e l i log 2 ⁡ ( i + 1 ) . {\displaystyle \mathrm {DCG_{p}} =\sum _{i=1}^{p}{\frac {rel_{i}}{\log _{2}(i+1)}}.}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The SMART algorithm for query relevance feedback modifies? (Slide 11 Week 3)
To improve the quality of expansion words in pseudo-relevance feedback, a positional relevance feedback for pseudo-relevance feedback has been proposed to select from feedback documents those words that are focused on the query topic based on positions of words in feedback documents. Specifically, the positional relevance model assigns more weights to words occurring closer to query words based on the intuition that words closer to query words are more likely to be related to the query topic. Blind feedback automates the manual part of relevance feedback and has the advantage that assessors are not required.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The SMART algorithm for query relevance feedback modifies? (Slide 11 Week 3)
Clustering and Diversifying Web Search Results with Graph-Based Word Sense Induction. Computational Linguistics, 39(3), MIT Press, 2013, pp. 709–754.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Suppose that in a given FP Tree, an item in a leaf node N exists in every path. Which of the following is TRUE?
If every node of a tree has finitely many successors, then it is called a finitely, otherwise an infinitely branching tree. A path π is a subset of T such that ε ∈ π and for every t ∈ T, either t is a leaf or there exists a unique c ∈ N {\displaystyle \mathbb {N} } such that t.c ∈ π. A path may be a finite or infinite set. If all paths of a tree are finite then the tree is called finite, otherwise infinite.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Suppose that in a given FP Tree, an item in a leaf node N exists in every path. Which of the following is TRUE?
The root is (s,0) and parent of a node (q,j) is (predecessor(q,j), j-1). This tree is infinite, finitely branching, and fully connected. Therefore, by Kőnig's lemma, there exists an infinite path (q0,0),(q1,1),(q2,2),... in the tree. Therefore, following is an accepting run of A run(q0,0)⋅run(q1,1)⋅run(q2,2)⋅...Hence, by infinite pigeonhole principle, w is accepted by A.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Ranked Retrieval, the result at position k is non-relevant and at k+1 is relevant. Which of the following is always true?Hint: P@k and R@k are the precision and recall of the result set consisting of the k top ranked documents.
For modern (web-scale) information retrieval, recall is no longer a meaningful metric, as many queries have thousands of relevant documents, and few users will be interested in reading all of them. Precision at k documents (P@k) is still a useful metric (e.g., P@10 or "Precision at 10" corresponds to the number of relevant results among the top 10 retrieved documents), but fails to take into account the positions of the relevant documents among the top k. Another shortcoming is that on a query with fewer relevant results than k, even a perfect system will have a score less than 1. It is easier to score manually since only the top k results need to be examined to determine if they are relevant or not.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In Ranked Retrieval, the result at position k is non-relevant and at k+1 is relevant. Which of the following is always true?Hint: P@k and R@k are the precision and recall of the result set consisting of the k top ranked documents.
For modern (web-scale) information retrieval, recall is no longer a meaningful metric, as many queries have thousands of relevant documents, and few users will be interested in reading all of them. Precision at k documents (P@k) is still a useful metric (e.g., P@10 or "Precision at 10" corresponds to the number of relevant results among the top 10 retrieved documents), but fails to take into account the positions of the relevant documents among the top k. Another shortcoming is that on a query with fewer relevant results than k, even a perfect system will have a score less than 1. It is easier to score manually since only the top k results need to be examined to determine if they are relevant or not.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Suppose that for points p, q, and t in metric space, the following hold:p is density-reachable from q t is density-reachable from qp is density-reachable from tWhich of the following statements is false?
The density theorem is usually proved using a simpler method (e.g. see Measure and Category). This theorem is also true for every finite Borel measure on Rn instead of Lebesgue measure (a proof can be found in e.g. (Ledrappier & Young 1985)). More generally, it is true of any finite Borel measure on a separable metric space such that at least one of the following holds: the metric space is a Riemannian manifold, the metric space is a locally compact ultrametric space, the measure is doubling.A proof of these results can be found in sections 2.8–2.9 of (Federer 1969).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Suppose that for points p, q, and t in metric space, the following hold:p is density-reachable from q t is density-reachable from qp is density-reachable from tWhich of the following statements is false?
Reif and Tate prove that if the n-body reachability problem is defined as follows – given n bodies satisfying a fixed electrostatic potential law, determining if a body reaches a destination ball in a given time bound where we require a poly(n) bits of accuracy and the target time is poly(n) is in PSPACE. On the other hand, if the question is whether the body eventually reaches the destination ball, the problem is PSPACE-hard. These bounds are based on similar complexity bounds obtained for ray tracing.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
If for the χ2 statistics for a binary feature, we obtain P(χ2 |DF = 1) < 0.05, this means:
χ 2 {\textstyle \chi ^{2}} values vs p {\displaystyle {\boldsymbol {p}}} -values The p-value is the probability of observing a test statistic at least as extreme in a chi-squared distribution. Accordingly, since the cumulative distribution function (CDF) for the appropriate degrees of freedom (df) gives the probability of having obtained a value less extreme than this point, subtracting the CDF value from 1 gives the p-value. A low p-value, below the chosen significance level, indicates statistical significance, i.e., sufficient evidence to reject the null hypothesis. A significance level of 0.05 is often used as the cutoff between significant and non-significant results. The table below gives a number of p-values matching to χ 2 {\displaystyle \chi ^{2}} for the first 10 degrees of freedom. These values can be calculated evaluating the quantile function (also known as "inverse CDF" or "ICDF") of the chi-squared distribution; e. g., the χ2 ICDF for p = 0.05 and df = 7 yields 2.1673 ≈ 2.17 as in the table above, noticing that 1 – p is the p-value from the table.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
If for the χ2 statistics for a binary feature, we obtain P(χ2 |DF = 1) < 0.05, this means:
Because of this, one should expect the statistic to assume low values if x ¯ ≈ μ {\displaystyle {\overline {\mathbf {x} }}\approx {\boldsymbol {\mu }}} , and high values if they are different. From the distribution, t 2 ∼ T p , n − 1 2 = p ( n − 1 ) n − p F p , n − p , {\displaystyle t^{2}\sim T_{p,n-1}^{2}={\frac {p(n-1)}{n-p}}F_{p,n-p},} where F p , n − p {\displaystyle F_{p,n-p}} is the F-distribution with parameters p and n − p. In order to calculate a p-value (unrelated to p variable here), note that the distribution of t 2 {\displaystyle t^{2}} equivalently implies that n − p p ( n − 1 ) t 2 ∼ F p , n − p .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement a function that computes the support for each provided itemset by counting the number of its occurences in the original dataset of transactions. You can use the following formula: $$\mathrm{supp}(X) = \frac{|\{t \in T; X \subseteq t\}|}{|T|}$$
Support is an indication of how frequently the itemset appears in the dataset. In our example, it can be easier to explain support by writing s u p p o r t = P ( A ∪ B ) = ( number of transactions containing A and B ) (total number of transactions) {\displaystyle support=P(A\cup B)={\frac {({\text{number of transactions containing }}A{\text{ and }}B)}{\text{ (total number of transactions)}}}} where A and B are separate item sets that occur in at the same time in a transaction. Using Table 2 as an example, the itemset X = { b e e r , d i a p e r s } {\displaystyle X=\{\mathrm {beer,diapers} \}} has a support of 1 / 5 = 0.2 {\displaystyle 1/5=0.2} since it occurs in 20% of all transactions (1 out of 5 transactions). The argument of support of X is a set of preconditions, and thus becomes more restrictive as it grows (instead of more inclusive).Furthermore, the itemset Y = { m i l k , b r e a d , b u t t e r } {\displaystyle Y=\{\mathrm {milk,bread,butter} \}} has a support of 1 / 5 = 0.2 {\displaystyle 1/5=0.2} as it appears in 20% of all transactions as well.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Implement a function that computes the support for each provided itemset by counting the number of its occurences in the original dataset of transactions. You can use the following formula: $$\mathrm{supp}(X) = \frac{|\{t \in T; X \subseteq t\}|}{|T|}$$
Assume that a large supermarket tracks sales data by stock-keeping unit (SKU) for each item: each item, such as "butter" or "bread", is identified by a numerical SKU. The supermarket has a database of transactions where each transaction is a set of SKUs that were bought together. Let the database of transactions consist of following itemsets: We will use Apriori to determine the frequent item sets of this database. To do this, we will say that an item set is frequent if it appears in at least 3 transactions of the database: the value 3 is the support threshold.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following is false regarding K-means and DBSCAN?
DBSCAN clustering algorithm with Euclidean distance.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following is false regarding K-means and DBSCAN?
Similar to k-means clustering, these "density attractors" can serve as representatives for the data set, but mean-shift can detect arbitrary-shaped clusters similar to DBSCAN. Due to the expensive iterative procedure and density estimation, mean-shift is usually slower than DBSCAN or k-Means. Besides that, the applicability of the mean-shift algorithm to multidimensional data is hindered by the unsmooth behaviour of the kernel density estimate, which results in over-fragmentation of cluster tails. Density-based clustering examples
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following is correct regarding community detection?
Much of the literature on algorithmic community detection addresses three statistical tasks: detection, partial recovery, and exact recovery.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following is correct regarding community detection?
As pointed by the first work on community search published in SIGKDD'2010, many existing community detection/discovery methods consider the static community detection problem, where the graph needs to be partitioned a-priori with no reference to query nodes. While community search often focuses the most-likely communitie containing the query vertex. The main advantages of community search over community detection/discovery are listed as below: (1) High personalization. Community detection/discovery often uses the same global criterion to decide whether a subgraph qualifies as a community.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We learnt in the lecture that terms are typically stored in an inverted list. Now, in the inverted list, instead of only storing document identifiers of the documents in which the term appears, assume we also store an *offset* of the appearance of a term in a document. An $offset$ of a term $l_k$ given a document is defined as the number of words between the start of the document and $l_k$. Thus our inverted list is now: $l_k= \langle f_k: \{d_{i_1} \rightarrow [o_1,\ldots,o_{n_{i_1}}]\}, \{d_{i_2} \rightarrow [o_1,\ldots,o_{n_{i_2}}]\}, \ldots, \{d_{i_k} \rightarrow [o_1,\ldots,o_{n_{i_k}}]\} \rangle$ This means that in document $d_{i_1}$ term $l_k$ appears $n_{i_1}$ times and at offset $[o_1,\ldots,o_{n_{i_1}}]$, where $[o_1,\ldots,o_{n_{i_1}}]$ are sorted in ascending order, these type of indices are also known as term-offset indices. An example of a term-offset index is as follows: **Obama** = $⟨4 : {1 → [3]},{2 → [6]},{3 → [2,17]},{4 → [1]}⟩$ **Governor** = $⟨2 : {4 → [3]}, {7 → [14]}⟩$ **Election** = $⟨4 : {1 → [1]},{2 → [1,21]},{3 → [3]},{5 → [16,22,51]}⟩$ Which is to say that the term **Governor** appear in 2 documents. In document 4 at offset 3, in document 7 at offset 14. Now let us consider the *SLOP/x* operator in text retrieval. This operator has the syntax: *QueryTerm1 SLOP/x QueryTerm2* finds occurrences of *QueryTerm1* within $x$ (but not necessarily in that order) words of *QueryTerm2*, where $x$ is a positive integer argument ($x \geq 1$). Thus $x = 1$ demands that *QueryTerm1* be adjacent to *QueryTerm2*. List each set of values for which the query **Obama** *SLOP/x* **Election** has a different set of documents as answers (starting from $x = 1$).
A major drawback is that storing a word in the tree may require space beyond that required to store the word itself. An alternate representation is a suffix array, which is considered to require less virtual memory and supports data compression such as the BWT algorithm.Inverted index Stores a list of occurrences of each atomic search criterion, typically in the form of a hash table or binary tree.Citation index Stores citations or hyperlinks between documents to support citation analysis, a subject of bibliometrics. n-gram index Stores sequences of length of data to support other types of retrieval or text mining. Document-term matrix Used in latent semantic analysis, stores the occurrences of words in documents in a two-dimensional sparse matrix.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We learnt in the lecture that terms are typically stored in an inverted list. Now, in the inverted list, instead of only storing document identifiers of the documents in which the term appears, assume we also store an *offset* of the appearance of a term in a document. An $offset$ of a term $l_k$ given a document is defined as the number of words between the start of the document and $l_k$. Thus our inverted list is now: $l_k= \langle f_k: \{d_{i_1} \rightarrow [o_1,\ldots,o_{n_{i_1}}]\}, \{d_{i_2} \rightarrow [o_1,\ldots,o_{n_{i_2}}]\}, \ldots, \{d_{i_k} \rightarrow [o_1,\ldots,o_{n_{i_k}}]\} \rangle$ This means that in document $d_{i_1}$ term $l_k$ appears $n_{i_1}$ times and at offset $[o_1,\ldots,o_{n_{i_1}}]$, where $[o_1,\ldots,o_{n_{i_1}}]$ are sorted in ascending order, these type of indices are also known as term-offset indices. An example of a term-offset index is as follows: **Obama** = $⟨4 : {1 → [3]},{2 → [6]},{3 → [2,17]},{4 → [1]}⟩$ **Governor** = $⟨2 : {4 → [3]}, {7 → [14]}⟩$ **Election** = $⟨4 : {1 → [1]},{2 → [1,21]},{3 → [3]},{5 → [16,22,51]}⟩$ Which is to say that the term **Governor** appear in 2 documents. In document 4 at offset 3, in document 7 at offset 14. Now let us consider the *SLOP/x* operator in text retrieval. This operator has the syntax: *QueryTerm1 SLOP/x QueryTerm2* finds occurrences of *QueryTerm1* within $x$ (but not necessarily in that order) words of *QueryTerm2*, where $x$ is a positive integer argument ($x \geq 1$). Thus $x = 1$ demands that *QueryTerm1* be adjacent to *QueryTerm2*. List each set of values for which the query **Obama** *SLOP/x* **Election** has a different set of documents as answers (starting from $x = 1$).
A major drawback is that storing a word in the tree may require space beyond that required to store the word itself. An alternate representation is a suffix array, which is considered to require less virtual memory and supports data compression such as the BWT algorithm.Inverted index Stores a list of occurrences of each atomic search criterion, typically in the form of a hash table or binary tree.Citation index Stores citations or hyperlinks between documents to support citation analysis, a subject of bibliometrics. n-gram index Stores sequences of length of data to support other types of retrieval or text mining. Document-term matrix Used in latent semantic analysis, stores the occurrences of words in documents in a two-dimensional sparse matrix.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When constructing a word embedding, negative samples are:
In natural language processing (NLP), a word embedding is a representation of a word. The embedding is used in text analysis. Typically, the representation is a real-valued vector that encodes the meaning of the word in such a way that words that are closer in the vector space are expected to be similar in meaning. Word embeddings can be obtained using language modeling and feature learning techniques, where words or phrases from the vocabulary are mapped to vectors of real numbers. Methods to generate this mapping include neural networks, dimensionality reduction on the word co-occurrence matrix, probabilistic models, explainable knowledge base method, and explicit representation in terms of the context in which words appear.Word and phrase embeddings, when used as the underlying input representation, have been shown to boost the performance in NLP tasks such as syntactic parsing and sentiment analysis.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
When constructing a word embedding, negative samples are:
Word embeddings may contain the biases and stereotypes contained in the trained dataset, as Bolukbasi et al. points out in the 2016 paper “Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings” that a publicly available (and popular) word2vec embedding trained on Google News texts (a commonly used data corpus), which consists of text written by professional journalists, still shows disproportionate word associations reflecting gender and racial biases when extracting word analogies. For example, one of the analogies generated using the aforementioned word embedding is “man is to computer programmer as woman is to homemaker”.The applications of these trained word embeddings without careful oversight likely perpetuates existing bias in society, which is introduced through unaltered training data. Furthermore, word embeddings can even amplify these biases (Zhao et al. 2017). Given word embeddings popular usage in NLP applications such as search ranking, CV parsing and recommendation systems, the biases that exist in pre-trained word embeddings may have further reaching impact than we realize.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following statements about index merging (when constructing inverted files) is correct?
The inverted index is filled via a merge or rebuild. A rebuild is similar to a merge but first deletes the contents of the inverted index. The architecture may be designed to support incremental indexing, where a merge identifies the document or documents to be added or updated and then parses each document into words. For technical accuracy, a merge conflates newly indexed documents, typically residing in virtual memory, with the index cache residing on one or more computer hard drives.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Which of the following statements about index merging (when constructing inverted files) is correct?
The inverted index is filled via a merge or rebuild. A rebuild is similar to a merge but first deletes the contents of the inverted index. The architecture may be designed to support incremental indexing, where a merge identifies the document or documents to be added or updated and then parses each document into words. For technical accuracy, a merge conflates newly indexed documents, typically residing in virtual memory, with the index cache residing on one or more computer hard drives.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For his awesome research, Tugrulcan is going to use the PageRank with teleportation and HITS algorithm, not on a network of webpages but on the retweet network of Twitter! The retweet network is a directed graph, where nodes are users and an edge going out from a user A and to a user B means that "User A retweeted User B". Which one is false about a Twitter bot that retweeted other users frequently but got never retweeted by other users or by itself?
A Twitter bot is a computer program that can automatically tweet, retweet, and follow other accounts. Twitter's open application programming interface and the availability of cloud servers make it possible for Twitter bots to exist within the social networking site. Benign Twitter bots may generate creative content and relevant product updates whereas malicious bots can make unpopular people seem popular, push irrelevant products on users and spread misinformation, spam or slander. Bots amass significant influence and have been noted to sway elections, influence the stock market, public appeal, and attack governments. As of 2013, Twitter said there were 20 million fake accounts on Twitter, representing less than 5% of active users. A 2020 estimate put the figure at 15% of all accounts or around 48 million accounts.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
For his awesome research, Tugrulcan is going to use the PageRank with teleportation and HITS algorithm, not on a network of webpages but on the retweet network of Twitter! The retweet network is a directed graph, where nodes are users and an edge going out from a user A and to a user B means that "User A retweeted User B". Which one is false about a Twitter bot that retweeted other users frequently but got never retweeted by other users or by itself?
It is sometimes desirable to identify when a Twitter account is controlled by a internet bot. Following a test period, Twitter rolled out labels to identify bot accounts and automated tweets in February 2022.Detecting non-human Twitter users has been of interest to academics.In a 2012 paper, Chu et al. propose the following criteria that indicate that an account may be a bot (they were designing an automated system): "Periodic and regular timing" of tweets; Whether the tweet content contains known spam; and The ratio of tweets from mobile versus desktop, as compared to an average human Twitter user.Emilio Ferrara at the University of Southern California used artificial intelligence to identify Twitter bots. He found that humans reply to other tweets four or five times more than bots and that bots continue to post longer tweets over time. Bots also post at more regular time gaps, for example, tweeting at 30-minute or 60-minute intervals.Indiana University has developed a free service called Botometer (formerly BotOrNot), which scores Twitter handles based on their likelihood of being a Twitterbot.Recent research from EPFL argued that classifying a Twitter account as bot or not may not be always possible because hackers take over human accounts and use them as bots temporarily or permanently and in parallel to the owner of the account in some cases.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Let $f_{\mathrm{MLP}}: \mathbb{R}^{d} \rightarrow \mathbb{R}$ be an $L$-hidden layer multi-layer perceptron (MLP) such that $$ f_{\mathrm{MLP}}(\mathbf{x})=\mathbf{w}^{\top} \sigma\left(\mathbf{W}_{L} \sigma\left(\mathbf{W}_{L-1} \ldots \sigma\left(\mathbf{W}_{1} \mathbf{x}\right)\right)\right) $$ with $\mathbf{w} \in \mathbb{R}^{M}, \mathbf{W}_{1} \in \mathbb{R}^{M \times d}$ and $\mathbf{W}_{\ell} \in \mathbb{R}^{M \times M}$ for $\ell=2, \ldots, L$, and $\sigma$ is an entry-wise activation function. Also, let $f_{\mathrm{CNN}}: \mathbb{R}^{d} \rightarrow \mathbb{R}$ be an $L^{\prime}$-hidden layer convolutional neural network (CNN) such that $$ f_{\mathrm{CNN}}(\mathbf{x})=\mathbf{w}^{\top} \sigma\left(\mathbf{w}_{L^{\prime}} \star \sigma\left(\mathbf{w}_{L^{\prime}-1} \star \ldots \sigma\left(\mathbf{w}_{1} \star \mathbf{x}\right)\right)\right) $$ with $\mathbf{w} \in \mathbb{R}^{d}, \mathbf{w}_{\ell} \in \mathbb{R}^{K}$ for $\ell=1, \ldots, L^{\prime}$ and $\star$ denoting the one-dimensional convolution operator with zero-padding, i.e., output of the convolution has the same dimensionality as the input. Let's assume $\sigma$ is a tanh activation function. Thus, by flipping the signs of all of the weights leading in and out of a hidden neuron, the input-output mapping function represented by the network is unchanged. Besides, interchanging the values of all of the weights (i.e., by permuting the ordering of the hidden neurons within the layer) also leaves the network input-output mapping function unchanged. Suppose that, given the training data, SGD can find a solution with zero training loss, and the (absolute value) weights of such solution are non-zero and all unique. Choose the largest lower bound on the number of solutions (with zero training loss) achievable by $f_{\mathrm{MLP}}$ with $L=1$ and $M$ hidden units on this dataset.
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
Let $f_{\mathrm{MLP}}: \mathbb{R}^{d} \rightarrow \mathbb{R}$ be an $L$-hidden layer multi-layer perceptron (MLP) such that $$ f_{\mathrm{MLP}}(\mathbf{x})=\mathbf{w}^{\top} \sigma\left(\mathbf{W}_{L} \sigma\left(\mathbf{W}_{L-1} \ldots \sigma\left(\mathbf{W}_{1} \mathbf{x}\right)\right)\right) $$ with $\mathbf{w} \in \mathbb{R}^{M}, \mathbf{W}_{1} \in \mathbb{R}^{M \times d}$ and $\mathbf{W}_{\ell} \in \mathbb{R}^{M \times M}$ for $\ell=2, \ldots, L$, and $\sigma$ is an entry-wise activation function. Also, let $f_{\mathrm{CNN}}: \mathbb{R}^{d} \rightarrow \mathbb{R}$ be an $L^{\prime}$-hidden layer convolutional neural network (CNN) such that $$ f_{\mathrm{CNN}}(\mathbf{x})=\mathbf{w}^{\top} \sigma\left(\mathbf{w}_{L^{\prime}} \star \sigma\left(\mathbf{w}_{L^{\prime}-1} \star \ldots \sigma\left(\mathbf{w}_{1} \star \mathbf{x}\right)\right)\right) $$ with $\mathbf{w} \in \mathbb{R}^{d}, \mathbf{w}_{\ell} \in \mathbb{R}^{K}$ for $\ell=1, \ldots, L^{\prime}$ and $\star$ denoting the one-dimensional convolution operator with zero-padding, i.e., output of the convolution has the same dimensionality as the input. Let's assume $\sigma$ is a tanh activation function. Thus, by flipping the signs of all of the weights leading in and out of a hidden neuron, the input-output mapping function represented by the network is unchanged. Besides, interchanging the values of all of the weights (i.e., by permuting the ordering of the hidden neurons within the layer) also leaves the network input-output mapping function unchanged. Suppose that, given the training data, SGD can find a solution with zero training loss, and the (absolute value) weights of such solution are non-zero and all unique. Choose the largest lower bound on the number of solutions (with zero training loss) achievable by $f_{\mathrm{MLP}}$ with $L=1$ and $M$ hidden units on this dataset.
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
Consider a linear regression problem with $N$ samples $\left\{\left(\boldsymbol{x}_{n}, y_{n}\right)\right\}_{n=1}^{N}$, where each input $\boldsymbol{x}_{n}$ is a $D$-dimensional vector $\{-1,+1\}^{D}$, and all output values are $y_{i} \in \mathbb{R}$. Which of the following statements is correct?
In some models (standard linear regression, in particular), the equations for each of the data points i = 1, ..., n are stacked together and written in vector form as y = X β + ε , {\displaystyle \mathbf {y} =\mathbf {X} {\boldsymbol {\beta }}+{\boldsymbol {\varepsilon }},\,} where y = ( y 1 y 2 ⋮ y n ) , X = ( x 1 ′ x 2 ′ ⋮ x n ′ ) = ( x 11 ⋯ x 1 p x 21 ⋯ x 2 p ⋮ ⋱ ⋮ x n 1 ⋯ x n p ) , β = ( β 1 ⋮ β p ) , ε = ( ε 1 ε 2 ⋮ ε n ) . {\displaystyle \mathbf {y} ={\begin{pmatrix}y_{1}\\y_{2}\\\vdots \\y_{n}\end{pmatrix}},\quad \mathbf {X} ={\begin{pmatrix}\mathbf {x} '_{1}\\\mathbf {x} '_{2}\\\vdots \\\mathbf {x} '_{n}\end{pmatrix}}={\begin{pmatrix}x_{11}&\cdots &x_{1p}\\x_{21}&\cdots &x_{2p}\\\vdots &\ddots &\vdots \\x_{n1}&\cdots &x_{np}\end{pmatrix}},\quad {\boldsymbol {\beta }}={\begin{pmatrix}\beta _{1}\\\vdots \\\beta _{p}\end{pmatrix}},\quad {\boldsymbol {\varepsilon }}={\begin{pmatrix}\varepsilon _{1}\\\varepsilon _{2}\\\vdots \\\varepsilon _{n}\end{pmatrix}}.} The matrix X is known as the design matrix and encodes all known information about the independent variables.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a linear regression problem with $N$ samples $\left\{\left(\boldsymbol{x}_{n}, y_{n}\right)\right\}_{n=1}^{N}$, where each input $\boldsymbol{x}_{n}$ is a $D$-dimensional vector $\{-1,+1\}^{D}$, and all output values are $y_{i} \in \mathbb{R}$. Which of the following statements is correct?
In some models (standard linear regression, in particular), the equations for each of the data points i = 1, ..., n are stacked together and written in vector form as y = X β + ε , {\displaystyle \mathbf {y} =\mathbf {X} {\boldsymbol {\beta }}+{\boldsymbol {\varepsilon }},\,} where y = ( y 1 y 2 ⋮ y n ) , X = ( x 1 ′ x 2 ′ ⋮ x n ′ ) = ( x 11 ⋯ x 1 p x 21 ⋯ x 2 p ⋮ ⋱ ⋮ x n 1 ⋯ x n p ) , β = ( β 1 ⋮ β p ) , ε = ( ε 1 ε 2 ⋮ ε n ) . {\displaystyle \mathbf {y} ={\begin{pmatrix}y_{1}\\y_{2}\\\vdots \\y_{n}\end{pmatrix}},\quad \mathbf {X} ={\begin{pmatrix}\mathbf {x} '_{1}\\\mathbf {x} '_{2}\\\vdots \\\mathbf {x} '_{n}\end{pmatrix}}={\begin{pmatrix}x_{11}&\cdots &x_{1p}\\x_{21}&\cdots &x_{2p}\\\vdots &\ddots &\vdots \\x_{n1}&\cdots &x_{np}\end{pmatrix}},\quad {\boldsymbol {\beta }}={\begin{pmatrix}\beta _{1}\\\vdots \\\beta _{p}\end{pmatrix}},\quad {\boldsymbol {\varepsilon }}={\begin{pmatrix}\varepsilon _{1}\\\varepsilon _{2}\\\vdots \\\varepsilon _{n}\end{pmatrix}}.} The matrix X is known as the design matrix and encodes all known information about the independent variables.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We apply a Gaussian Mixture Model made of $K$ isotropic Gaussians (invariant to rotation around its center) to $N$ vectors of dimension $D$. What is the number of \emph{free} parameters of this model?
Gaussian mixture distributions are identifiable and commonly used for generative models. The parameterized joint distribution can be written as p ( x , y | θ ) = p ( y | θ ) p ( x | y , θ ) {\displaystyle p(x,y|\theta )=p(y|\theta )p(x|y,\theta )} by using the chain rule. Each parameter vector θ {\displaystyle \theta } is associated with a decision function f θ ( x ) = argmax y p ( y | x , θ ) {\displaystyle f_{\theta }(x)={\underset {y}{\operatorname {argmax} }}\ p(y|x,\theta )} . The parameter is then chosen based on fit to both the labeled and unlabeled data, weighted by λ {\displaystyle \lambda }: argmax Θ ( log ⁡ p ( { x i , y i } i = 1 l | θ ) + λ log ⁡ p ( { x i } i = l + 1 l + u | θ ) ) {\displaystyle {\underset {\Theta }{\operatorname {argmax} }}\left(\log p(\{x_{i},y_{i}\}_{i=1}^{l}|\theta )+\lambda \log p(\{x_{i}\}_{i=l+1}^{l+u}|\theta )\right)}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We apply a Gaussian Mixture Model made of $K$ isotropic Gaussians (invariant to rotation around its center) to $N$ vectors of dimension $D$. What is the number of \emph{free} parameters of this model?
Gaussian mixture distributions are identifiable and commonly used for generative models. The parameterized joint distribution can be written as p ( x , y | θ ) = p ( y | θ ) p ( x | y , θ ) {\displaystyle p(x,y|\theta )=p(y|\theta )p(x|y,\theta )} by using the chain rule. Each parameter vector θ {\displaystyle \theta } is associated with a decision function f θ ( x ) = argmax y p ( y | x , θ ) {\displaystyle f_{\theta }(x)={\underset {y}{\operatorname {argmax} }}\ p(y|x,\theta )} . The parameter is then chosen based on fit to both the labeled and unlabeled data, weighted by λ {\displaystyle \lambda }: argmax Θ ( log ⁡ p ( { x i , y i } i = 1 l | θ ) + λ log ⁡ p ( { x i } i = l + 1 l + u | θ ) ) {\displaystyle {\underset {\Theta }{\operatorname {argmax} }}\left(\log p(\{x_{i},y_{i}\}_{i=1}^{l}|\theta )+\lambda \log p(\{x_{i}\}_{i=l+1}^{l+u}|\theta )\right)}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Recall that the hard-margin SVM problem corresponds to: $$ \underset{\substack{\ww \in \R^d, \ orall i:\ y_i \ww^ op \xx_i \geq 1}}{\min} \Vert \ww \Vert_2.$$ Now consider the $2$-dimensional classification dataset corresponding to the $3$ following datapoints: $\xx_1 = (-1, 2)$, $\xx_2 = (1, 2)$, $\xx_3 = (0, -2)$ and $y_1 = y_2 = 1$, $y_3 = -1$. Which of the following statements is extbf{true}:
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
Recall that the hard-margin SVM problem corresponds to: $$ \underset{\substack{\ww \in \R^d, \ orall i:\ y_i \ww^ op \xx_i \geq 1}}{\min} \Vert \ww \Vert_2.$$ Now consider the $2$-dimensional classification dataset corresponding to the $3$ following datapoints: $\xx_1 = (-1, 2)$, $\xx_2 = (1, 2)$, $\xx_3 = (0, -2)$ and $y_1 = y_2 = 1$, $y_3 = -1$. Which of the following statements is extbf{true}:
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
In this exercise, we will see how to combine the Principal Component Analysis (PCA) and the kernel method into an algorithm known as kernel PCA. We are given $n$ observations in a low dimensional space $\mathbf{x}_{1}, \cdots, \mathbf{x}_{n} \in \mathbb{R}^{L}$ and we consider a kernel $k$ and its associated features $\operatorname{map} \phi: \mathbb{R}^{L} \mapsto \mathbb{R}^{H}$ which satisfies: $$ k(\mathbf{x}, \mathbf{y})=\langle\phi(\mathbf{x}), \phi(\mathbf{y})\rangle_{\mathbb{R}^{H}} $$ where $\langle\cdot, \cdot\rangle_{\mathbb{R}^{H}}$ is the standard scalar product of $\mathbb{R}^{H}$. We define the empirical covariance matrix and the empirical covariance matrix of the mapped observations as: $$ \boldsymbol{\Sigma}:=\frac{1}{n} \sum_{i=1}^{n} \mathbf{x}_{i} \mathbf{x}_{i}^{\top} \quad \text { and } \quad \boldsymbol{\Sigma}^{\mathbf{H}}:=\frac{1}{n} \sum_{i=1}^{n} \phi\left(\mathbf{x}_{i}\right) \phi\left(\mathbf{x}_{i}\right)^{\top} $$ The kernel matrix $\mathbf{K}$ is defined by: $$ \mathbf{K}_{i, j}:=k\left(\mathbf{x}_{i}, \mathbf{x}_{j}\right)=\left\langle\phi\left(\mathbf{x}_{i}\right), \phi\left(\mathbf{x}_{j}\right)\right\rangle_{\mathbb{R}^{H}} $$ We also define the data matrix and the corresponding matrix of the mapped data as: $$ \mathbf{X}:=\left(\begin{array}{c} \mathbf{x}_{1}^{\top} \\ \cdots \\ \mathbf{x}_{n}^{\top} \end{array}\right) \in \mathbb{R}^{n \times L} \quad \text { and } \quad \mathbf{\Phi}:=\left(\begin{array}{c} \phi\left(\mathbf{x}_{1}\right)^{\top} \\ \cdots \\ \phi\left(\mathbf{x}_{n}\right)^{\top} \end{array}\right) \in \mathbb{R}^{n \times H} . $$ Finally we denote the eigenpairs (eigenvalues and eigenvectors) of $\boldsymbol{\Sigma}^{\mathbf{H}}$ by $\left\{\left(\lambda_{i}, \mathbf{v}_{i}\right)\right\}_{i=1}^{H}$ and those of $\mathbf{K}$ by $\left\{\left(\rho_{j}, \mathbf{w}_{j}\right)\right\}_{j=1}^{n}$. We also assume that the vectors $\mathbf{v}_{i}$ and $\mathbf{w}_{j}$ are normalized. Thus: $$ \boldsymbol{\Sigma}^{\mathbf{H}} \mathbf{v}_{i}=\lambda_{i} \mathbf{v}_{i}, \quad\left\|\mathbf{v}_{i}\right\|_{2}=1 \quad \text { and } \quad \mathbf{K} \mathbf{w}_{j}=\rho_{j} \mathbf{w}_{j}, \quad\left\|\mathbf{w}_{j}\right\|_{2}=1 $$ Let us remind that we assume in the kernel setting that we can compute $k(\mathbf{x}, \mathbf{y})$ but that we cannot directly compute $\phi(\mathbf{x})$ What we would like to do is to first map the data into the high-dimensional space using the features map $\phi$ and then to apply the standard PCA algorithm in the high-dimensional space $\mathbb{R}^{H}$. This would amount to: (a) Computing the empirical covariance matrix $\boldsymbol{\Sigma}^{\mathbf{H}}$ of the mapped data $\phi\left(\mathbf{x}_{i}\right)$. (b) Computing the eigenvectors $\mathbf{v}_{1}, \cdots, \mathbf{v}_{N}$ associated with the $N$ largest eigenvalues of $\boldsymbol{\Sigma}^{\mathbf{H}}$. (c) Computing the projection $\Pi\left(\phi\left(\mathbf{x}_{i}\right)\right) \in \mathbb{R}^{L}$ for each data point onto these eigenvectors, where the $j$-th component of the projection is given by: $$ \Pi_{j}\left(\phi\left(\mathbf{x}_{i}\right)\right)=\left\langle\phi\left(\mathbf{x}_{i}\right), \mathbf{v}_{j}\right\rangle_{\mathbb{R}^{H}} $$ Explain why we cannot directly apply the algorithm explained above.
Principal component analysis can be employed in a nonlinear way by means of the kernel trick. The resulting technique is capable of constructing nonlinear mappings that maximize the variance in the data. The resulting technique is called kernel PCA.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
In this exercise, we will see how to combine the Principal Component Analysis (PCA) and the kernel method into an algorithm known as kernel PCA. We are given $n$ observations in a low dimensional space $\mathbf{x}_{1}, \cdots, \mathbf{x}_{n} \in \mathbb{R}^{L}$ and we consider a kernel $k$ and its associated features $\operatorname{map} \phi: \mathbb{R}^{L} \mapsto \mathbb{R}^{H}$ which satisfies: $$ k(\mathbf{x}, \mathbf{y})=\langle\phi(\mathbf{x}), \phi(\mathbf{y})\rangle_{\mathbb{R}^{H}} $$ where $\langle\cdot, \cdot\rangle_{\mathbb{R}^{H}}$ is the standard scalar product of $\mathbb{R}^{H}$. We define the empirical covariance matrix and the empirical covariance matrix of the mapped observations as: $$ \boldsymbol{\Sigma}:=\frac{1}{n} \sum_{i=1}^{n} \mathbf{x}_{i} \mathbf{x}_{i}^{\top} \quad \text { and } \quad \boldsymbol{\Sigma}^{\mathbf{H}}:=\frac{1}{n} \sum_{i=1}^{n} \phi\left(\mathbf{x}_{i}\right) \phi\left(\mathbf{x}_{i}\right)^{\top} $$ The kernel matrix $\mathbf{K}$ is defined by: $$ \mathbf{K}_{i, j}:=k\left(\mathbf{x}_{i}, \mathbf{x}_{j}\right)=\left\langle\phi\left(\mathbf{x}_{i}\right), \phi\left(\mathbf{x}_{j}\right)\right\rangle_{\mathbb{R}^{H}} $$ We also define the data matrix and the corresponding matrix of the mapped data as: $$ \mathbf{X}:=\left(\begin{array}{c} \mathbf{x}_{1}^{\top} \\ \cdots \\ \mathbf{x}_{n}^{\top} \end{array}\right) \in \mathbb{R}^{n \times L} \quad \text { and } \quad \mathbf{\Phi}:=\left(\begin{array}{c} \phi\left(\mathbf{x}_{1}\right)^{\top} \\ \cdots \\ \phi\left(\mathbf{x}_{n}\right)^{\top} \end{array}\right) \in \mathbb{R}^{n \times H} . $$ Finally we denote the eigenpairs (eigenvalues and eigenvectors) of $\boldsymbol{\Sigma}^{\mathbf{H}}$ by $\left\{\left(\lambda_{i}, \mathbf{v}_{i}\right)\right\}_{i=1}^{H}$ and those of $\mathbf{K}$ by $\left\{\left(\rho_{j}, \mathbf{w}_{j}\right)\right\}_{j=1}^{n}$. We also assume that the vectors $\mathbf{v}_{i}$ and $\mathbf{w}_{j}$ are normalized. Thus: $$ \boldsymbol{\Sigma}^{\mathbf{H}} \mathbf{v}_{i}=\lambda_{i} \mathbf{v}_{i}, \quad\left\|\mathbf{v}_{i}\right\|_{2}=1 \quad \text { and } \quad \mathbf{K} \mathbf{w}_{j}=\rho_{j} \mathbf{w}_{j}, \quad\left\|\mathbf{w}_{j}\right\|_{2}=1 $$ Let us remind that we assume in the kernel setting that we can compute $k(\mathbf{x}, \mathbf{y})$ but that we cannot directly compute $\phi(\mathbf{x})$ What we would like to do is to first map the data into the high-dimensional space using the features map $\phi$ and then to apply the standard PCA algorithm in the high-dimensional space $\mathbb{R}^{H}$. This would amount to: (a) Computing the empirical covariance matrix $\boldsymbol{\Sigma}^{\mathbf{H}}$ of the mapped data $\phi\left(\mathbf{x}_{i}\right)$. (b) Computing the eigenvectors $\mathbf{v}_{1}, \cdots, \mathbf{v}_{N}$ associated with the $N$ largest eigenvalues of $\boldsymbol{\Sigma}^{\mathbf{H}}$. (c) Computing the projection $\Pi\left(\phi\left(\mathbf{x}_{i}\right)\right) \in \mathbb{R}^{L}$ for each data point onto these eigenvectors, where the $j$-th component of the projection is given by: $$ \Pi_{j}\left(\phi\left(\mathbf{x}_{i}\right)\right)=\left\langle\phi\left(\mathbf{x}_{i}\right), \mathbf{v}_{j}\right\rangle_{\mathbb{R}^{H}} $$ Explain why we cannot directly apply the algorithm explained above.
In the field of multivariate statistics, kernel principal component analysis (kernel PCA) is an extension of principal component analysis (PCA) using techniques of kernel methods. Using a kernel, the originally linear operations of PCA are performed in a reproducing kernel Hilbert space.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Let $\mathcal{R}_{p}(f, \varepsilon)$ be the $\ell_{p}$ adversarial risk of a classifier $f: \mathbb{R}^{d} \rightarrow\{ \pm 1\}$, i.e., $$ \mathcal{R}_{p}(f, \varepsilon)=\mathbb{E}_{(\mathbf{x}, y) \sim \mathcal{D}}\left[\max _{\tilde{\mathbf{x}}:\|\mathbf{x}-\tilde{\mathbf{x}}\|_{p} \leq \varepsilon} \mathbb{1}_{\{f(\tilde{\mathbf{x}}) \neq y\}}\right], $$ for $p=1,2, \infty$. Which of the following relationships between the adversarial risks is true?
Assume the VC-dimension of the underlying base classifier is d {\displaystyle d} and m ≥ d ≥ 1 {\displaystyle m\geq d\geq 1} . Then with probability 1 − δ {\displaystyle 1-\delta } we have the bound P D ( y ∑ j t α j h j ( x ) ∑ | α j | ≤ 0 ) ≤ P S ( y ∑ j t α j h j ( x ) ∑ | α j | ≤ θ ) + O ( 1 m d log 2 ⁡ ( m / d ) / θ 2 + log ⁡ ( 1 / δ ) ) {\displaystyle P_{D}\left({\frac {y\sum _{j}^{t}\alpha _{j}h_{j}(x)}{\sum |\alpha _{j}|}}\leq 0\right)\leq P_{S}\left({\frac {y\sum _{j}^{t}\alpha _{j}h_{j}(x)}{\sum |\alpha _{j}|}}\leq \theta \right)+O\left({\frac {1}{\sqrt {m}}}{\sqrt {d\log ^{2}(m/d)/\theta ^{2}+\log(1/\delta )}}\right)} for all θ > 0 {\displaystyle \theta >0} . == References ==
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Let $\mathcal{R}_{p}(f, \varepsilon)$ be the $\ell_{p}$ adversarial risk of a classifier $f: \mathbb{R}^{d} \rightarrow\{ \pm 1\}$, i.e., $$ \mathcal{R}_{p}(f, \varepsilon)=\mathbb{E}_{(\mathbf{x}, y) \sim \mathcal{D}}\left[\max _{\tilde{\mathbf{x}}:\|\mathbf{x}-\tilde{\mathbf{x}}\|_{p} \leq \varepsilon} \mathbb{1}_{\{f(\tilde{\mathbf{x}}) \neq y\}}\right], $$ for $p=1,2, \infty$. Which of the following relationships between the adversarial risks is true?
Fix a loss function L: Y × Y → R ≥ 0 {\displaystyle {\mathcal {L}}\colon Y\times Y\to \mathbb {R} _{\geq 0}} , for example, the square loss L ( y , y ′ ) = ( y − y ′ ) 2 {\displaystyle {\mathcal {L}}(y,y')=(y-y')^{2}} , where h ( x ) = y ′ {\displaystyle h(x)=y'} . For a given distribution ρ {\displaystyle \rho } on X × Y {\displaystyle X\times Y} , the expected risk of a hypothesis (a function) h ∈ H {\displaystyle h\in {\mathcal {H}}} is E ( h ) := E ρ = ∫ X × Y L ( h ( x ) , y ) d ρ ( x , y ) {\displaystyle {\mathcal {E}}(h):=\mathbb {E} _{\rho }=\int _{X\times Y}{\mathcal {L}}(h(x),y)\,d\rho (x,y)} In our setting, we have h = A ( S n ) {\displaystyle h={\mathcal {A}}(S_{n})} , where A {\displaystyle {\mathcal {A}}} is a learning algorithm and S n = ( ( x 1 , y 1 ) , … , ( x n , y n ) ) ∼ ρ n {\displaystyle S_{n}=((x_{1},y_{1}),\ldots ,(x_{n},y_{n}))\sim \rho ^{n}} is a sequence of vectors which are all drawn independently from ρ {\displaystyle \rho } . Define the optimal riskSet h n = A ( S n ) {\displaystyle h_{n}={\mathcal {A}}(S_{n})} , for each n {\displaystyle n} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The following function(s) have a unique minimizer.
So the algorithm can be slightly revised as follows. minimize V ( w → , ξ → ) = 1 2 w → ⋅ w → + constant ⋅ ∑ ξ i , j , k subject to ∀ ξ i , j , k ≧ 0 ∀ ( c i , c j ) ∈ r k ′ w → ( Φ ( q 1 , c i ) − Φ ( q 1 , c j ) ) ≧ 1 − ξ i , j , 1 ; ⋮ w → ( Φ ( q n , c i ) − Φ ( q n , c j ) ) ≧ 1 − ξ i , j , n ; where k ∈ { 1 , 2 , … , n } , i , j ∈ { 1 , 2 , … } .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
The following function(s) have a unique minimizer.
The goal is to minimize ∑ i = 1 m ∑ j = 1 n t i , j x i , j {\displaystyle \sum \limits _{i=1}^{m}\sum \limits _{j=1}^{n}t_{i,j}x_{i,j}} subject to: x r , s ≥ 0 {\displaystyle x_{r,s}\geq 0} ; ∀ r = 1 … m {\displaystyle \forall r=1\ldots m} , s = 1 … n {\displaystyle s=1\ldots n} ∑ s = 1 m + n x i , s − ∑ r = 1 m + n x r , i = a i {\displaystyle \sum _{s=1}^{m+n}{x_{i,s}}-\sum _{r=1}^{m+n}{x_{r,i}}=a_{i}} ; ∀ i = 1 … m {\displaystyle \forall i=1\ldots m} ∑ r = 1 m + n x r , m + j − ∑ s = 1 m + n x m + j , s = b m + j {\displaystyle \sum _{r=1}^{m+n}{x_{r,m+j}}-\sum _{s=1}^{m+n}{x_{m+j,s}}=b_{m+j}} ; ∀ j = 1 … n {\displaystyle \forall j=1\ldots n} ∑ i = 1 m a i = ∑ j = 1 n b m + j {\displaystyle \sum _{i=1}^{m}{a_{i}}=\sum _{j=1}^{n}{b_{m+j}}}
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We will analyze the $K$-means algorithm and show that it always converge. Let us consider the $K$-means objective function: $$ \mathcal{L}(\mathbf{z}, \boldsymbol{\mu})=\sum_{n=1}^{N} \sum_{k=1}^{K} z_{n k}\left\|\mathbf{x}_{n}-\boldsymbol{\mu}_{k}\right\|_{2}^{2} $$ where $z_{n k} \in\{0,1\}$ with $\sum_{k=1}^{K} z_{n k}=1$ and $\boldsymbol{\mu}_{k} \in \mathbb{R}^{D}$ for $k=1, \ldots, K$ and $n=1, \ldots, N$. How would you choose the $\left\{z_{n k}\right\}_{n, k=1}^{N, K}$ to minimize $\mathcal{L}(\mathbf{z}, \boldsymbol{\mu})$ for given $\left\{\boldsymbol{\mu}_{k}\right\}_{k=1}^{K}$ ? Compute the closed-form formula for the $z_{n k}$. To which step of the $K$-means algorithm does it correspond?
It can be shown that the algorithm will terminate in a finite number of iterations (no more than the total number of possible assignments, which is bounded by k m {\displaystyle k^{m}} ). In addition, the algorithm will terminate at a point that the overall objective cannot be decreased either by a different assignment or by defining new cluster planes for these clusters (such point is called "locally optimal" in the references). This convergence result is a consequence of the fact that problem (P2) can be solved exactly. The same convergence result holds for k-means algorithm because the cluster update problem can be solved exactly.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
We will analyze the $K$-means algorithm and show that it always converge. Let us consider the $K$-means objective function: $$ \mathcal{L}(\mathbf{z}, \boldsymbol{\mu})=\sum_{n=1}^{N} \sum_{k=1}^{K} z_{n k}\left\|\mathbf{x}_{n}-\boldsymbol{\mu}_{k}\right\|_{2}^{2} $$ where $z_{n k} \in\{0,1\}$ with $\sum_{k=1}^{K} z_{n k}=1$ and $\boldsymbol{\mu}_{k} \in \mathbb{R}^{D}$ for $k=1, \ldots, K$ and $n=1, \ldots, N$. How would you choose the $\left\{z_{n k}\right\}_{n, k=1}^{N, K}$ to minimize $\mathcal{L}(\mathbf{z}, \boldsymbol{\mu})$ for given $\left\{\boldsymbol{\mu}_{k}\right\}_{k=1}^{K}$ ? Compute the closed-form formula for the $z_{n k}$. To which step of the $K$-means algorithm does it correspond?
Given a set of observations (x1, x2, ..., xn), where each observation is a d-dimensional real vector, k-means clustering aims to partition the n observations into k (≤ n) sets S = {S1, S2, ..., Sk} so as to minimize the within-cluster sum of squares (WCSS) (i.e. variance). Formally, the objective is to find: where μi is the mean (also called centroid) of points in S i {\displaystyle S_{i}} , i.e. | S i | {\displaystyle |S_{i}|} is the size of S i {\displaystyle S_{i}} , and ‖ ⋅ ‖ {\displaystyle \|\cdot \|} is the usual L2 norm . This is equivalent to minimizing the pairwise squared deviations of points in the same cluster: The equivalence can be deduced from identity | S i | ∑ x ∈ S i ‖ x − μ i ‖ 2 = 1 2 ∑ x , y ∈ S i ‖ x − y ‖ 2 {\textstyle |S_{i}|\sum _{\mathbf {x} \in S_{i}}\left\|\mathbf {x} -{\boldsymbol {\mu }}_{i}\right\|^{2}={\frac {1}{2}}\sum _{\mathbf {x} ,\mathbf {y} \in S_{i}}\left\|\mathbf {x} -\mathbf {y} \right\|^{2}} . Since the total variance is constant, this is equivalent to maximizing the sum of squared deviations between points in different clusters (between-cluster sum of squares, BCSS). This deterministic relationship is also related to the law of total variance in probability theory.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
(Stochastic Gradient Descent) One iteration of standard SGD for SVM, logistic regression and ridge regression costs roughly $\mathcal{O}(D)$, where $D$ is the dimension of a data point.
Stochastic gradient descent (often abbreviated SGD) is an iterative method for optimizing an objective function with suitable smoothness properties (e.g. differentiable or subdifferentiable). It can be regarded as a stochastic approximation of gradient descent optimization, since it replaces the actual gradient (calculated from the entire data set) by an estimate thereof (calculated from a randomly selected subset of the data). Especially in high-dimensional optimization problems this reduces the very high computational burden, achieving faster iterations in exchange for a lower convergence rate.While the basic idea behind stochastic approximation can be traced back to the Robbins–Monro algorithm of the 1950s, stochastic gradient descent has become an important optimization method in machine learning.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
(Stochastic Gradient Descent) One iteration of standard SGD for SVM, logistic regression and ridge regression costs roughly $\mathcal{O}(D)$, where $D$ is the dimension of a data point.
A conceptually simple extension of stochastic gradient descent makes the learning rate a decreasing function ηt of the iteration number t, giving a learning rate schedule, so that the first iterations cause large changes in the parameters, while the later ones do only fine-tuning. Such schedules have been known since the work of MacQueen on k-means clustering. Practical guidance on choosing the step size in several variants of SGD is given by Spall.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following joint distribution that has the factorization $$ p\left(x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\right)=p\left(x_{1}\right) p\left(x_{2} \mid x_{1}\right) p\left(x_{3} \mid x_{2}\right) p\left(x_{4} \mid x_{1}, x_{3}\right) p\left(x_{5} \mid x_{4}\right) . $$ We say that a data point $y$ follows a Poisson distribution with parameter $\theta$ if the probability of the observation $y, y \in \mathbb{N}$, is given by $$ p(y \mid \theta)=\frac{\theta^{y} e^{-\theta}}{y !} $$ Assume that you are given the samples $\mathcal{S}=\left\{y_{1}, \cdots, y_{N}\right\}$ (a) Write down the log-likelihood, call it $\mathcal{L}$, of these samples as a function of $\theta$ assuming that the samples are iid and follow a Poisson distribution with parameter $\theta$. (b) What is the parameter $\theta$ that maximizes this log-likelihood expressed as a function of the samples?
We model a set of observations as a random sample from an unknown joint probability distribution which is expressed in terms of a set of parameters. The goal of maximum likelihood estimation is to determine the parameters for which the observed data have the highest joint probability. We write the parameters governing the joint distribution as a vector θ = T {\displaystyle \;\theta =\left^{\mathsf {T}}\;} so that this distribution falls within a parametric family { f ( ⋅ ; θ ) ∣ θ ∈ Θ } , {\displaystyle \;\{f(\cdot \,;\theta )\mid \theta \in \Theta \}\;,} where Θ {\displaystyle \,\Theta \,} is called the parameter space, a finite-dimensional subset of Euclidean space. Evaluating the joint density at the observed data sample y = ( y 1 , y 2 , … , y n ) {\displaystyle \;\mathbf {y} =(y_{1},y_{2},\ldots ,y_{n})\;} gives a real-valued function, L n ( θ ) = L n ( θ ; y ) = f n ( y ; θ ) , {\displaystyle {\mathcal {L}}_{n}(\theta )={\mathcal {L}}_{n}(\theta ;\mathbf {y} )=f_{n}(\mathbf {y} ;\theta )\;,} which is called the likelihood function.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider the following joint distribution that has the factorization $$ p\left(x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\right)=p\left(x_{1}\right) p\left(x_{2} \mid x_{1}\right) p\left(x_{3} \mid x_{2}\right) p\left(x_{4} \mid x_{1}, x_{3}\right) p\left(x_{5} \mid x_{4}\right) . $$ We say that a data point $y$ follows a Poisson distribution with parameter $\theta$ if the probability of the observation $y, y \in \mathbb{N}$, is given by $$ p(y \mid \theta)=\frac{\theta^{y} e^{-\theta}}{y !} $$ Assume that you are given the samples $\mathcal{S}=\left\{y_{1}, \cdots, y_{N}\right\}$ (a) Write down the log-likelihood, call it $\mathcal{L}$, of these samples as a function of $\theta$ assuming that the samples are iid and follow a Poisson distribution with parameter $\theta$. (b) What is the parameter $\theta$ that maximizes this log-likelihood expressed as a function of the samples?
{\displaystyle p({\bf {y}},\theta |{\bf {x}})\;=\;p({\bf {y}}|{\bf {x}},\theta )p(\theta )\;=\;p({\bf {y}}|{\bf {x}})p(\theta |{\bf {y}},{\bf {x}})\;\simeq \;{\tilde {q}}(\theta )\;=\;Zq(\theta ).} The joint is equal to the product of the likelihood and the prior and by Bayes' rule, equal to the product of the marginal likelihood p ( y | x ) {\displaystyle p({\bf {y}}|{\bf {x}})} and posterior p ( θ | y , x ) {\displaystyle p(\theta |{\bf {y}},{\bf {x}})} . Seen as a function of θ {\displaystyle \theta } the joint is an un-normalised density.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider two fully connected networks, A and B, with a constant width for all layers, inputs and outputs. Network A has depth $3L$ and width $H$, network B has depth $L$ and width $2H$. Everything else is identical for the two networks and both $L$ and $H$ are large. In this case, performing a single iteration of backpropagation requires fewer scalar multiplications for network A than for network B.
The universal approximation property of width-bounded networks has been studied as a dual of classical universal approximation results on depth-bounded networks. For input dimension dx and output dimension dy the minimum width required for the universal approximation of the Lp functions is exactly max{dx + 1, dy} (for a ReLU network). More generally this also holds if both ReLU and a threshold activation function are used.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider two fully connected networks, A and B, with a constant width for all layers, inputs and outputs. Network A has depth $3L$ and width $H$, network B has depth $L$ and width $2H$. Everything else is identical for the two networks and both $L$ and $H$ are large. In this case, performing a single iteration of backpropagation requires fewer scalar multiplications for network A than for network B.
In the same paper it was shown that ReLU networks with width n + 1 were sufficient to approximate any continuous function of n-dimensional input variables. The following refinement, specifies the optimal minimum width for which such an approximation is possible and is due to.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Now let $\xv$ be a random vector distributed according to the uniform distribution over the finite centered dataset $\xv_1, . . . , \xv_N$ from above. % Consider the problem of finding a unit vector, $\wv \in \R^D$, such that the random variable $\wv^ op \xx$ has \emph{maximal} variance. What does it mean for the data vectors $\xv_1, . . . , \xv_N$ to be centered, as for principle component analysis (PCA) to be meaningful? Use the notation $\x_{nd}$ for individual entries.
A real random vector X = ( X 1 , … , X k ) T {\displaystyle \mathbf {X} =(X_{1},\ldots ,X_{k})^{\mathrm {T} }} is called a centered normal random vector if there exists a deterministic k × ℓ {\displaystyle k\times \ell } matrix A {\displaystyle {\boldsymbol {A}}} such that A Z {\displaystyle {\boldsymbol {A}}\mathbf {Z} } has the same distribution as X {\displaystyle \mathbf {X} } where Z {\displaystyle \mathbf {Z} } is a standard normal random vector with ℓ {\displaystyle \ell } components. : p. 454
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Now let $\xv$ be a random vector distributed according to the uniform distribution over the finite centered dataset $\xv_1, . . . , \xv_N$ from above. % Consider the problem of finding a unit vector, $\wv \in \R^D$, such that the random variable $\wv^ op \xx$ has \emph{maximal} variance. What does it mean for the data vectors $\xv_1, . . . , \xv_N$ to be centered, as for principle component analysis (PCA) to be meaningful? Use the notation $\x_{nd}$ for individual entries.
Given a column-vector, v {\displaystyle \mathbf {v} \,} of size n, the centering property of C n {\displaystyle C_{n}\,} can be expressed as C n v = v − ( 1 n J n , 1 T v ) J n , 1 {\displaystyle C_{n}\,\mathbf {v} =\mathbf {v} -({\tfrac {1}{n}}J_{n,1}^{\textrm {T}}\mathbf {v} )J_{n,1}} where J n , 1 {\displaystyle J_{n,1}} is a column vector of ones and 1 n J n , 1 T v {\displaystyle {\tfrac {1}{n}}J_{n,1}^{\textrm {T}}\mathbf {v} } is the mean of the components of v {\displaystyle \mathbf {v} \,} . C n {\displaystyle C_{n}\,} is symmetric positive semi-definite. C n {\displaystyle C_{n}\,} is idempotent, so that C n k = C n {\displaystyle C_{n}^{k}=C_{n}} , for k = 1 , 2 , … {\displaystyle k=1,2,\ldots } .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a regression task. You are using your favorite learning algorithm with parameters w and add a regularization term of the form $\frac{\lambda}{2}\|\mathbf{w}\|^{2}$. Which of the following statements are correct for a typical scenario?
Choosing the regularization parameter ( λ {\displaystyle \lambda } ) is a fundamental part of lasso. A good value is essential to the performance of lasso since it controls the strength of shrinkage and variable selection, which, in moderation can improve both prediction accuracy and interpretability. However, if the regularization becomes too strong, important variables may be omitted and coefficients may be shrunk excessively, which can harm both predictive capacity and inferencing. Cross-validation is often used to find the regularization parameter.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a regression task. You are using your favorite learning algorithm with parameters w and add a regularization term of the form $\frac{\lambda}{2}\|\mathbf{w}\|^{2}$. Which of the following statements are correct for a typical scenario?
A regularization term (or regularizer) R ( f ) {\displaystyle R(f)} is added to a loss function: min f ∑ i = 1 n V ( f ( x i ) , y i ) + λ R ( f ) {\displaystyle \min _{f}\sum _{i=1}^{n}V(f(x_{i}),y_{i})+\lambda R(f)} where V {\displaystyle V} is an underlying loss function that describes the cost of predicting f ( x ) {\displaystyle f(x)} when the label is y {\displaystyle y} , such as the square loss or hinge loss; and λ {\displaystyle \lambda } is a parameter which controls the importance of the regularization term. R ( f ) {\displaystyle R(f)} is typically chosen to impose a penalty on the complexity of f {\displaystyle f} . Concrete notions of complexity used include restrictions for smoothness and bounds on the vector space norm.A theoretical justification for regularization is that it attempts to impose Occam's razor on the solution (as depicted in the figure above, where the green function, the simpler one, may be preferred).
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a movie recommendation system which minimizes the following objective rac{1}{2} \sum_{(d,n)\in\Omega} [x_{dn} - (\mathbf{W} \mathbf{Z}^ op)_{dn}]^2 + rac{\lambda_w}{2} orm{\mathbf{W}}_ ext{Frob}^2 + rac{\lambda_z}{2} orm{\mathbf{Z}}_ ext{Frob}^2 where $\mathbf{W}\in \R^{D imes K}$ and $\mathbf{Z}\in \R^{N imes K}$. Suppose movies are divided into genre A and genre B (i.e., $\mathbf{W}_A\in \R^{D_A imes K}, \mathbf{W}_B\in \R^{D_B imes K}, \mathbf{W}=[\mathbf{W}_A; \mathbf{W}_B]$, with $D_A\!+\!D_B=D$) and users are divided into group 1 and group 2 (i.e., $\mathbf{Z}_1\in \R^{N_1 imes K}, \mathbf{Z}_2\in \R^{N_2 imes K}, \mathbf{Z}=[\mathbf{Z}_1; \mathbf{Z}_2]$, with $N_1\!+\!N_2=N$). In addition, group 1 users only rate genre A movies while group 2 users only rate genre B movies. Then instead of training a large recommendation system with $(\mathbf{W}, \mathbf{Z})$, one may train two smaller recommendation systems with parameters $(\mathbf{W_A}, \mathbf{Z_1})$ and $(\mathbf{W_B}, \mathbf{Z_2})$ separately. If SGD is used to solve the minimization problems and all conditions remain the same (e.g., hyperparameters, sampling order, initialization, etc), then which of the following statements is true about the two training methods?
Many standard NMF algorithms analyze all the data together; i.e., the whole matrix is available from the start. This may be unsatisfactory in applications where there are too many data to fit into memory or where the data are provided in streaming fashion. One such use is for collaborative filtering in recommendation systems, where there may be many users and many items to recommend, and it would be inefficient to recalculate everything when one user or one item is added to the system. The cost function for optimization in these cases may or may not be the same as for standard NMF, but the algorithms need to be rather different.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
Consider a movie recommendation system which minimizes the following objective rac{1}{2} \sum_{(d,n)\in\Omega} [x_{dn} - (\mathbf{W} \mathbf{Z}^ op)_{dn}]^2 + rac{\lambda_w}{2} orm{\mathbf{W}}_ ext{Frob}^2 + rac{\lambda_z}{2} orm{\mathbf{Z}}_ ext{Frob}^2 where $\mathbf{W}\in \R^{D imes K}$ and $\mathbf{Z}\in \R^{N imes K}$. Suppose movies are divided into genre A and genre B (i.e., $\mathbf{W}_A\in \R^{D_A imes K}, \mathbf{W}_B\in \R^{D_B imes K}, \mathbf{W}=[\mathbf{W}_A; \mathbf{W}_B]$, with $D_A\!+\!D_B=D$) and users are divided into group 1 and group 2 (i.e., $\mathbf{Z}_1\in \R^{N_1 imes K}, \mathbf{Z}_2\in \R^{N_2 imes K}, \mathbf{Z}=[\mathbf{Z}_1; \mathbf{Z}_2]$, with $N_1\!+\!N_2=N$). In addition, group 1 users only rate genre A movies while group 2 users only rate genre B movies. Then instead of training a large recommendation system with $(\mathbf{W}, \mathbf{Z})$, one may train two smaller recommendation systems with parameters $(\mathbf{W_A}, \mathbf{Z_1})$ and $(\mathbf{W_B}, \mathbf{Z_2})$ separately. If SGD is used to solve the minimization problems and all conditions remain the same (e.g., hyperparameters, sampling order, initialization, etc), then which of the following statements is true about the two training methods?
R ( f 1 ⋯ f T ) = ∑ r = 1 C ∑ t ∈ I ( r ) ‖ f t − 1 I ( r ) ∑ s ∈ I ( r ) f s ‖ H k 2 {\displaystyle R(f_{1}\cdots f_{T})=\sum _{r=1}^{C}\sum _{t\in I(r)}\|f_{t}-{\frac {1}{I(r)}}\sum _{s\in I(r)}f_{s}\|_{H_{k}}^{2}} where I ( r ) {\displaystyle I(r)} is a cluster of tasks.This regularizer is similar to the mean-constrained regularizer, but instead enforces similarity between tasks within the same cluster. This can capture more complex prior information. This technique has been used to predict Netflix recommendations. A cluster would correspond to a group of people who share similar preferences.
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
(SVD) The set of singular values of any rectangular matrix $\mathbf{X}$ is equal to the set of eigenvalues for the square matrix $\mathbf{X X}^{\top}$.
Perform the singular value decomposition (SVD) of the trajectory matrix X {\displaystyle \mathbf {X} } . Set S = X X T {\displaystyle \mathbf {S} =\mathbf {X} \mathbf {X} ^{\mathrm {T} }} and denote by λ 1 , … , λ L {\displaystyle \lambda _{1},\ldots ,\lambda _{L}} the eigenvalues of S {\displaystyle \mathbf {S} } taken in the decreasing order of magnitude ( λ 1 ≥ … ≥ λ L ≥ 0 {\displaystyle \lambda _{1}\geq \ldots \geq \lambda _{L}\geq 0} ) and by U 1 , … , U L {\displaystyle U_{1},\ldots ,U_{L}} the orthonormal system of the eigenvectors of the matrix S {\displaystyle \mathbf {S} } corresponding to these eigenvalues. Set d = r a n k ⁡ X = max { i , such that λ i > 0 } {\displaystyle d=\mathop {\mathrm {rank} } \mathbf {X} =\max\{i,\ {\mbox{such that}}\ \lambda _{i}>0\}} (note that d = L {\displaystyle d=L} for a typical real-life series) and V i = X T U i / λ i {\displaystyle V_{i}=\mathbf {X} ^{\mathrm {T} }U_{i}/{\sqrt {\lambda _{i}}}} ( i = 1 , … , d ) {\displaystyle (i=1,\ldots ,d)} .
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus
(SVD) The set of singular values of any rectangular matrix $\mathbf{X}$ is equal to the set of eigenvalues for the square matrix $\mathbf{X X}^{\top}$.
Applying singular-value decomposition (SVD) to matrix A {\displaystyle A} with dimensions p × m {\displaystyle p\times m} produces a singular system consisting of singular values { σ j } j = 1 k , ( σ j > 0 ∀ j = 1 , … , k ) , {\displaystyle \{\sigma _{j}\}_{j=1}^{k},{\text{ }}(\sigma _{j}>0{\text{ }}\forall j=1,\dots ,k),} vectors { v j } j = 1 m ∈ C m {\displaystyle \{v_{j}\}_{j=1}^{m}\in \mathbb {C} ^{m}} and { u j } j = 1 p ∈ C p {\displaystyle \{u_{j}\}_{j=1}^{p}\in \mathbb {C} ^{p}} such that they form orthonormal bases of C m {\displaystyle \mathbb {C} ^{m}} and C p {\displaystyle \mathbb {C} ^{p}} respectively: If U {\displaystyle U} and V {\displaystyle V} are matrices with u {\displaystyle u} 's and v {\displaystyle v} 's in the columns and Σ {\displaystyle \Sigma } is a diagonal p × m {\displaystyle p\times m} matrix having singular values σ i {\displaystyle \sigma _{i}} on the first k {\displaystyle k} -entries on the diagonal (all the other elements of the matrix are zeros): then the matrix A {\displaystyle A} can be rewritten as:
https://www.kaggle.com/datasets/conjuring92/wiki-stem-corpus