# Tag Info

0

To make it short the relation between R2 and MSE is the following : $$\textrm{MSE}(y, \hat{y} ) = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y_i})^{2}$$ $$\textrm{R}^2(y, \hat{y} ) = 1 - \frac{\sum_{i=1}^{n} (y_i - \hat{y_i})^{2}}{ \sum_{i=1}^{n} (y_i - \bar{y})^{2} }$$ R2 is just MSE standatized between -1 ...

0

You might consider exploring Time-series analysis. As you've correctly pointed out, any model you will build will be based on the assumption that past factors are the ones that determine the future - therefore feature engineering is key. If calculating a ratio/percentage instead of a fixed value is more important to your analysis, then that would be the ...

1

I expected scikit to allocate completely new memory space for corresponding model during fit() call, which does not happen to be the case. So in the first case by calling models[component].append(model) I tend to save the address of model rather than the deep copy of the model itself. Later on, this model gets overwritten by the next one and so on. ...

0

This answer was submitted by the user @Vlad_Z These values represent the weighted observations for each class, i.e. number of observations per class multiplied by the respective class weight. Since your class weights aren't integers, the resulting values are the way they are. If you want to get class counts, you can simply divide your values by class weights....

0

Both algorithms will not score the same since the decision trees in the random forest are trained on different subsets of the training data. The idea behind this is the wisdom of crowds stating that a single prediction about a continuous number is usually worse than the mean/median of multiple predictions about the same number.

0

When we have such a imbalanced dataset, it is always a good practice to do hyperparameter tuning of some randomly sampled data. Once you get the best parameters apply it complete datasets For dealing with imbalanced I think craig has already pointed out links.

3

There are two important things in random forests: "bagging" and "random". Broadly speaking: bagging means that only a part of the "rows" are used at a time (see details here) while "random" means that only a small fraction of the "columns" (features, usually $\sqrt{m}$ as default) are used to make a single ...

0

+1 to Craig for the answer to the actual question. But I want to address two other remarks from your post. ...the class probability of sklearn random forest does not seem correct. Because for sklearn random forest, the sizes of classes of the training set determines the class probabilities of a single tree and the class probabilities of the random forest. ...

2

For the question - Why the performances of weka random forest and sklearn random forest are similar but they use different methods to compute class probabilities of an input instance? Often different algorithms will have similar results. This is not surprising. If you run the data through a GBM or logistic regression (with the proper feature engineering) ...

0

Not sure what is meant by a paper. Are you asking if there is mathematical proof that this is the best setting all of the time? There are some experiments pointed to from here, a text book quote in that answer, and in the link you posted. The answer is "it depends". You can tune this parameter for your data and problem. Perhaps n/3 is a good place ...

1

Most likely the features are not sufficiently discriminative for class 2: class 2 data points are mixed with some of the other classes, and the model cannot distinguish them so it predicts the most likely class. To investigate more precisely the first step is to look at the confusion matrix: see which other classes the class 2 instances are confused with. ...

0

From what I see from the discussion in the comments, I understand that there are two possible issues: class imbalance and few explanatory variables (or a lack of predictive power). For the first issue, you may look into SMOTE (synthetic oversampling https://imbalanced-learn.org/stable/references/generated/imblearn.over_sampling.SMOTE.html). In any case you ...

Top 50 recent answers are included