New answers tagged

0

Regarding the computational question, I'd look into parallel computing. Maybe there's a way too split up the tasks and let every core run a part of the algorithm. Though the task combined with the size of the dataset is definitely not meant for a casual home PC. Regarding the theoretical question (besides using resampling techniques like SMOTE, ROSE, ADASYN ...


0

A ridge regression (I presume logistic?) or any other regularized method (e.g., a variant of the Elastic Net) would be a reasonable way to start. Your accuracy problem will go away if you use proper scoring rules to assess quality instead of accuracy. Unbalanced classes are not a problem if you don't use accuracy: Are unbalanced datasets problematic, and (...


0

It will depend upon Provisioning period required for concerned team to act upon churn report generated by model Complete set data available at start of the month for you to score the customers. For example, if you are scoring customers for month of nov-2014 using predictors till oct-2014 then it only gives 30 days to do customer scoring and running campaign ...


1

Well, if your goal is discrimination, it doesn't really matter if the estimated parameters are unstable---the class assignments could well be stable! Even, if your goal is risk estimation, even if the individual parameter estimates are unstable, the predicted probabilities could be stable. So maybe there is no reason for worry! There are many similar posts ...


0

Four. See a notebook at https://github.com/bmreiniger/datascience.stackexchange/blob/master/CV423485.ipynb In general, we have a guarantee that each leaf node will be between leaf_size and 2*leaf_size (https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KDTree.html#sklearn.neighbors.KDTree), so we were certain to have between $\lceil 150/60\...


1

For tree based model, it can automatically handle redundant features, i.e. less useful features will not be selected as a split point. So you do not need to manually handle feature selection problems. In many implementations of random forest or tree based boosting, the algorithm will automatically select a subset of features to build each tree. Therefore, ...


1

Is there a correct way / order to do [two kind of hyperparameter optimization]? Yes: unless you know for sure that the different hyperparameters do not interact, they should to be optimized together. Here, they do interact => optimize together You can also optimize sequentially, but that should then become an iterative procedure: optimize one type of ...


2

It's ignored because you try to determine the class given $X=x$. So, $-x^2/2\sigma^2$ term is the same for all $k$, i.e. your classes. Therefore, it doesn't affect the decisions when two discriminant functions are compared, i.e. $\delta_k(x)$, $\delta_l(x)$. Once you have the discriminant functions, you put $x$ into them and choose the maximum one to get ...


13

TLDR: probabilities are not required to build a ROC curve, only a numerical scale supporting the decision. I'm studying the ROC Curve, and I was wondering if there is any classification algorithm that doesn't return the output class as a result of a certain threshold from the probabilities of the algo? I previously let this question slip because I ...


9

Support Vector Machines and $k$-Nearest Neighbors come to mind. (See here for a motivation for short answers. Longer answers are always welcome.)


2

You can, as long as such features are not computed using the value you're trying to predict. In time series, in order to predict today's (day $N$) value it is totally acceptable to have a feature -for example- containing the average value over the last 10 days (i.e. from day $N-10$ to day $N-1$). By itself, this does not constitute target leakage, as it's ...


1

Yes, this is done all the time. Improved results are often found when splitting features up into different groups, applying a neural net to each different set of features, and then inputting the results from each network into a final network for either classification or function approximation. As an example case, see Figure 2 for which multiple networks ...


0

I believe Shao's article applies most effectively to situations where a person is trying to eliminate predictors from a model (whether linear or non-linear, such as machine learning, etc.), and he recommends using Monte Carlo CV (MCCV) in this case. On the other hand, if you are not worried about the size (number of factors/predictors) in your model, ...


1

I think there are two things you should potentially be careful about: one is overfitting and the other is tuning the RBF kernel. More specifically: The RBF kernel (typically) has one free parameter often called the bandwidth. In order to get good performance, this parameter needs to be tuned. Typically, one tries out a (large) grid of candidate values for ...


1

According to the documentation, the PDPs in randomForest for classification problems display y-values in logits. (Though why then title the axis as "probability"?)


0

Because Naive Bayes assumes your features are not correlated, you don't need to provide an explicit a priori causal model - or rather, you already have, just implicitly. A Naive Bayes algorithm for predicting cancer would assume $p(Cancer|Smoking,Tar) = p(Cancer|Smoking)p(Smoking) + p(Cancer|Tar)p(Tar)$ A Hierarchical Bayesian model could specify a model -...


5

In general, your approach may work, and it might even give you something that works somewhat well. However, I would strongly advise against it, or only use something like this as a first step to just get a feel for the problem. Think about it this way: If you just shift one of the images one pixel to the left, how much would the vector representing that ...


4

If you final goal is using SVM, the problem is number of data points instead of the number of dimensions. See following question. Can support vector machine be used in large data? In real world SVM will not work very well if you have ~10K data and above. Your problem is a standard image classification problem using convolutional neural network CNN may be ...


3

As you note, Naive Bayes assumes the input features (predictors) are not correlated. This is a "naive" assumption, because input features commonly are correlated, just as regression predictors can be correlated (the problem of multicollinearity). But in some situations Naive Bayes models can work reasonably well and are much simpler to calculate.


2

You are looking for scoring-rules, which do precisely what you want: they assess the quality probabilistic predictions. Specifically, you want proper scoring rules, which are scoring rules that are optimized on the "correct" probabilistic predictions. Here is Wikipedia. The simplest one you could use would be the logarithmic score, which is $\log P_A$ if ...


0

Upsampling works best # Separate majority and minority classes df_majority = df[df.FRAUD == 0] df_minority = df[df.FRAUD == 1] # Upsample minority class df_minority_upsampled = resample(df_minority, replace=True, # sample with replacement n_samples=498551, # to match majority class ...


0

Consider trivial example $x = [0, 0, 0, 1, 2, 3]$ and $y = [1, 1, 1, 0, 0, 0]$. If you fit a decision tree to this data, it needs to make single split on $x < 1$ to get perfect fit to the data.


2

Let us to use $X$ to represent the feature and $Y$ to represent the label. Essentially, if $P(Y|X)=P(Y)$ or $X$ and $Y$ are independent, we can drop $X$. What you described feature has zero variance only for cases that belong to one class but not in the other Just tells this feature is an important feature that can differentiate different classes, i.e....


1

Even if that feature have zero variance for one of the classes (or even if it has zero variance for both classes!), it could still have very different values between the classes, so be a good discriminator. You should probably keep it!


0

Yes, those methods are valid. You can even inject those auxiliary inputs earlier into the network by "tiling them" -- that is, if you have some K-dimensional vector of auxiliary inputs, copy it on the height and width axes until you have a KxHxW tensor, and concatenate it to some intermediate feature map of your CNN. You could use one-hot coding for ...


0

I thought the macro in macro F1 is concentrating on the precision and recall other than the F1. We can calculate the macro precision for each label, and find their unweighted mean; by the same token its macro recall for each label, and find their unweighted mean. Once we get the macro recall and macro precision we can obtain the macro F1(please refer to here ...


0

I've seen this before, and it was because the response variable was numeric, rather than factor. As a result, the SVM was doing regression, rather than classification. Have you checked to see if 'satisfied' is a factor variable? I think that should resolve it.


0

A clarification on the meaning of "lazy learning" is provided by the definition of the opposed term "eager learning", according with wikipedia ... a learning method in which the system tries to construct a general, input-independent target function during training ... In other words a learner which collects the training data and use it directly at ...


0

Technically you can, but the MSE function is non-convex for binary classification. Thus, if a binary classification model is trained with MSE Cost function, it is not guaranteed to minimize the Cost function. Also, using MSE as a cost function assumes the Gaussian distribution which is not the case for binary classification.


1

The logistic regression in fact does produce probability output. If your process truly fits the logistic model, then you will get the probability distribution as an output too: $$Pr(y_i=1|X)=\frac{e^{X_i\beta}}{e^{X_i\beta}+1}$$ This does not have to be true with every classifier, of course. In case of logistic regression, we typically calibrate (fit) it ...


0

This is not a full answer. In the question I mentioned one way how I can imagine a small bias being amplified. In this question I write it down in more detail. I consider this way of amplification a bit trivial and wonder whether there are more reasons why Amazon's recruitment tool was considered biased, especially why it was biased because AI was being used ...


2

Here is what the segmented package for R finds if we ask it to find a single break point: R code: foo <- read.table("noisy data.csv",header=TRUE,sep=",",dec=".") library(segmented) # model without breaks as a starting point model.0 <- lm(TcpTimeStamp~Time.received,data=foo) # model with one break model.1 <- segmented(model.0,npsi=1) plot(model.1,...


0

I think there is a more satisfying solution than what has been suggested already, one that creates a single model that properly deals with the two kinds of input data and their relationship to the output class. Use a sequence model like an RNN to convert text into a kind of embedding. That embedding output is used directly as input to a dense layer that ...


0

For those interested in the same question: There's a scientific field that handles combination of classifiers. One tries to figure out 1 class with several classifiers, resulting in several estimations, eg, sample 1 classifies as 3,3, and 3, so I define it as 3 based on some criteria. Running your classification over different parts of your data, and then ...


0

I developed a Python library to solve the linear SVM with nonnegative constraint, see https://github.com/statmlben/Variant-SVM.


1

I don't think many would call this transfer learning, or that it is very useful to do so. The decision for class1 is just 'not class0'. Or seen based on a distance function or probability, class1 = score > threshold, which is equivalent to class0 = score < threshold, ie only the sign changed. Modeling normality instead of using both classes to create a ...


2

This is a histogram with superimposed kernel density for two variables, with no overlap in the data. If you are looking for a name for the plot, I would suggest "Histogram and KDE of Predicted Classification Probabilities". (You will need to add axis labels and a legend to your plot so that it makes sense.)


1

According to gbm's reference manual: While indeed type="response" then gbm converts back to the same scale as the outcome this currently will be returning probabilities for bernoulli and expected counts for poisson only. For all other distributions response and link return the same. That said, gbm.predict will indeed transform the response when the assumed ...


1

Theoretically, as in the linked post in @Sycorax's comment, you'll train with the whole training set, obtain a model and test on new data. This is advised, since you don't waste data, so your approach is correct. If you don't re-train with the whole training data, you'd have to choose one fold from the CV loop and train with it, which doesn't make much sense ...


3

The two major limitations of PCA: 1) It assumes linear relationship between variables. 2) The components are much harder to interpret than the original data. If the limitations outweigh the benefit, one should not use it; hence, pca should not always be used. IMO, it is better to not use PCA, unless there is a good reason to.


