*NOTE, this question has been asked before here, yet I wasn't any less confused after reading the answers. *  Is the k-nearest neighbour algorithm a discriminative or a generative classifier? My first thought on this was that it was generative, because it actually used Bayes's theorem to compute the posterior. Searching further for this, it seems like it is a discriminative model, but I couldn't find the explanation.   So is KNN discriminative first of all? And if it is, is that because it doesn't model the the priors or the likelihood?
It seems that KNN is a discriminative learning algorithm but I can't seem to find any online sources confirming this.  Is KNN a discriminative learning algorithm?
When reviewing Suggested Edits on Stack Overflow, I often come across "fixed formatting" suggestions that use  to place emphasis on certain keywords, but isn't actual code.  For example:     I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete?   Gets edited to:     I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete?   This seems like an invalid use of an inline code span because, well, it isn't code, and it is distracting. There are a    of these edits being made. Often enough they get approved, which reinforces the behavior.  Is this a valid use of inline code spans? If not, should it be edited and corrected? Should edits suggesting these changes be rejected? C# Structs: Unassigned local variable? What are the good ways to migrate a RAID array to bigger disks? This is regards to the lorentz invariance of a classical scalar field theory. We assume that the action which is $S= \int d^4 x \mathcal{L}$, is invariant under a Lorentz transformation. How do you prove that the integration measure $d^4 x$ is Lorentz invariant. How do I disable negative scaling? By default blender allows you to scale past 0 - how do I prevent this?  i.e. it's common in other 3D modelling software to resize a set of vertices against an axis to align them - however this isn't possible when negative scaling is enabled. Why does a relay have a minimum applicable load? I am trying to find relays for my application and I read  which looks fine but specifies     Minimum applicable load: 10mV 10µA   In my circuit, it is expected that the relay closes but no voltage and current is applied. You can think of it as 2 relays in series where one is open and one is closed, so there is no current. This sounds like something I'd do since I was at school.  Why would a relay require a minimum voltage and current on the load side? Is it allowed to operate that relay under my conditions or not? What could possibly break in a relay if I don't respect this requirement? What does "minimum applicable load" mean? When and how do I need to consider this value? Should I sign, watermark or otherwise label a framed print? And if so how? I have an opportunity to show some of my work in a small local coffee shop.  Are there any guidelines/practices to signing, labeling or watermarking a photo which is to be on display?  Or should a photo be signed, labelled or marked at all? Is signing the back of the photo and showing my name on a separate card below the frame itself the "better" way to do this?   I noticed many people on the web put a very noticeable watermark with their logo, copyright and name right on the photo.  Personally, I find this distracting as it often ruins the photograph itself often turning what could be art to kitsch. Painters most often sign the painting itself but this to me is not distracting because it is done with the painter's own hand and it often "works" with the painting. Why is saltatory conduction in myelinated axons faster than continuous conduction in unmyelinated axons? Can "Wow!" be a sentence? The question is clear. Can "Wow!" be a sentence?  Imagine a hypothetical context where I'd utter something like this:     Wow! What an amazing idea! I should think about a way to push this fix.   We see "wow" in casual speech often. It bears punctuation marks (typically an exclamation mark, denoting the rising intonation) and a capital letter &mdash; just like all "regular" sentences.  On the other hand, neither Wow! nor What an amazing idea! contain any verbs. These certainly don't have any parts of speech in the other sentence, so what are they? Are they sentences or clauses? In other words, can "Wow!" be a sentence despite its lack of [any implied] verbs, and subsequently lack of any distinguishable predicates?  Please back up your answers with references. Great Theorem - Help name the Sci-fi book read long ago I'm trying to find a book I read long back. This book may have won a Hugo/Nebula (Trust me I've googled to death this one!).  Don't remember much of the story (that's why I want to re-read it). What I remember is that some of the powers in the book are called "Gods". And they have brains the size of the planets (or planets being their brains).  The protagonist in the climax, solves a theorem (The Great Theorem, perhaps) by remembering one of the obscure theorems (Jacuzi (?)) and incorporating it. This [Great] theorem helps spaceships helps find the shortest route from point A to B. He surprises the antagonist by reaching the vantage point quickly with the help of his new knowledge, and blasts his enemy's spaceship.  The ending of the book - as I remember it is - that the protagonist wants to become a God himself.  Please let me know the title &amp; author of this book if you've read it.  PS #1:  BTW, It's not Asimov's The Gods Themselves :) PS #2:  It's published at the least before 1998 How to return only the Date from a SQL Server DateTime datatype Is there an easy way to show which spheres can be Lie groups? how do I prove that $1 > 0$ in an ordered field? I've started studying calculus.  As part of studies I've encountered a question. How does one prove that $1 &gt; 0$?  I tried proving it by contradiction by saying that $1 &lt; 0$, but I can't seem to contradict this hypothesis.  Any help will be welcomed. When a star becomes a black hole, does its gravitational field become stronger? Compactness and axiomatisability Let $C$ be an axiomatisable class of structures for some given first-order signature, i.e. there is a set $T$ of sentences whose models are exactly the members of $C$.  Apparently it follows from the compactness theorem that: If $C$ contains arbitrarily large finite structures then it must contain an infinite structure.   Can someone explain this result? The compactness theorem tells me that $T$ has a model if each finite subset of $T$ has a model but I don't see how this relates to the size of structures in $C$. Google sheets split multi-line cell into new rows (+ duplicate surrounding row entries) I'm compiling a database of business address info, including key staff for each business. The Google spreadsheet I've inherited for this project includes a column for 'key staff' (in column B), with multiple key staff names listed in the same cell, separated by line breaks (ie CHAR(10) ). There is one business per row. The number of lines in the 'key staff' cell varies row-by-row.  My initial sheet looks like this:    I need to do the following to optimize this sheet:   split each multi-line ‘key staff’ cell so each key staff name appears on its own row. This requires that new row/s be inserted beneath the original row. duplicate the data from all other cells on the original row (i.e. from columns A &amp; C:E), so that each new row contains the full data for each business I need an automated process - I'll have about 1000 businesses to process so can't do this with any manual steps   The sheet should then look like this:    Using =TRANSPOSE(SPLIT(B1,CHAR(10))) obviously only goes part of the way - it doesn’t insert new rows and doesn’t duplicate the surrounding column entries. All help gratefully accepted! Can a set be neither open nor closed? An example would do. I cant think of any.   Thanks in advance! Is casting the same thing as converting? In Jesse Liberty's Learning C# book, he says "Objects of one type can be converted into objects of another type. This is called casting."  If you investigate the IL generated from the code below, you can clearly see that the casted assignment isn't doing the same thing as the converted assignment. In the former, you can see the boxing/unboxing occurring; in the latter you can see a call to a convert method.   I know in the end it may be just a silly  semantic difference--but is casting just another word for converting. I don't mean to be snarky, but I'm not interested in anyone's gut feeling on this--opinions don't count here! Can anyone point to a definitive reference that confirms or denies if casting and converting are the same thing?      object x;     int y;      x = 4;      y = ( int )x;      y = Convert.ToInt32( x );   Thank you  rp  Note added after Matt's comment about explicit/implicit:  I don't think implicit/explicit is the difference. In the code I posted, the change is explicit in both cases. An implicit conversion is what occurs when you assign a short to an int.  Note to Sklivvz:  I wanted confirmation that my suspicion of the looseness of Jesse Liberty's (otherwise usually lucid and clear) language was correct. I thought that Jesse Liberty was being a little loose with his language. I understand that casting is routed in object hierarchy--i.e., you can't cast from an integer to a string but you could cast from custom exception derived from System.Exception to a System.Exception.   It's interesting, though, that when you do try to cast from an int to a string the compiler tells you that it couldn't "convert" the value. Maybe Jesse is more correct than I thought! I have a program which spawns several child processes.  I want to know which files this program and its children are creating, deleting, and modifying.   inotifywait can tell me which files are being accessed, but cannot tell me which process is doing it. And I have to know where the files are being created in order to set up the monitor. auditctl will let me log which processes modify a file, but, again, I have to know where the files are in order to set up logging. lsof will tell me all of the files, but doesn't seem to be a good solution for real-time tracking.   Is there anything that will let me monitor a program's file manipulation without knowing a priori which files will be manipulated? We now that Fermat's last theorem is true so there are not positive integer solutions to $$x^n+y^n=z^n$$ for $n\in\mathbb{N}$ and $n&gt;2$.  But what about if $n\in\mathbb{R}$ or $n\in\mathbb{R}^+$?