New answers tagged

0

There are two important differences between decision trees and regression: Decision tree fit a straight a line (mean of the dependent variable for the feature space). Regression fits a sloped line (rise over run). Decision trees typically do not predict values outside the observed range. Linear regression can predict values outside the observed range.


0

I will try to refer to the points I have some opinion about: "What if it's not possible to label non-anomalous data to train the model?" In this case, you face unsupervised learning problem. there are plenty of reading material regarding this topic and plenty of approaches. here is one for example: https://towardsdatascience.com/unsupervised-...


0

For sure you have to make sure your final model has seen all the history training dataset some time . The only chance you have is to retrain your model (and not all the training algorithms accept it) in the fashion of incremental learning, where an already trained model is updated by being exposed to the new incoming data (used in online learning for ...


1

If we are using label encoder we would only need to convert gender however if that maps male = 0, female = 1 wouldn't the machine treat female > male? You are correct, using label encoder to encode categorical features is wrong in general, for the reason you mention. Note that scikit documentation advises against using it with features, it's supposed to ...


0

I have a slightly different take and view this problem as one related to recommender systems. Just like how one would recommend movies for users based on various approaches (involving both supervised and unsupervised methods), similarly you would recommend products to users. So while you could start with using both unsupervised (clustering to segment your ...


2

By default, GridSearchCV uses the score method of its estimator; see the last paragraph of the scoring parameter on the docs: If None, the estimator’s score method is used. And DecisionTreeRegressor.score (indeed, all/most regressors) uses R^2. In response to your edit: you can specify scoring='neg_mean_squared_error'. But note too that there's a linear ...


1

MSE (as well as MAE) depends on the unit/scale of the entity being predicted. For example, if you measure your predictor variable in meters or centimeters will directly affect the MSE (low MSE when you use meters compared to centimeters). One option you can consider is to look at the relative errors (errors divided by the true values). For example, relative ...


1

In general, it "okay" to apply to binary encode high cardinality datasets. In the sense of it will create numerical features that can be learned by a machine learning model. However there are often better options, such a label encoding, frequency encoding, target encoding, or embeddings. It is an empirical question which encoding scheme is best for ...


1

Well, based on how this algorithm works, here is why : You want to build 200 trees, with a max depth of 5 levels. Each tree is a decision tree, train with a subset of your data. To answer your question, it doesn't fit to the value 2 because that's not how it works. What's happening is that 52 trees predicted the value 0, 10 predicted the value 1, and 138 ...


0

First, setting feature_names will replace all the X[2] and such. Using feature_names=data.columns is sensible, provided your feature names aren't too long for easy display. Now, you'll still be comparing against the label encodings. By saving the label encoder objects (your encoder dict), you can retrieve which levels correspond to the integer labels (with ...


Top 50 recent answers are included