New answers tagged

3

In your first case, you will have 30 * 7 + 1 parameters to explain 30 * 20 data points. With such a complex model you are bound to overfit and memorize your training data to a degree. With such a small sample size, your validation results can also be unreliable and merely due to chance. I would maybe try leave-one-out cross-validation to at least get some ...


0

If prediction of those specific classes is not of particular interest, you can group them. Note that you should have a minimum number of observations per group in order to be able to even estimate your parameters correctly (I can't remember what the formula is off the top of my head). Grouping small classes to meet that minimum requirement is common. With ...


4

Neural networks, in vast majority of cases, need lots of data. If you have 20 observations, neural network is clearly a bad choice. With that small sample size, network would easily memorize the data and overfit. Even cross-validation with that small sample size is disputable, because you'd be validating the results on just few samples at a time. With that ...


1

Assuming that this is a plot of x vs. y, the common variance assumption is clearly off. There is much greater variance on the right side of the plot than the left, indicating that y is less well predicted by x as x increases (at least in absolute terms). You could do various tests for heteroscedasticity, but I suggest using both OLS regression and a model ...


1

Your procedure is overly complicated, just use bootstrap. With bootstrap you would randomly, with replacement, take samples of size $n$, out of your dataset of size $n$. At each iteration you would repeat the whole procedure, including fitting your model, making predictions, and calculating accuracy. You would repeat this many times (hundreds or more) and ...


0

I had same problem. After going through many of suggestions available on web and implementing it (I don't remember exactly which one) I came to know that it happened because of convolution layer got input which is outside the intended input. Introducing batch normalization at the input layer solved the problem for me.


0

TL;DR: Discount factors are associated with time horizons. Longer time horizons have have much more variance as they include more irrelevant information, while short time horizons are biased towards only short-term gains. The discount factor essentially determines how much the reinforcement learning agents cares about rewards in the distant future relative ...


1

Disclaimer: I have not read the 95 pages paper. But I'll tackle the more general question: Aren't training and test sets coming from different distributions usually a problem to be avoided, not something that is done on purpose? No it's not a problem. On the contrary, IMHO it should be done more often. What is problematic is using a model to predict ...


1

Very intersting question, and I've been reading through this paper for a little while now, trying to understand, and here's my best guess at why this was done: The ML part of this paper is just restricted to just the first part of the study, where the objective is to simply predict (using the hourly wage variable in the dataset) which individuals earn an ...


0

$\newcommand{\bx}{\mathbf{x}}$ $\newcommand{\by}{\mathbf{y}}$ I personally prefer the Monte Carlo approach because of its ease. There are alternatives (e.g. the unscented transform), but these are certainly biased. Let me formalise your problem a bit. You are using a neural network to implement a conditional probability distribution over the outputs $\by$ ...


0

The key idea is that cross-validation is not a method for finding out how well a model generalizes, but how well a procedure for fitting a model generalizes. So if your model has hyper-parameters that are tuned via cross-validation, then that is an integral part of the model fitting procedure and needs to be included in the outer cross-validation as well, ...


2

The ELBO is, as usual, given by \begin{align} \mathcal{L} ( q ) &= \log p ( x ) - KL ( q ( z ) || p ( z | x) ) \\ &= \int q ( z ) \log \frac{ p ( x, z ) }{ q ( z )} dz \\ &= \mathbf{E}_q \left[ \log p ( x, z ) \right] + \mathcal{H} ( q ) \end{align} where $\mathcal{H}$ is the entropy. Now, if $q ( z ) = \mathcal{N} ( \mu, \Sigma )$, one has ...


0

A few thoughts: First, even if you ultimately need to evaluate the accuracy of your model, training and testing your model on accuracy is probably not be the best way to proceed. This issue is discussed extensively on this site, with this page being a good place to start. That probably explains why your cross-entropy losses (log losses) agree much better ...


2

When the sampling is termed "random" it usually means you do the equivalent of the following, as described in more detail at https://stats.stackexchange.com/a/54894/919 and https://stats.stackexchange.com/a/96000/919: Write down the name of each element of the set $S$ on one or more slips of paper (the "tickets"). Place these tickets into a box in such ...


0

First of all, you need to adjust your usage of some terms. For instance, your problem does not look like an anomaly detection problem because anomaly stands for rare events and abandon a form is not a rare event most of the time. Second is that just because your data is time-based your problem not necessarily turns into a time series modeling problem i.e you'...


0

imagen you have a target class with 10 target classes: class 0, class 2, ...., class 9 In the first example you will have only one target column called sparse labels, e.g.: columnA columnB target 10 10 0 1 24 2 ... in the second exmaple you will have one target column for every class: columnA columnB class 0 class 1 class 2 .... 10 ...


2

Some -- indeed many -- histograms relate to theoretical distributions. They're an entirely natural and conventional way for showing theoretical discrete distributions in particular, such as binomial or Poisson distributions. (But how well they do that is an interesting and sometimes important detail, yet is another story.) With theoretical include fitted, ...


0

This article lists a number of internal cluster validity indices: https://www.ncbi.nlm.nih.gov/pubmed/26389570. These internal indices are used to determine the quality of your clusters and some of these have been implemented in sklearn. Considering your tag I am going to assume that you are using Python. Here is a link to the cluster performance metrics ...


2

Of course, the specifics will depend on your particular nonparametric method. Gradient boosting is a meta-method, and it typically uses classification and regression trees (CARTs), so I'll work with that. An interaction is of the following abstract form: The impact of a predictor A on the outcome depends on the value of a different predictor B. CARTs ...


1

Indeed, it would be best to have a deeper description of the variables at stake, to better understand the available resources and the logistics of the problem. However, if you say that your goal is to forecast delays, just note that those are a time series in themselves; hence, you can directly model them, disregarding delivery times. Now, you have two ...


5

Seaborn's pairplot gives out what's called a "correlation plot" (see another example using MATLAB here). Since a correlation of a variable $X$ and itself is always one, there's little use displaying this. So by convention these plots plot out the variable's histogram/distribution instead. This is also noted in the function's documentation: The diagonal ...


2

My question is how can we know the exact position of the 'test_data', since we do not know the y_label of 'test data' The entire point of training the model is to predict the y_label from the feature precisely because we do not have access to the y_label at prediction time. You are right that we are not certain about the y_label even after fitting the ...


0

It appears the threshold is chosen to maximize the F1-score. Prediction Threshold For classification problems, when running h2o.predict() or .predict(), the prediction threshold is selected as follows: If you train a model with only training data, the Max F1 threshold from the train data model metrics is used. If you train a model with train ...


1

The point isn't to fit the data sample. It's to try to model the underlying physical processes that led to your data sample, in a way that accomplishes some desired goal. Trivially, the "best fit" to your data sample is a function defined only at the observed values of $x_i$, taking the corresponding observed value of $y_i$ at each $x_i$. I know that's not ...


1

If your dataset is so large that working with the entire thing is intractable then I'm not sure you have a choice other than sampling it (unless you're asking if a simple random sample, compared to other sampling techniques, is a good choice). Another sampling technique specifically for imbalanced data is SMOTE (Synthetic Minority Over-sampling Technique). ...


1

Usually a "best" fit is defined by some function of proximity to the data, like ordinary least squares linear fits. Otherwise, "best" is defined by some function of proximity to new data drawn from the same population. Overfitting is when your data matches the sample very closely but the new data from the same population very poorly. In either case, you're ...


1

Here is an article which discusses classification with imbalanced data: https://www.worldscientific.com/doi/abs/10.1142/S0218001409007326. The article mentions that: Classification of data with imbalanced class distribution has encountered a significant drawback of the performance attainable by most standard classifier learning algorithms which ...


1

you might find this article interesting: https://www.ncbi.nlm.nih.gov/pubmed/15572470. It is about: Optimal number of features as a function of sample size for various classification rules. It includes some 3D-plots of the error rate, sample size and feature size, for a number of algorithms e.g. SVM. Their research concluded that: First, the behavior of ...


0

In this context, what is exploitation? Can someone give a concrete example of exploitation? from the article: Then, in the exploitation step, you use the identified characteristics to figure out the next things to explore. You then repeat the above two steps until you are satisfied with what you have learned from the data and the answer is also in the ...


0

If you assume some gaussian prior on weights, and are willing to accept some small quantization error, then you can do the following: Quantize your weights/prior to some very fine tolerance Encode them with the optimal code corresponding to your prior. This should take $-\log P(\theta)$ bits where $P$ is your prior and $\theta$ are your parameters Of ...


0

The direct Fourier interpretation would indeed be $\cos(w^T x), \sin(w^T x)]$, as you've listed. You've actually slightly misunderstood the paper's proposal for only-cosine features, though; they use $\sqrt{2} \cos(w^T x + b)$, with $b \sim \mathrm{Uniform}[0, 2 \pi]$. Then \begin{align} \sqrt{2}\cos(w^T x + b) \sqrt{2}\cos(w^T y + b) &= \cos((w^T x + b)...