0

Using the matrix attached in the question and considering the values in the vertical axis as the actual class, and the values in the horizontal axis the prediction. Then for the Class 1: True Positive = 137 -> samples of class 1, classified as class 1 False Positive = 6 -> (1+2+4) samples of classes 2, 3 and 4, but classified as class 1 False Negative = 18 -...


0

All a neural network does is minimize some loss function. A sum (or multiple) of loss functions is a perfectly fine loss function in its own right. In fact, this is quite a common setup. L(whatever) regularization is an extra term in the loss function, for one example. A VAE doesn't even work properly unless you use a sum of two losses, for another. If ...


13

First of all, blindly throwing a model on some data cannot be possibly recommended (you may be able to relax that no-no if you have an infinite amount of independent cases at hand...). There is a formulation of the no-free lunch theorem that is related to the question: it states that over all possible data sets, no model is better than any other. The usual ...


23

Blindly using PCA is a recipe for disaster. (As an aside, automatically applying any method is not a good idea, because what works in one context is not guaranteed to work in another. We can formalize this intuitive idea with the No Free Lunch theorem.) It's easy enough to construct an example where the eigenvectors to the smallest eigenvalues are the most ...


4

Of course not, I don't recall reading/hearing any scientific method's name with the word always, let alone PCA. And, there are many other methods that can be used for dimensionality reduction, e.g. ICA, LDA, variuous feature selection methods, matrix/tensor factorization techniques, autoencoders ...


