I am using ANN for solving Regression problem. But it turns out that ANN is performing badly. I have a daily data (2000 - 2018) which contains 6400 rows and 5 variables (including 2 target). This is how my data looks like:    Rain Discharge  Level Discharge0 Level0 1  9.27     0.226 791.12    65.4600   1.08 2 17.62     0.433 791.18   209.6000   1.98 3 10.01     0.791 791.25   129.3000   1.50 4  4.61     0.988 791.28    60.3000   1.07 5 10.37     0.822 791.25    42.7400   0.98 6 46.25     9.564 791.78   173.0624   1.67  Here, I am trying to predict Discharge0 and Level0, one day ahead (in future). This is what I have tried: data &lt;- data.frame(Rain, Discharge, Level, Discharge0, Level0) data1 &lt;- data  # slide function can be used to take leads (for predicting one day ahead)  data1 &lt;- slide(data1, Var = &quot;df2.Discharge&quot;, slideBy = 1) data1 &lt;- slide(data1, Var = &quot;df2.Level&quot;, slideBy = 1)  # Last value of both variables is now NA (as one day lead is taken), it can be removed     data1 &lt;- na.omit(data1) data1 &lt;- data1[-c(4, 5)] # removing Discharhe0 and Level0.  I have taken lead of one day for both Discharge and Level. This is how final data looks like on which model is applied:    Rain Dischrge  Level   Level1 Discharge1 1  9.27    0.226 791.12 209.6000       1.98 2 17.62    0.433 791.18 129.3000       1.50 3 10.01    0.791 791.25  60.3000       1.07 4  4.61    0.988 791.28  42.7400       0.98 5 10.37    0.822 791.25 173.0624       1.67 6 46.25    9.564 791.78 352.5326       2.55  Now, the targets are Discharge1 and Level1 (they have one day lead). # 1:5844 contains data from 1st june, 2000 to 31st May, 2016  index &lt;- 1:5844 datatrain = data1[index, ] datatest = data1[-index, ]  # Scaling data between 0 and 1.  max = apply(data1 , 2 , max) min = apply(data1, 2 , min) scaled = as.data.frame(scale(data1, center = min, scale = max - min))  # Splitting into training and testing  train = scaled[index , ] test = scaled[-index , ]  # Applying neuralnet function  NN = neuralnet(Discharge1 + Level1 ~ rain + Discharge + Level, train, hidden = c(16, 8, 4), threshold = 0.05) plot(NN)  predict_test = neuralnet::compute(NN, test[, c(1, 2, 3)]) # Unscaling: converting back to original range  predict_test1 = (predict_test$net.result[, 1] * (max(data1$Discharge1) - min(data1$Discharge1))) + min(data1$Discharge1) predict_test2 = (predict_test$net.result[, 2] * (max(data1$Level1) - min(data1$Level1))) + min(data1$df2.Level1)  # Plotting acutal observations v/s real predictions  plot(datatest$Discharge1, predict_test1, col='blue', pch=16, ylab = &quot;Predicted Discharge&quot;, xlab = &quot;Real Discharge&quot;) title(&quot;Predicted Discharge v/s Real Discharge&quot;); abline(0, 1, col = &quot;black&quot;)   plot(datatest$Level1, predict_test2, col='blue', pch=16, ylab = &quot;Predicted Level&quot;, xlab = &quot;Real Level&quot;) title(&quot;Predicted Level v/s Real Level&quot;); abline(0, 1, col = &quot;black&quot;)  The model performs badly. Here are evaluation parameters: For Discharge: R-Squared -&gt; 0.36 NSE       -&gt; 0.30 RMSE      -&gt; 121.96  For Level: R-Squared -&gt; 0.39 NSE       -&gt; 0.29 RMSE      -&gt; 0.43  I am not able to understand what I am doing wrong. It would be great if someone can help me.
I'm training a neural network and the training loss decreases, but the validation loss doesn't, or it decreases much less than what I would expect, based on references or experiments with very similar architectures and data. How can I fix this?    As for question        to which this question is inspired, the question is intentionally left general so that other questions about how to reduce the generalization error of a neural network down to a level which has been proved to be attainable, can be closed as duplicates of this one.  See also dedicated thread on Meta:
"Elder brother" or "older brother"? I've read both forms in newspapers and online news: elder brother and older brother. What's the difference between them? When should I use which? Point reflection over a line I'm having trouble understanding the solution presented below (It's from a textbook). I tried to get something similar, but to no avail. Help me find the way he derived those a,b,x2 and y2 expressions.   Point p is a point which we want to reflect (It's a simple structure with two integers x and y representing coordinates on a 2d plane); (x0,y0) and (x1,y1) are coordinates of endpoints of a line.  Expected result is a new point with reflected coordinates.   Point mirror(Point p, int x0, int y0, int x1, int y1) {     double dx,dy,a,b;    long x2,y2;    Point p1; //reflected point to be returned      dx  = (double) (x1 - x0);    dy  = (double (y1 - y0);     a   = (dx * dx - dy * dy) / (dx * dx + dy*dy);    b   = 2 * dx * dy / (dx*dx + dy*dy);     x2  = Math.round(a * (p.x - x0) + b*(p.y - y0) + x0);     y2  = Math.round(b * (p.x - x0) - a*(p.y - y0) + y0);     p1 = Point((int)x2,(int)y2);      return p1;  } "print()" is producing undesired output in Visual Studio Code Number of solutions to the congruence $x^q \equiv 1 \mod p$. Let $p, q$ be distinct odd primes, I would like to compute the number of solution $\mod p$ to the congruence $x^q \equiv 1 \mod p$. (Show that it's $gcd(q, p - 1))$  If $x^q \equiv 1 \mod p$, since $q$ is prime, this must mean that $x$ is either $1$ or has order $q$.   Hence, the problem reduces to finding the number of elements of $U_p$ which is either $1$ or has order $q$.  If $ q \nmid  p - 1$, then there is only one element, namely $1$.  If $q \mid p - 1$, then the number of elements of order $q$ is $\phi(q) = q - 1$, and so the number of solutions to the congruence $\mod p$ is $q - 1 + 1 = q$, and in either case the number of solutions is $\gcd(q, p - 1)$.  Does this look fine? A clock near the surface of the earth will run slower than one on the top of the mountain.  If the equivalence principal tells us that being at rest in a gravitational field is equivalent to being in an accelerated frame of reference in free space, shouldn't the clock near the earth run increasingly slower than the other clock over time?  If those two clocks are considered to be in two different frames of acceleration, the one near the earth will have a greater acceleration than the one on the mountain, and thus over time, their relative velocity will increase over time which will increase the time dilation.  Or is this not a proper use of the equivalence principle? "Is the same" or "are the same"? Which is the correct one?     On average, the polyunsaturated fat content in one teaspoon of the olive oil and canola oil is the same        On average, the polyunsaturated fat content in one teaspoon of the olive oil and canola oil are the same On June 13th 2017 all SharePoint calculated columns with HTML markup stopped working.   Basically the fields now render text (regardless of setting the data type to number). The gist of the notice from Microsoft () is:     In Microsoft SharePoint lists and libraries, calculated fields that   are running in the classic UI mode can be used to display results   based on Excel-like formulas. This is a long standing capability, and   is documented in Calculate data in lists or libraries.      Some users have added HTML markup or script elements to calculated   fields. This is an undocumented use of the feature, and we will begin   blocking execution of custom markup in calculated fields in SharePoint   Online from June 13, 2017 onwards. We are also providing this as a   configurable option for on-premises in SharePoint Server 2016 and   SharePoint Server 2013 via the June 2017 and subsequent Public   Updates.   As we don't have on premise SharePoint (online), we have to find an immediate work around, given that this impacts our processes and thus, business.   Is anyone aware of third party applications that will allow for HTML, script markup (that works with SP online)? Digging in deeper to Javascript Remoting and I'm a bit confused.  The  starts off by showing how to set up everything and uses code like the following:  function getRemoteAccount() {     var accountName = document.getElementById('acctSearch').value;      // This remoting call will use the page's timeout value     Visualforce.remoting.Manager.invokeAction(         '{!$RemoteAction.AccountRemoter.getAccount}',         accountName,          handleResult     ); }   However, I've also seen examples where Visualforce.remoting.Manager.invokeAction is never called.  They end up looking something like the following:  function getText() {   var text = "";   JSRemotingBasicsController.doGetText(     function(result, event) {       // do something here     }   ); }   I'm wondering what is the point to using Visualforce.remoting.Manager.invokeAction when you can just reference the RemoteAction directly like the second example?  Is there something I'm missing?  Is there a time where the second example doesn't work? How to repair a corrupted Excel file I'm trying to restore some files for a friend who messed up a USB stick by pulling it out of the computer too soon. By searching invisible partitions I was able to restore the files. All files are intact, except 1 excel file that seems to be corrupted.  I've googled about ways to repair an Excel file, because the default repair options in Excel 2003-2010 do not work for this file. I've came across a numerous  third-party apps, of which the  one seemes to be able to do the job: Recovery Toolbox for Excel.  Of-course, this and all other apps I found require a purchase to actually repair the file. It seems a bit silly to pay 30 dollars for a one time thing, and something that is not for myself. So, I would like to keep that as a last-resort option.  Is there anything I can try to fix this? I've attached a screenshot of how the file looks when I open it on my OSX when converted to a HTML file (to view the code), for  the option that it could be a character set problem. Handling multiple regex matches in Ampscript Given this string:  SET @text = "&lt;a href=""https://salesforce.stackexchange.com""target=""_blank""&gt;Salesforce&lt;/a&gt; &lt;a href=""https://stackoverflow.com"" target=""_blank""&gt;Everything else&lt;/a&gt;"   And this function:  SET @matching = '\s+(?:[^&gt;]*?\s+)?href="([^"]*)"' SET @output = RegExMatch(@text, @matching, 1)   How can I manage to find and print an arbitrary number of matches in my string? E.g. in above example, I would like to present e.g. a rowset with each URL in each row. How To Reduce Noise In Cycles Render I'm having the strangest issue since updating to OS X El Capitan. My "Open File" dialogs show the sidebar but all my main (and useful) locations are missing. Take a look at this screenshot. This screenshot shows Keychain Access but this happens in Safari when I'm trying to attach a file to Gmail for example, or uploading an image to Facebook.  What I would like is for the sidebar to show my home directories, such as Desktop, Documents, Downloads, etc.  Help? Number of reflexive relations defined on a set A with n elements Split a string by spaces -- preserving quoted substrings -- in Python I have a string which is like this:  this is "a test"   I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:  ['this','is','a test']   PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen. How to find (and delete) duplicate files I have a largish music collection and there are some duplicates in there. Is there any way to find duplicate files. At a minimum by doing a hash and seeing if two files have the same hash.  Bonus points for also finding files with the same name apart from the extension - I think I have some songs with both mp3 and ogg format versions.  I'm happy using the command line if that is the easiest way. Send data from Lightning Web Component (LWC) to a Visualforce page I am adding an LWC component in visualforce and need to add a handler for an event fired in the LWC component on the visualforce page. When googling all I can find is examples of how to do this with aura component using application events. LWC controller: handleSearchClick() {              const searchinfo = {          shipper: this.shipper,         system: this.system,         product: this.product,         status: this.template.querySelector('c-lwc-multi-select').value(),         period: this.period       };     this.dispatchEvent(new CustomEvent(         'dosearch',          {             detail: { data:  searchinfo},             bubbles: true,             composed: true,         }     ));     console.log({ 'lwcNominationSearch searchinfo': searchinfo }); }  AURA app: &lt;aura:application extends=&quot;ltng:outApp&quot; access=&quot;GLOBAL&quot;&gt; &lt;aura:dependency resource=&quot;c:lwcNominationSearch&quot; /&gt; &lt;aura:dependency resource=&quot;markup://force:*&quot; type=&quot;EVENT&quot;/&gt; &lt;/aura:application&gt;  Visualforce: &lt;div id=&quot;rcontainer&quot;&gt; &lt;/div&gt;  &lt;script&gt;     $Lightning.use(&quot;c:NotificationSearch_ltngoutApp&quot;, function()     {         $Lightning.createComponent(         &quot;c:lwcNominationSearch&quot;,         {},         &quot;rcontainer&quot;,         function(cmp)         {             console.log('component created');              //$A.eventService.addHandler({ &quot;event&quot;: &quot;c:myEvent&quot;, &quot;handler&quot; : visualForceFunction})               $A.eventService.addHandler({                 event: 'dosearch',                 handler: function (event) {                          console.log(&quot;vf event success&quot;);                 }             });          });     }); &lt;/script&gt; A list of inconveniences between quantum mechanics and (general) relativity? Constructing a circle through a given point, tangent to a given line, and tangent to a given circle While browsing around about problems similar to , I have found references to constructions of all types of circles. For example, not only is it possible to construct a circle tangent to three given circles, but one can construct a circle through any three points, tangent to any three lines, passing through two given points and tangent to a line or circle, passing through a given point and tangent to two given lines or circles, etc. Pretty much any combination of criteria regarding points, lines, and circles, with repetition.  Can we have one of each? I haven't found any resource saying whether it's possible or not to construct a circle through a given point, tangent to a given line, and tangent to a given circle. Is such a construction possible? Thanks. What is the proof that the universal constants ($G$, $\hbar$, $\ldots$) are really constant in time and space? 2D Integration With Quadratic Arg. of Delta Function