question stringlengths 19 3.53k | answer stringlengths 1 5.09k | label float64 0.1 0.1 | source stringlengths 20 22 |
|---|---|---|---|
Assume you are part of a team developing a mobile app using Scrum. One of your colleagues, who was tasked with adding a "dark mode" to the app, has found an unrelated bug during testing:
a race condition occasionally causes stale data to be displayed. Your colleague wants to immediately fix it, though the source of the... | Covering 80% of the paths is often either undoable or a waste of time. For example, any potentially infinite loop such as requiring a valid user input can't be covered more than 0% in terms of paths. Even for the rest of the code, there are often so many paths that covering 80% of them would take a huge amount of time.... | 0.1 | M1_preference_data_100 |
Devise an algorithm that, without consensus, implements a weaker specification of NBAC by replacing the termination property with weak termination.
Weak termination: Let p be a distinguished process, known to all other processes. If p does not crash then all correct processes eventually decide. Your algorithm may use ... | Consider the directed graph $D = (V,A)$ obtained from $G$ by replacing every edge $\{u,v\} \in E$ by the two arcs $(u,v)$ and $(v,u)$. With the arc set $A$ as ground set we define two partition matroids $\mathcal{M}_1$ and $\mathcal{M}_2$: \begin{itemize} \item To be independent in $\mathcal{M}_1$ one can take at most ... | 0.1 | M1_preference_data_101 |
Assume that your team is discussing the following java code:
public final class DataStructure {
public void add(int val) { /*...*/ }
private boolean isFull() { /*...*/ }
}
One of your colleagues suggests that "add" should be changed to return a boolean indicating whether the passed value was added or not. Ex... | $$rac{\exp(s_1)}{\displaystyle\sum_{i=1}^{|V|} \exp(s_i)}$$ | 0.1 | M1_preference_data_102 |
The objective of this question is to illustrate the use of a lexical semantics resource to compute
lexical cohesion.
Consider the following toy ontology providing a semantic structuring for a (small) set of nouns:
<ontology>
<node text='all'>
<children>
<node text='animate entities'>
... | def community_influencers(G, nodes_community, communities, communities_count): ''' input: G:nx.Graph nodes_community:{node_id:community_id} communities:[community_ids] community_count:int output: influencers:{community_id:node_id} ''' influencers = {} ... | 0.1 | M1_preference_data_103 |
Consider an operation we will call scanRight1 that, given a function $f$ of two arguments, and a sequence $a_1, \ldots, a_N$, computes a sequence $b_1, \ldots, b_N$ such that: $b_N = a_N$ $b_i = f(a_{i}, b_{i+1})$, for $0 < i < N$ Define similarly scanLeft1 in a manner similar to scanRight1: Given a function $f$ of tw... | Let $OPT$ be the number of edges that cross a minimum $s,t$-cut, and let $OPT_{LP}$ be the value of the given LP. To show that $OPT = OPT_{LP}$, we show that $OPT_{LP} \leq OPT$ and $OPT_{LP} \geq OPT$. Firstly let's prove that $OPT_{LP} \leq OPT$. Suppose that $S$ is an optimal cut $s,t$-cut. We have $s\in S$ and $t\... | 0.1 | M1_preference_data_104 |
For each of the following pairs, what kind of morphology is involved? cat+N => cats, break+V => breakable , freeze+V => frozen , translate+V => translation, modify+V => modifies ; inflectional, inflectional, derivational, inflectional, derivational | We show how to find such $k$ disjoint perfect matchings in a $k$-regular bipartite graph in polynomial time. Let $G_0 = (A \cup B, E)$ be a $k$-regular bipartite graph. Consider the LP for bipartite perfect matching on $G_0$. The LP is feasible because setting $x_e = 1/k$ for all $e \in E$ satisfies all the constraints... | 0.1 | M1_preference_data_105 |
Implement Connectivity-Based Community Ranking by doing the following: - Compute a meta graph where nodes are communities and edges denote inter-connections across communities. - Add the weights of the inter-connections as weights to the edges. - Compute `pagerank` on the meta graph. - Hint: `w_matrix` is the confusio... | words and punctuation:
M. O'Connel payed $12,000 ( V.T.A. not included ) with his credit card .
Usually not in a lexicon because hard to lexicalize (too many hard-to-predict occurrences): O'Connel, $12,000
'O'Connel' could be in some lexicon of proper names (but not so usual), or recognized by some NER (Named-Entity... | 0.1 | M1_preference_data_106 |
Consider the following matrix-factorization problem. For the observed ratings $r_{u m}$ for a given pair $(u, m)$ of a user $u$ and a movie $m$, one typically tries to estimate the score by $$ f_{u m}=\left\langle\mathbf{v}_{u}, \mathbf{w}_{m}\right\rangle+b_{u}+b_{m} $$ Here $\mathbf{v}_{u}$ and $\mathbf{w}_{m}$ are v... | We show that $\mathcal{M}$ satisfies the two axioms $I_1$ and $I_2$ for matroids. \begin{itemize} \item Take any $A \in \mathcal{I}$ and let $B \subseteq A$. Then $|E_i \cap A| \leq k_i$ for all $i = 1, \dots, \ell$. Clearly, all the inequalities $|E_i \cap B| \leq k_i$ also hold as $B \subseteq A$. Thus $B \in \mathca... | 0.1 | M1_preference_data_107 |
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 $... | Instead of selecting the edge to contract in each iteration uniformly at random. Now select an edge proportional to its weight $w_e$. To show that this idea indeed makes sense, we observe that Claim 1 from the notes of Lecture~11 still holds: the probability that we select an edge in $E(S^*, \overline{S^*})$ to contrac... | 0.1 | M1_preference_data_108 |
What is the complexity of concatenation of two conc-trees with heights $h_1$ and
$h_2$? | Force the system to ouput a given number of documents (increasing) so as to increase recall
(ultimatly to recall max. when we ask the system to decidedfor all the available documents
whether they are pertinent or not) | 0.1 | M1_preference_data_109 |
One of your colleagues has recently taken over responsibility for a legacy codebase, a library currently used by some of your customers. Before making functional changes, your colleague found a bug caused by incorrect use of the following method in the codebase:
public class User {
/** Indicates whether the user’s... | 1.5% is for sure wrongly tagged. For the rest (100%-1.5%), only 98% are
correctly tagged. So the overall score is 0.985×0.98 ≃ 0.96. | 0.1 | M1_preference_data_110 |
Consider a data stream $\sigma=(a_1,\ldots, a_m)$, with $a_j\in [n]$ for every $j=1,\ldots, m$, where we let $[n]:=\{1, 2, \ldots, n\}$ to simplify notation. For $i\in [n]$ let $f_i$ denote the number of times element $i$ appeared in the stream $\sigma$. We say that a stream $\sigma$ is {\epsilonm approximately sparse... | This is an HMM of order 1 (Well, the picture is actualy a part of a Markov chain. The 'hidden' part will be provide by the emission probabilities, i.e. the lexicon).
HMM relies on two asumptions (see course): limited lexical contionning $\left(P\left(w_{i} \mid \ldots C_{i} \ldots\right)=P\left(w_{i} \mid C_{i}\right)... | 0.1 | M1_preference_data_111 |
Consider the following algorithm \textsc{Random-Check} that takes as input two subsets $S\subseteq E$ and $T\subseteq E$ of the same ground set $E$. \begin{center} \begin{boxedminipage}[t]{0.85\textwidth} \textsc{Random-Check}$(S,T)$ \\[2mm] 1. For each element $e\in E$, independently of other elements randomly set \b... | def truncated_svd(term_doc_matrix, num_val): K, S, Dt = np.linalg.svd(term_doc_matrix, full_matrices=False) K_sel = K[:,0:num_val] S_sel = np.diag(S)[0:num_val,0:num_val] Dt_sel = Dt[0:num_val,:] return K_sel, S_sel, Dt_sel | 0.1 | M1_preference_data_112 |
In which type of processors do you expect to find a reorder buffer? | \begin{itemize}
\item Noise term stays constant (it only depends on the data and not of the algorithm)
\item Bias term increases (if $\lambda=\infty$ very large bias)
\item Variance term decreases (if $\lambda=\infty$ then no variance)
\end{itemize} | 0.1 | M1_preference_data_113 |
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 Poiss... | Notice that minimising $\mathcal{L}(\mathbf{z}, \boldsymbol{\mu})$ for given $\left\{z_{n k}\right\}_{n, k=1}^{N, K}$ reduces to minimizing $\sum_{n=1}^{N} z_{n k}\left\|\mathbf{x}_{n}-\boldsymbol{\mu}_{k}\right\|_{2}^{2}$ for each $k \in\{1, \ldots, K\}$ independently. This sum is a function of $\boldsymbol{\mu}_{k}$ ... | 0.1 | M1_preference_data_114 |
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 $... | No, because the limit is about complexity, not number of lines | 0.1 | M1_preference_data_115 |
Chef Baker Buttersweet just took over his family business - baking tasty cakes! He notices that he has $m$ different ingredients in various quantities. In particular, he has $b_i \geq 0$ kilograms of ingredient $i$ for $i = 1, \dots, m$. His family cookbook has recipes for $n$ types of mouthwatering cakes. A kilogram o... | def longest[A](ls: List[A]): Int = ls.foldLeft((Option.empty[A], 0, 0)) { case ((last, cur, max), x) => val last2 = Some(x) val cur2 = if (last2 == last) cur + 1 else 1 (last2, cur2, if (cur2 > max) cur2 else max) }._3 | 0.1 | M1_preference_data_116 |
Would VLIW processors benefit from a Load Store Queue? | xs.flatMap(x => x) | 0.1 | M1_preference_data_117 |
Consider the following algorithm that takes as input a complete $n$-by-$n$ bipartite graph $G=(U \cup V,E)$ with positive integer edge-weights $w :E \rightarrow \mathbb{Z}_{> 0 }$: \begin{center} \begin{boxedminipage}[t]{0.85\textwidth} \begin{minipage}{14cm} \begin{verse} \textsc{MinWeightPerfectMatching}$(G, w)$: \\... | The grammar G is:
\item a constituency-based (because it consists of rewriting rules);
\item context-free grammar (because of the format of the rules: only one an exactly one terminal on the left-hand side);
\item in extended Chomsky Normal Form (because of the format of the rules: no more than two terms on the right-h... | 0.1 | M1_preference_data_118 |
Provide a formal definition of a transducer. Give some good reasons to use such a tool for morphological processing. | The dual is the following: \begin{equation*} \begin{array}{ll@{}ll} \text{minimize} & & \displaystyle\sum_{e \in E} y_e &\\ \text{subject to}& & \displaystyle\sum_{e \in p} y_e \ge 1 &\forall p \in P,\\ & & y_e \ge 0 & \forall e \in E. \end{array} \end{equation*} Any binary solution $y \in \{0,1\}^{|E|}$ to the dual ... | 0.1 | M1_preference_data_119 |
Consider the (toy) grammar $G$ consisting of the following rules:
R1: S --> NP VP
R2: NP --> NN
R3: NP --> Det NN
R4: NN --> N
R5: NN --> NN NN
R6: NN --> NN PNP
R7: PNP --> Prep NP
R8: VP --> V
R9: VP --> Adv V
What type of rules does the provided grammar $G$ consist of?
What type of rules should $G$ be complemented w... | For being computed with a parallel reduction, hull2 needs to be associative. In fact, it is associative as well as commutative here. We slightly abuse notation to keep the structure similar to code, with a Rectangle structure. Given $$ r_i = Rectangle((x_1^i, y_1^i), (x_2^i, y_2^i)) $$ we have, \begin{align*} &hull2... | 0.1 | M1_preference_data_120 |
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then... | No, in general adding noise or reducing the precision is
not very effective since repeating probes multiple times would
still leak the desired information. Prime + probe may not work
or be more difficult, but other attacks would still be
possible. | 0.1 | M1_preference_data_121 |
Assume that while working on a new feature for your team's product, your colleague is required to write a function that takes a list of events and sorts them by their timestamp. Using their algorithm course knowledge, they remind you that merge sort's complexity is $O(n log n)$, which is better than the $O(n^2)$ worst-... | Those sentences are not 'grammatically' (syntactically) correct. It should be filtered out at the syntactic level using a (phrase-structure) grammar. | 0.1 | M1_preference_data_122 |
Does the disparity in class proportions hurt the model? If yes, how can you fix it? If not, justify the reasons behind your choice.
Hint: The learning objective of a classifier can be modified by altering the importance of each class in the computation of the loss function.
Based you answer on the following confusion ... | Yes, because the long-latency multiplication prevents
pipelining; a new iteration can start only when the previous
if-condition is computed and the value of b is updated (if
needed). | 0.1 | M1_preference_data_123 |
Design and analyze a polynomial-time algorithm for the following problem: \begin{center} \begin{boxedminipage}[t]{0.83\textwidth} \begin{description} \item[Input:] a vertex set $V$. \item[Output:] vertex subsets $S_1, S_2, \ldots, S_\ell \subseteq V$ with the following property:\\[2mm] For every set of edges $E\subs... | def euclidean_distance(v1, v2): """ It computes the euclidean distance between to vectors. :param v1: First vector (numpy array). :param v2: Second vector (numpy array). :return: Euclidean distance (float) """ return np.linalg.norm(v1 - v2) def knn(doc_vectors, query_vector, k=10): """ It f... | 0.1 | M1_preference_data_124 |
Implement weigthing estimation of kNN classification | Every process initializes a balance[] array with the initial, agreed upon balances of each process. Upon requesting a payment, a process TO-broadcasts a message [PAY, source, recipient, amount]. Upon TO-delivering a message [PAY, source, recipient, amount], a process verifies if balance[source] is at least amount. If s... | 0.1 | M1_preference_data_125 |
Two excellent students, Alice from EPFL and Bob from MIT, have both built their own spam filters. A spam filter is an algorithm that takes as input an email and outputs $1$ if the email is spam and $0$ otherwise. Alice and Bob now want to compare their two spam filters. To perform the comparison, they both download t... | The function f must be associative. That is, for any x, y, z, it should be the case that: f(x, f(y, z)) == f(f(x, y), z). Both the min and max functions are associative. In addition, it can be easily shown that pairwise application of associative functions is also associative. From this follows that f is indeed associ... | 0.1 | M1_preference_data_126 |
For this homework you will use a dataset of 18,403 music reviews scraped from Pitchfork¹, including relevant metadata such as review author, review date, record release year, review score, and genre, along with the respective album's audio features pulled from Spotify's API. The data consists of the following columns: ... | a few hints:
• there is no theoretical proof nor unique optimal solution in NLP
• so as to have an objective (not subjective) quantitative (not qualitative) measure
• it helps clarifying, even specifying, the objectives to be reached
• allow to monitor variability over time (task shift, for whatever reasons, e.g. chang... | 0.1 | M1_preference_data_127 |
In this week's lecture, you have been introduced to the aggregate method of ParSeq[A] (and other parallel data structures). It has the following signature: def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B Discuss, as a group, what aggregate does and what its arguments represent. Under which condition(s) on z,... | Since the number of registers are limited, at some point
the addresses will wrap up and the pointed registers would not
be free but would contain useful values. One could think of
using an interrupt to invoke some handler which saves those
values on the st... | 0.1 | M1_preference_data_128 |
Consider a country with n ≥ 2 cities. For every pair of different cities x, y, there exists a direct route (single direction) either from x to y or from y to x. Show that there exists a city that we can reach from every other city either directly or through exactly one intermediate city. | "Backend timeout" is an abstraction leak because it reveals an implementation detail irrelevant to the abstraction: that the server has a backend. The other two are fundamental concepts in the abstraction, thus not leaks. | 0.1 | M1_preference_data_129 |
Consider the (toy) grammar $G$ consisting of the following rules:
R1: S --> NP VP
R2: NP --> NN
R3: NP --> Det NN
R4: NN --> N
R5: NN --> NN NN
R6: NN --> NN PNP
R7: PNP --> Prep NP
R8: VP --> V
R9: VP --> Adv V
Indicate what type of constraints are (resp. are not) taken into account by the grammar $G$, and, for each c... | Consider the directed graph $G' = (V,E')$ obtained from $G$ by replacing every edge $\{u,v\} \in E$ by the two arcs $e_1=(u,v)$ and $e_2=(v,u)$. If $e \in A'$, we assign weight $w_e=n^2+1$ to it, otherwise we set $w_e=n^2$. Let $\delta^{+}(v)=\{u\in V : (v,u) \in E'\}$ denote the set of outgoing edges of $v$ in $G'$ an... | 0.1 | M1_preference_data_130 |
Freshly graduated from EPFL, you have been hired as contractors for a successful and rapidly growing bank. The bank has been experiencing problems with their money management system recently, which is written in Scala, and so they hired the best and brightest young engineer they could find: you! The system had been wor... | The bug item is properly specified, and is therefore suitable to be submitted. | 0.1 | M1_preference_data_131 |
If process i fails, then eventually all processes j≠i fail
Is the following true? If no process j≠i fails, then process i has failed | No, it is almost certain that it would not work. On a
dynamically-scheduled processor, the user is not supposed to
see the returned value from a speculative load because it will
never be committed; the whole idea of the attack is to make
speculatively use ... | 0.1 | M1_preference_data_132 |
The data contains information about submissions to a prestigious machine learning conference called ICLR. Columns:
year, paper, authors, ratings, decisions, institution, csranking, categories, authors_citations, authors_publications, authors_hindex, arxiv. The data is stored in a pandas.DataFrame format.
Create two f... | Recall that, in the Hedge algorithm we learned in class, the total loss over time is upper bounded by $\sum_{t = 1}^T m_i^t + \frac{\ln N}{\epsilon} + \epsilon T$. In the case of investments, we want to do almost as good as the best investment. Let $g_i^t$ be the fractional change of the value of $i$'th investment at t... | 0.1 | M1_preference_data_133 |
You want to create an application that allows users to manage their e-books. These books will be stored in a local database, with attributes like name, file, etc. In addition, your application will allow to add notes on books, which will be stored separately in the database, and to send a book with its notes by e-mail ... | Every process sends its proposal (COMMIT / ABORT) to p using point-to-point links. p collects all the proposals. If it detects (with the perfect failure detector) that any process crashed, or any process proposes ABORT then it unilaterally decides to ABORT. Otherwise, it unilaterally decides to COMMIT. p uses Best-Effo... | 0.1 | M1_preference_data_134 |
Consider the LP-rounding algorithm for Set Cover that works as follows: \begin{enumerate} \item Solve the LP relaxation to obtain an optimal solution $x^*$. \item Return the solution $\{S: x^*_S >0\}$, i.e., containing all sets with a positive value in the fractional solution. \end{enumerate} Use the complementarity sl... | We solve the problem using "deferred decision" technique. First, note that simply one has $$\sum_{e\in S}x_e=\sum_{e\in S\setminus T}x_e +\sum_{e\in S\cap T} x_e$$ and $$\sum_{e\in T}x_e=\sum_{e\in T\setminus S}x_e +\sum_{e\in T\cap S} x_e.$$ So, we have $$\Pr\left[\sum_{e\in S}x_e=\sum_{e\in T}x_e\mid S\ne T\right]=\P... | 0.1 | M1_preference_data_135 |
What is predication and why is it (almost) universal in VLIW
processors? Could it make sense also in a RISC processor? Why? | $|h - \max(h_1, h_2)| \leq 1$ | 0.1 | M1_preference_data_136 |
Assume you are part of a team developing a mobile app using Scrum. At the last sprint planning, you were assigned the task of adding a new authentication method. However, a customer representative just sent you an email:
"the representative believes authentication is less important than support for right-to-left langua... | This always leads to the same result. | 0.1 | M1_preference_data_137 |
Give well chosen examples of applications that can be evaluated with the single metric derived from Precision/Recall and illustrate:
• a situation where more weight should be given to Precision;
• a situation where more weight should be given to Recall. | There are two solutions (the first refers to material covered in class). {\bf Solution 1:} In class we designed LSH family $\mathcal{H}_1$ of hash functions $h: \{0,1\}^d \rightarrow \{0,1\}$ so that \begin{align} \label{eq:hashg1} \Pr_{h \sim \mathcal{H}_1}[h(p) = h(q)] = \left( 1-\frac{\dist(p,q)}{d} \right)\,. \en... | 0.1 | M1_preference_data_138 |
/True or false:/ Is the following statement true or false? Justify your answer. "The node with the highest clustering coefficient in an undirected graph is the node that belongs to the largest number of triangles.:" | Any nonterminating exception, including asynchronous ones.
1. A TLB miss exception.
2. An IO exception. | 0.1 | M1_preference_data_139 |
If process i fails, then eventually all processes j≠i fail
Is the following true? If all processes j≠i fail, then process i has not failed, | Changing the parameter type from "int" to its wrapper class "Integer" will break backward binary compatibility for the reasons explained previously, but it remains source compatible thanks to Java's autoboxing capability. | 0.1 | M1_preference_data_140 |
Assume that some of your colleagues work on an AI-based image generation service, where a user enters a topic, and the AI generates a synthetic photo on that topic. They tell you the following about this service:
"Currently, the user types in the topic they want to see images for, and the client app sends a request to ... | The figure shows the Bayes net corresponding to this factorization. Note that the path from $X_{1}$ to $X_{3}$ via $X_{4}$ is not blocked since it is head to head and we are conditioning on $X_{5}$, and $X_{5}$ is a child of $X_{4}$. The statements is therefore in general not true. | 0.1 | M1_preference_data_141 |
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|}$$ | Let $S$ be a minimum $s,t$-cut; then the number of edges cut by $S$ is $\opt$. We shall exhibit a feasible solution $y$ to the linear program such that value of $y$ is $\opt$. This then implies that $\optlp \leq \opt$ as the minimum value of a solution to the linear program is at most the value of $y$. Define $y$ as fo... | 0.1 | M1_preference_data_142 |
The company in which you work has just hired a new CTO, freshly graduated from a theoretical university. The CTO decides that in order to minimize bugs in the product, all new code must now be covered at least 80% in terms of paths in the code. Is this a good idea, and why?
Can you suggest something better, given the C... | ys.filter(_ < 100)
.flatMap( y => xs.filter(_ < 20).map(x => if y < x then 0 else y - x) ) | 0.1 | M1_preference_data_143 |
It is often desirable to be able to express the performance of an NLP system in the form of a
single number, which is not the case when the Precision/Recall framework is used.
Indicate what scores can be used to convert Precision/Recall measures into a unique number.
For each score, give the corresponding formula. | None of them | 0.1 | M1_preference_data_144 |
The MIPS R10000 fetches four instructions at once and, therefore,
there are four such circuits working in parallel inside the processor. Describe very briefly the function of the ``FP map'', of the
``Floating-point queue'', and of the ``Active list''. If applicable,
feel free to describe them using other generic te... | 1. Nonterminating exceptions require to be precise because
one must be able to continue execution from a well-defined
state (e.g., by jumping at a particular location with respect
to the exception PC).
2. I/O interrupts, TLB misses, timer interrupts, system
calls, debug interrupt... | 0.1 | M1_preference_data_145 |
Can one easily adapt the Spectre attack to Itanium? If so, give
some hints on how different it will be from the classic attack and
how potential victims could protect sensitive parts of their code. If
not, explain why it is not possible.
| Let $S = \{i\in V: v_2(i) \leq 0\}$. Note that $S \neq \emptyset$ and $S \neq V$ since $v_2 \perp v_{1}$ and $v_2 \not= \mathbf{0}$. In class we saw that if $\lambda_2 =1$ then all vertices in a connected component must receive the same value by the second eigenvector $v_2$. In particular adjacent vertices receive the... | 0.1 | M1_preference_data_146 |
Consider the following CFG
\(\text{S} \rightarrow \text{NP VP PNP}\)
\(\text{NP} \rightarrow \text{Det N}\)
\(\text{NP} \rightarrow \text{Det Adj N}\)
\(\text{VP} \rightarrow \text{V}\)
\(\text{VP} \rightarrow \text{Aux Ving}\)
\(\text{VP} \rightarrow \text{VP NP}\)
\(\text{VP} \rightarrow \text{VP PNP}\)
\(\text{PNP}... | Data is centered, i.e. $\E[\xv] = | 0.1 | M1_preference_data_147 |
Consider the following definition of trees representing higher-order functions, as well as a recursive function
subst0.
1 enum Expr:
2 case C(c: BigInt)
3 case N(name: String)
4 case BinOp(op: BinOps, e1: Expr, e2: Expr)
5 case IfNonzero(cond: Expr, trueE: Expr, falseE: Expr)
6 case Call(fun: Expr, arg: Expr)
7 case Fu... | Returns the sum of all elements in the input list | 0.1 | M1_preference_data_148 |
Explain why any fail-noisy consensus algorithm (one that uses an eventually perfect failure detector ◇P) actually solves uniform consensus (and not only the non-uniform variant). | def get_idf(vocabulary, documents): """ It computes IDF scores, storing idf values in a dictionary. :param documents: list of list of str, with the tokenized tweets. :param vocabulary: dict with the vocabulary (computed in 1.1) and each term's frequency. :return: dict with the terms as keys and... | 0.1 | M1_preference_data_149 |
Consider the following context-free grammar \(G\) (where \(\text{S}\) is the top-level symbol):
\(R_{01}: \text{S} \rightarrow \text{NP VP}\)
\(R_{02}: \text{NP} \rightarrow \text{NP0}\)
\(R_{03}: \text{NP} \rightarrow \text{Det NP0}\)
\(R_{04}: \text{NP0} \rightarrow \text{N}\)
\(R_{05}: \text{NP0} \rightarrow \text{... | Let the two feature maps be $\phi_{1}$ and $\phi_{2}$. Assume that they are of dimensions $d_{1}$ and $d_{2}$. Then $\phi$ is a feature map of dimension $d_{1} d_{2}$ of the form
$$
\begin{aligned}
\phi(\mathbf{x})^{\top}= & \left(\left(\phi_{1}(\mathbf{x})\right)_{1}\left(\phi_{2}(\mathbf{x})\right)_{1}, \cdots,\left(... | 0.1 | M1_preference_data_150 |
A sequential object is a tuple T = (Q, q0, O, R, ∆), where:
● Q is a set of states.
● q0 ∈ Q is an initial state.
● O is a set of operations.
● R is a set of responses.
● ∆ ⊆ (Q × Π × O) × (Q × R) is a relation that associates a state, a process,
and an operation to a set of possible new states and responses.
Processes... | Yes, it is needed to load the exception PC register if an
exception is raised. The actual PC, by then, would have an
arbitrary value. | 0.1 | M1_preference_data_151 |
Suppose we use the Simplex method to solve the following linear program: \begin{align*} \textbf{maximize} \hspace{0.8cm} & \hspace{0.4cm}4x_1 - 6x_2 + 4x_3 \\ \textbf{subject to}\hspace{0.6cm} & x_1 - 3x_2 + x_3 + s_1 = 1 \\ \hspace{0.8cm} & \hspace{1.90cm}x_1 + s_2 = 8 \\ \hspace{0.8cm} & \hspace{0.65cm} 3x_2 + 2... | It breaks backward compatibility, because the signature changes and "Document" is not a special kind of "String" thus callers will have to be updated | 0.1 | M1_preference_data_152 |
In an automated email router of a company, we want to make the distinction between three kind of
emails: technical (about computers), financial, and the rest ('irrelevant'). For this we plan to use a
Naive Bayes approach.
What is the main assumption made by Naive Bayes classifiers? Why is it 'Naive'?
We will consider ... | Division by zero, hardware errors. | 0.1 | M1_preference_data_153 |
According to your knowledge of English, split the following sentence into words and punctuation:
M. O'Connel payed $ 12,000 (V.T.A. not included) with his credit card.
Which of these words won't usually be in a standard lexicon? Justify your answer. Assuming separators are: whitespace, quote ('), full-stop/period (.),... | df_train_r = df.sample(frac=0.7)
df_test_r = df.loc[df.index.difference(df_train_r.index)] | 0.1 | M1_preference_data_154 |
Use the integrality of the bipartite perfect matching polytope (as proved in class) to show the following classical result: \begin{itemize} \item[] The edge set of a $k$-regular bipartite graph $G=(A\cup B, E)$ can in polynomial time be partitioned into $k$ disjoint perfect matchings. \end{itemize} \noindent A graph is... | ``FP map'' is the mapping table (in which physical
register is an architectural register at a particular moment
in time), ``Floating-point queue'' is the equivalent of a
Reservation Station, and ``Active list'' is the equivalent of
the Reorder Buffer. | 0.1 | M1_preference_data_155 |
Consider the following context-free grammar, where S is the top-level symbol, upper-case letters denotes non-terminals and lower case letters denotes terminals:S → T A
S → B A
S → A B
S → b
A → A C
A → a
T → A B
B → b
C → c
Except the first one, the next questions are based on filling the cells of the chart used b... | When the processor enters the exception handler, all
instructions before the one pointed to by the exception PC
have been already executed and the ones after it are not. The
situation of the one pointed to by the exception PC depends
deterministically from the exception cause. (The answ... | 0.1 | M1_preference_data_156 |
Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function:
"public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError"
This libra... | Returns the number of elements in the input list | 0.1 | M1_preference_data_157 |
Recall the Jaccard index that we saw in Exercise Set 10: Suppose we have a universe $U$. For non-empty sets $A,B \subseteq U$, the Jaccard index is defined as \begin{align*} J(A,B) = \frac{|A \cap B|}{|A \cup B|}\,. \end{align*} Design a locality sensitive hash (LSH) family $\mathcal{H}$ of functions $h: 2^U \rightarr... | $cov = rac1N \Xm\Xm^ op \in\R^{D imes D}$.
| 0.1 | M1_preference_data_158 |
Describe the techniques that typical dynamically scheduled
processors use to achieve the same purpose of the following features
of Intel Itanium: (a) Predicated execution; (b) advanced
loads---that is, loads moved before a store and explicit check for
RAW hazards; (c) spe... | Alice and Bob can both apply the AMS sketch with constant precision and failure probability $1/n^2$ to their vectors. Then Charlie subtracts the sketches from each other, obtaining a sketch of the difference. Once the sketch of the difference is available, one can find the special word similarly to the previous problem... | 0.1 | M1_preference_data_159 |
Let $y_1, y_2, \ldots, y_n$ be uniform random bits. For each non-empty subset $S\subseteq \{1,2, \ldots, n\}$, define $X_S = \oplus_{i\in S}\:y_i$. Show that the bits $\{X_S: \emptyset \neq S\subseteq \{1,2, \ldots, n\} \}$ are pairwise independent. This shows how to stretch $n$ truly random bits to $2^n-1$ pairwise in... | As a multitasker, I want the app to be usable with voice only, so that I can use it when my hands are busy. | 0.1 | M1_preference_data_160 |
Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function:
"public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError"
A security... | Differences are due to two subproducts:
On one hand:
$$
P(X \mid \mathrm{WPS}) \cdot P(\text { first } \mid X) \cdot P(Y \mid X) \cdot P(\text { adult } \mid Y) \cdot P(\mathrm{NN} \mid Y)
$$
for $X$ either 'JJ' or 'RB' and $Y$ either 'JJ' of 'NN', and on the other hand:
$$
P(X \mid \mathrm{RB}) \cdot P(\text { dev... | 0.1 | M1_preference_data_161 |
Explain how it is possible to compute Precision at different Recalls. | Somewhat counterintuitively, the property doesn't hold. To show this, let's take the following values for $L_1$, $L_2$, $T$, $c$, and $d$: $$\begin{cases} L_1 = 10,\\ L_2 = 12, \\ T = 11, \\ c = 1, \\ d = 1 \end{cases}$$ Using those values, we get that $D(L_1) = 10$ and $D(L_2) = \max(D(6), D(6)) + 1 = 7$. | 0.1 | M1_preference_data_162 |
Review the notion of depth seen in the lecture. What does it represent? Below is a formula for the depth of a divide and conquer algorithm working on an array segment of size $L$, as a function of $L$. The values $c$, $d$ and $T$ are constants. We assume that $L>0$ and $T>0$. $$ D(L) = \begin{cases} c \cdot L &\text{i... | Merging if there are no requested changes could lead to merging buggy code because nobody had the time to look at it. A better alternative would be to wait for 1 or 2 approving reviews from colleagues that know how the PR's feature is supposed to behave. | 0.1 | M1_preference_data_163 |
Would it make sense to add the total-order property to the best-effort broadcast? | 0 | 0.1 | M1_preference_data_164 |
Consider a network that is organized as a 2-dimensional grid, such that every process has up to 4 neighbors. The width of the grid is w and the height is h. The grid is big, meaning that w+h is much smaller than w*h. While there are faulty and correct processes in the network, it is assumed that two correct processes a... | def user_based_predict(ratings, similarity): filled_matrix = np.zeros((n_users, n_items)) # compute the average ratings for each user tmp = train_data_matrix.copy() tmp[tmp == 0] = np.nan user_average_ratings = np.nanmean(tmp, axis=1) # loop over all the items for i in tqdm(range(n... | 0.1 | M1_preference_data_165 |
In the lecture on bias-variance decomposition we have seen that the true error can be decomposed into noise, bias and variance terms. What happens to the three terms for ridge regression when the regularization parameter $\lambda$ grows? Explain your answer. | The idea is that a processor capable of speculation may
deliver the value to the consumer (the second load) before
detecting that the access was illegal. Then, the second access
leaves a trace in the cache. Finally, both accesses will be
... | 0.1 | M1_preference_data_166 |
Hypothesize a reason for the difference in performance between the Linear regression and the Gradient Boosting Regressor. | A property that implies the correctness is: forall xs, ys. g(xs.F, ys.F) == (xs ++ ys).F (split-invariance) where we define xs.F == xs.foldLeft(z)(f) The intuition is the following. Take any computation tree for xs.aggregate. Such a tree has internal nodes labelled by g and segments processed using foldLeft(z)(f)... | 0.1 | M1_preference_data_167 |
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}}{|... | a (DET)
computer (N)
process (V, N)
programs (V, N)
accurately (ADV)
which leads to 4 solutions. | 0.1 | M1_preference_data_168 |
You are given a probability distribution $P(y_t | y_0, \ldots, y_{t-1})$ over 100 possible next tokens to generate by your model. The distribution has the following characteristics:
egin{itemize}
\item 20\% of the probability mass is on the most probable token;
\item 10\% of the probability mass is on e... | [['Cars flow beautifully', 'syntactic'], ['The cook put cherry stones in the cake', 'semantic'], ['The glass broke its leg', 'syntactic'], ['I no go rain', 'lexical']] | 0.1 | M1_preference_data_169 |
Given the following code snippet, explain if it would be better
scheduled with static HLS or dynamic HLS. Assume erb+acc+ to be a
floating point variable; floating-point multiplications have a
latency of four and all other operations a latency of one. If good... | We need to verify the two axioms: \begin{description} \item[$(I_1)$] Consider a set $A' \in \mathcal{I}$ and a subset $A'' \subseteq A'$. The matching that match every vertex in $A'$ also matches every vertex in $A''$ so $A'' \in \mathcal{I}$ as required. \item[$(I_2)$] Consider two sets $A_1, A_2 \in \mathcal{I}$ with... | 0.1 | M1_preference_data_170 |
Assume you are working on a mobile application. Users report that your app freezes when they access its image gallery, which shows images in a scrollable grid. This is the (java) function run to display the gallery:
void startImageGallery() {
// Download all the user's images from the application server
List<Im... | The code should use dependency injection so that tests can mock the services instead of using the real ones. | 0.1 | M1_preference_data_171 |
In the following let $\kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ and $\kappa_{2}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ be two valid kernels. Show that the following is also valid kernel: $\kappa\left(\mathbf{x}, \mathbf{x}^{\prime}\right)=\kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right) \kappa... | It should prioritize the image generation, as we can think that it will be called more often and also because optimizing for the moderation speeds up 9 seconds of a procedure that typically takes a day. | 0.1 | M1_preference_data_172 |
Given the following code snippet, explain if it would be better
scheduled with static HLS or dynamic HLS. Assume erb+acc+ to be a
floating point variable; floating-point multiplications have a
latency of four and all other operations a latency of one. If good... | O( (f+1)n^2 ) | 0.1 | M1_preference_data_173 |
We have a collection of rectangles in a plane, whose sides are aligned with the coordinate axes. Each rectangle is represented by its lower left corner $(x_1,y_1)$ and its upper right corner $(x_2, y_2)$. All coordinates are of type Long. We require $x_1 \le x_2$ and $y_1 \le y_2$. Define a function hull that, given an... | Assign each vertex with probability 0.5 to either side. Then, for any directed edge $(i, j)$ \begin{equation} Pr((i,j) \textrm{ in cut}) = Pr(i \in U \wedge j \in W) = \frac{1}{2}\times \frac{1}{2} = \frac{1}{4} \end{equation} The expected total weight of the cut is \begin{equation} \sum_{(i,j)\in A} Pr((i,j) \textrm{ ... | 0.1 | M1_preference_data_174 |
Why does Intel Itanium contain more general-purpose registers (128) than most RISC instruction sets (usually 32)? | False: Some process j can fail for a reason not related to the failure of process i. | 0.1 | M1_preference_data_175 |
Implement probabilistic estimation of kNN classification | Dynamically scheduled out-of-order processors. | 0.1 | M1_preference_data_176 |
Provide a precise definition of concatenative morphology and illustrate your answer with concrete examples in English or French. Is this type of morphology relevant for all languages? More generally, is morphology of the same complexity for all languages? | The results suggest that neither of the hypotheses trying to explain the "Second Album Syndrome" are true:
The coefficient associated with the time difference is negative: this implies that the longer time goes by, the worse the score of the next album will be. This is the opposite of what the time spent hypothesis sa... | 0.1 | M1_preference_data_177 |
If process i fails, then eventually all processes j≠i fail
Is the following true? If all processes j≠i fail, nothing can be said about process i | ["answer should fit the regular expression: Cohen's kappa", "answer should fit the regular expression: (we should compute )?(the )?(Cohen(['’]?s)? )?kappa( (score|metric))?", "answer should fit the regular expression: inter[- ]?annotator agreement ((with )|\\()?(e\\.g\\.?:? )?Cohen['’]?s kappa\\)?", "answer should fit ... | 0.1 | M1_preference_data_178 |
Assume your team is considering adding support for the SwengPhotos cloud service, which provides upload and download of photos on private cloud storage. Each photo is associated with a unique name. SwengPhotos's documentation for the "upload new photo" interface describes the following error responses:
1. I/O error
2. ... | No. Dependences need to be statically determined at compile time to build the execution schedule. If there is no way to determine that two accesses are independent, the compiler needs to schedule them conservatively assuming a (possible) dependence. | 0.1 | M1_preference_data_179 |
For a bipartite graph, devise an efficient algorithm for finding an augmenting path $P$ (if one exists). What is the total running time of the \textsc{AugmentingPathAlgorithm} explained in the second lecture? | An adder is needed on the address path of the register
file. The adder adds a value from a register (an offset)
changed as a function of the exttt{alloc} parameters. | 0.1 | M1_preference_data_180 |
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then... | MapTrCons, ConsAppend, IH, MapTrCons | 0.1 | M1_preference_data_181 |
Consider the standard linear programming relaxation of Set Cover that we saw in class. We gave a randomized rounding algorithm for the Set Cover problem. Use similar techniques to give an algorithm that, with probability at least a positive constant, returns a collection of sets that cover at least $90\%$ of the eleme... | Let $X_e$ be the indicator random variable that edge $e$ is cut. Then \begin{align*} \E[\mbox{\# edges cut}] = \E\left[ \sum_{e\in E} X_e \right] = \sum_{e\in E} \E[X_e]\,. \end{align*} We complete the proof by showing that $\E[X_e] \geq 1/2$ for $e=\{u,v\}\in E$. We have \begin{align*} \E[X_e] = \Pr[\mbox{$e$ is cut}]... | 0.1 | M1_preference_data_182 |
Consider the following contains function defined on Iterable (in particular, it accepts both Vector and List). def contains[A](l: Iterable[A], elem: A): Boolean = val n = l.size if n <= 5 then for i <- l do if i == elem then return true false else val (p0, p1) = parallel( contains... | The purpose of the daily Scrum meeting is to synchronize the team's work and to identify any impediments that might prevent the team from delivering the work. Therefore, the team should not be discussing the implementation details, of features during the meeting. Instead, the meeting should be solely dedicated to repor... | 0.1 | M1_preference_data_183 |
Show that, given a matroid $\mathcal{M} = (E, \mathcal{I})$ and a weight function $w: E \rightarrow \mathbb{R}$,~\textsc{Greedy} (as defined in the lecture notes) always returns a base of the matroid. | Note that, if $x$ is a feasible solution, $x_{iH} + x_{iM}=1$ for all $i=1, \dots, n$. Otherwise, if $x_{jH} + x_{jM} < 1$, we would have that (since $s_i>0$ for every item $i$) \begin{align*} 2 \cdot C &= \sum_{i=1}^n s_i x_{iH} + \sum_{i=1}^n s_i x_{iM} = s_j(\underbrace{x_{jH} + x_{jM}}_{< 1}) + \sum_{i=1, i \neq j}... | 0.1 | M1_preference_data_184 |
Given the following function sums:
1 def add(c: Int, acc: List[(Int, Int)]): List[(Int, Int)] = acc match
2 case Nil => List((c, 1))
3 case x :: xs => if x._1 == c then (c, x._2+1) :: xs else x :: add(c, xs)
4
5 def sums(digits: List[Int]): List[(Int, Int)] =
6 digits.foldRight(List[(Int, Int)]())(add)
Your task is to ... | This kind of issue should be documented in the code until it is fixed, not in an unrelated document that may be forgotten or become out of sync. | 0.1 | M1_preference_data_185 |
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$. Hin... | ['bush(2), house(2)', 'bush(2),house(2)', 'house(2),bush(2)', 'house(2), bush(2)', 'bush (2), house (2)', 'bush (2),house (2)', 'house (2), bush (2)', 'house (2),bush (2)', '"bush(2), house(2)"', 'house(2)', 'cat(5), house(2)', 'bush(2), house(2), mouse(3)', 'bush(2), target(1), house(2)', 'cat(5), bush(2), house(2)', ... | 0.1 | M1_preference_data_186 |
Give some concrete examples of NLP applications that might benefit from the semantic vectorial representations. | Modify the “candeliver” function.
Function candeliver(m) returns Boolean is return #(ack[m]) > N / 2
Suppose that a correct process delivers m. That means that at least one correct process p “acknowledged” m (rebroadcast m using BestEffortBroadcast). Consequently, all correct processes eventually deliver m from BestEf... | 0.1 | M1_preference_data_187 |
Give an example of an exception whose precise implementation is
arguably irrelevant in practice. | Only $x_3$ has a positive coefficient in $z$, we will pivot $x_3$. We have $\nearrow x_3 \longrightarrow \ x_3 \leq \; \infty \ (1),\ x_3 \leq 3\ (2),\ x_3 \leq 2\ (3)$, Thus we use third equality to pivot $x_3$. Hence $x_3=\frac{1}{2}(4+3x_2-s_3)$. And we get \begin{align*} \hspace{1cm} x_1 &= 1 + \frac{1}{2}(4+3x_2-s... | 0.1 | M1_preference_data_188 |
When are paired t-tests helpful? Justify. | In the same manner, this can be solved by defining recursively $W(n) = 2 W(n/2) + O(n)$. For a quick answer, one can use the master theorem and find that $W(n)$ is $\Theta(n \log n)$. Also, one can prove by induction that $W(n)$ is $\Theta(n \log n)$. | 0.1 | M1_preference_data_189 |
A service is an application component that performs long-running operations, usually in the background. A service doesn't provide a UI.
While reviewing the pull request of a friend you notice that he periodically fetches data from the cloud in his activity? What potential problem this could lead to, and how can you fix... | The + operation is not associative. Notice that due to the nature of our definition, wherein we maintain a finite precision (just 4 bits!), adding a small number to a large one may not produce a change at all. We use this property to construct a counterexample: val a = Float8(3, 8) // a: Float8 = Float8(3,8) val b = ... | 0.1 | M1_preference_data_190 |
Last year Professor Ueli von Gruy\`{e}res worked hard to to obtain an estimator $\Alg$ to estimate the total cheese consumption of fondue lovers in Switzerland. For a small $\epsilon >0$, his estimator \Alg only asks $3/\epsilon^2$ random persons and have the following guarantee: if we let $W$ denote the true answer... | Returns List(1) if the input list contains exactly one digit 1, an empty list otherwise | 0.1 | M1_preference_data_191 |
In the following let $\kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ and $\kappa_{2}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ be two valid kernels. Show that the following are is a valid kernel: $\kappa\left(\mathbf{x}, \mathbf{x}^{\prime}\right)=a \kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)+b \... | def insert (elem: Int, list: List[Int]): List[Int] = list match{ case x :: xs if x < elem => x :: insert (elem, xs) case _ => elem :: list } | 0.1 | M1_preference_data_192 |
As a group, write a function called minMax, which should take a non-empty array as input and return a pair containing the smallest and the largest element of the array. def minMax(a: Array[Int]): (Int, Int) = ??? Now write a parallel version of the function. You may use the constructs task and/or parallel, as seen in ... | 1. In general, Spectre builds on the branch prediction and
speculative execution, thus is something which should not work
with VLIWs.
2. But it is indeed possible due to the existence of a
speculative load.
3. The atta... | 0.1 | M1_preference_data_193 |
Given the following function sums:
1 def add(c: Int, acc: List[(Int, Int)]): List[(Int, Int)] = acc match
2 case Nil => List((c, 1))
3 case x :: xs => if x._1 == c then (c, x._2+1) :: xs else x :: add(c, xs)
4
5 def sums(digits: List[Int]): List[(Int, Int)] =
6 digits.foldRight(List[(Int, Int)]())(add)
Your task is to ... | It means that on entering an exception handler, all instructions
before the point where the exception happened are executed and
committed and no instruction after it is executed nor committed. | 0.1 | M1_preference_data_194 |
What happens in the reliable broadcast algorithm if the completeness property of the failure detector is violated? | The depth can be defined recursively as $D(n) = \text{max}(D(n/2), D(n/2)) + O(1) = D(n/2) + O(1)$. Therefore, $D(n)$ is $\Theta(\log n)$. One way of seeing it would be by drawing the call tree, its depth is $\Theta(\log n)$ because each time, we split the array in half. | 0.1 | M1_preference_data_195 |
In an automated email router of a company, we want to make the distinction between three kind of
emails: technical (about computers), financial, and the rest ('irrelevant'). For this we plan to use a
Naive Bayes approach.
What is the main assumption made by Naive Bayes classifiers? Why is it 'Naive'?
We will consider ... | for x in ["authors_citations", "authors_publications", "authors_hindex"]:
df[x + "list"] = df[x].apply(lambda a: str(a).replace("-1;","").replace(";-1","").split(";"))
df[x + "_median"] = df[x + "list"].apply(lambda a: np.median([float(v) for v in a])) | 0.1 | M1_preference_data_196 |
Let's denote by respectively \(A\), \(B\) and \(C\) the value stored by the Viterbi algorithm in the node associated to respectively N, V and Adj for the word "time".If \(C > B > A\) and \(10 A \geq 9 C\), what would be the tag of "time" in the most probable tagging, if the tag of "control" is N (in the most probable t... | This is an abstraction leak: the notion of JavaScript and even a browser is a completely different level of abstraction than users, so this method will likely lead to bugs. | 0.1 | M1_preference_data_197 |
Vectorize the input with the Vector Space Model | 1. While the attacker may have correctly primed the LLC, they
may end up probing the L1 and thus learn nothing. It is
important to ``reprime'' the L1 with other data so that the
attacker sees only L1 misses when probing and thus can observe
... | 0.1 | M1_preference_data_198 |
In a nutshell, the "second album syndrome" is a theory that states that the second album of a band always sucks
You have the following regression output regarding the score_diff: the difference in scores between the second and the first album (second - first):
Dep. Variable: score_diff
R-squared: -0.000
Interpret... | the corpus being 19 characters long, there are 18 bigrams in total. Here are the counts Xc, 2;
Xh, 1; Xt, 1; at, 2; ca, 1; cu, 1; eX, 2; ha, 1; he, 2; tX, 2; th, 2; ut, 1 | 0.1 | M1_preference_data_199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.