2

A related kernel that is valid is $$ k(x, y) = \lVert x \rVert^\beta + \lVert y \rVert^\beta - \lVert x - y \rVert^\beta $$ for $0 < \beta \le 2$; see Example 15 of Sejdinovic, Sriperumbudur, Gretton, and Fukumizu, Equivalence of distance-based and RKHS-based statistics in hypothesis testing, Annals of Statistics 2013. You can also use $$ \lVert x - z \...


1

This will never work! No matter what $\beta$ you choose. Take three distinct points in any $\mathbb{R}^n$ and the determinant of your kernel matrix $(t(x_i,x_j))$ will be negative for every $\beta$. Background: A function $t(\|x-y\|)$ defines a positive kernel on every $\mathbb{R}^n$, iff $t:[0,\infty[\rightarrow\mathbb{R}$ is "totally monotone"; totally ...


1

To me, this looks like normal behaviour. It could happen if, for example: method 1 (black line) is a more complicated model with a large number of trainable parameters method 2 (blue line) is a simpler model with only a few trainable parameters. In that case, for small sample sizes: method 1 has only a few data points for a lot of parameters and overfits ...


1

The interpretation of your results depends on what you want to achieve. What do you cant to achieve by clustering your data? If you want to make predictions of house prices you should use regression models, as you already mentioned yourself. In general, the performance of a clustering algorithm can be measured for instance by inter- and intra-cluster ...


3

We can pose PCA as a variance maximization problem. These are some of the hints: The objective is to find the directions in which the variance, $\Bbb E(\vec X \vec X^T)$, is maximum. Let $\vec w$ denote the unit vector direction along which the variance is maximum. The variance along this direction is given by: \begin{aligned} \sigma_{\vec{\omega}^{2}}^{...


0

There are a couple of problems with your plan. While your goal of improving speed is laudable is it appropriate for the problem at hand. The first problem is that if you are minimizing $f(\theta,\hat{\theta})$ and you are trying to substitute solving it as $g(\theta,\hat{\theta})$ then the question would become "what about this substitution would make ...


1

It depends. If your model will be applied to sound coming from one specific microphone, training the model on only sounds recorded with that microphone makes sense. However, if your model needs to be more robust, and perform well on sound recorded with different microphones, then you should have such variations in your dataset accordingly. As jonnor ...


3

I agree with BruceET comment about Fisher's Exact Test: The only way two Bernoulli distributions may differ from each other is by having different $p$ parameters i.e. the probability of success (it has nothing to do with p-value). So basically you have samples from Bernoulli distribution and you want to do a statistical test if the probabilities of success ...


1

I think your understanding is mostly fine. :) I alluded to what happens during the first boosting iteration in the earlier question: Why we fit xᵢ vs errorᵢ in Gradient Boosting. The first iteration is consider to start either from the 0 or the mean value of the response variable. Some packages (e.g. LightGBM) even go as far as to provide a ...


2

I struggled with this same problem--decomposing variance in high-dimensional prediction problems without limiting myself to fitting many, many linear regression models--and came up with the following solution: Shapley Decomposition of R-Squared in Machine Learning Models (with an R implementation). I would say that the trick in an applied setting is to ...


0

Look into splines which is a quite flexible modeling tool. For instance Flexible and inflexible models in machine learning.


0

If you are using a random sample of people, how can you choose how many from each group? But maybe you want to estimate a model from this sample (and retrospectively obtained demographic data), to use in future ... Maybe in future you really want to find the people in group 3. Then I would try multinomial logistic regression. Then you would have a ...


0

If you are just worried about the distance measure in the clustering, any type of scaling/normalization should work. I would recommend a StandardScaler, but MinMaxScaler or Normalizer should work as well.


0

Is this scenario suitable for a ML approach? Your problem seems to be closer to Information Retrieval than machine learning. Could you point me to any existing algorithms to have a closer look at? Any suggestions for a practical implementation of the given scenario? Search engines, the data structure you are looking for is called inverted index. There ...


0

Are you training your network with a single one of those training sets? Meaning that you just have 200 samples for the training of which one is positive and the rest negative? I think this is a tough classification problem anyways, because you classes are highly imbalanced. In this case, you usually want to re-balance the dataset, but this might be ...


-1

find-s algorithm is used to find the most specific hypothesis it will not consider the instance in which the output is false or 0. So, The Hypothesis are after each instance and neglecting the 3rd instance ['sunny', 'warm', 'normal', 'strong', 'warm', 'same'] ['sunny', 'warm', '?', 'strong', 'warm', 'same'] ['sunny', 'warm', '?', 'strong', '?', '?'] And the ...


1

I would run a sequential neural network in python with keras: https://keras.io/getting-started/sequential-model-guide/ The idea is to vectorize your textes first with the words. For example: I have a dream about yesterday I want to sleep Would give you the Words list: 'I, have, a, dream, about, yesterday, want, to, sleep' Then this words will be your ...


1

For the "leaf" value, you might find an explanation here or here and "cover" according to the documentation (see here) is the average coverage of splits which use the feature where coverage is defined as the number of samples affected by the split.


0

You are mapping intensity as function of time and frequency. That is: you have a map like $\mathbb{R}_+^2 \to \mathbb{R}_+ $. This is much like many other types of mappings from 2d coordinates to some 1d level. E.g. height maps, temperature maps, etc. Technically, you would indeed not need colours or 3 RGB channels, to express the (1 dimensional) result. ...


Top 50 recent answers are included