0

If the bank really is concerned with NPL status and not gradations of it, then I think your initial instinct to treat this as a classification problem is a sound one. If you go that route, you don't need to compute probabilities of missing first or second payments. Instead, you can use information about number of consecutive payments missed as another ...


1

No, it definitely does not help. Not just for Naive Bayes, but for any algorithm, as also noted in the comments. As you've also stated, it is random, unrelated and doesn't have expressive power over the target variable.


0

Bayes classifier chooses the class with maximum posterior probability. Since there are two classes, if $P(Y=1|X=x)\geq1/2$ it means posterior for class $1$ is the maximum one, and we choose it. That is why if $\eta(X)\geq 1/2$, it chooses class $1$. The formula for the posterior you've shared at the end is correct. You just need to be careful about calling ...


0

What you can do will depend strongly on the numbers of events in the 0-3, 3-6, and 6+ month groups. If you have adequate numbers, say from a Medicare study of discharged patients, you could simply stratify the analysis by the time interval of events. The control populations would those persons who entered the followup period alive and remained alive or were ...


0

Previous answers are correct. This answer attempts to explain how the mentioned expressions are related. The OP gave a specific case of Gaussian Naive Bayes, but the general Naive Bayes can be derived, and then the Multinomial Naive Bayes (with analogies to the word count example suggested), as follows: Bayes (not Naive) By Bayes Theorem, for any ...


Top 50 recent answers are included