New answers tagged

2

It might be because of the conflict of order between model.classes_ and series.unique() For a binary labels, model.classes_ = array([0, 1]) series.unique() = array([1, 0]) Try creating a constant value i.e. np.array[0,1] for labels and see.


4

CM is about True Vs Predicted. Since only one node is in the discussion which means we will have only one column of "Predicted" but all the possible rows of "True" Let's assume 100 samples in the Node. The Node must be classified as "A" Below should be the CM - Rows are "True" and the Column is the "Predicted"...


0

After some searching, I found this source code: https://github.com/scikit-learn/scikit-learn/blob/7813f7efb5b2012412888b69e73d76f2df2b50b6/sklearn/tree/_splitter.pyx#L467 I think, but am not 100% sure as my code comprehension is imperfect, that: Yes x_0 = (a+b)/2, where a is the nearest neighbor to the left and b is the nearest neighbor to the right


0

I have heard H20 Driverless AI uses an ensemble of xgboost and lightgbm models. In some situations it uses tensorflow neural nets as well.


0

hstack preserves the order of the columns, so you can piece together the feature names for each of your component arrays. OneHotEncoder (if that's what you used) and CountVectorizer both support get_feature_names, so concatenating the lists of feature names should be possible. To give full details would require more details about how each of the arrays was ...


1

See this article for a bit more detail on how to better explain EFB. Here is a brief visual explanation from there with my own edits. I hope you can appreciate the high production quality of my updated graphic... To answer your main question see "Part 1 of EFB". This explains that features are ordered by their sparsity and mixed in with all other ...


1

You might benefit from random forests instead which aim to achieve the same objectives you are aiming for, i.e better generalization through pruning to remove overfitting. scikit learn's random forest algorithm will let you specify how many or what proportion of variables you want to automatically drop across the many trees whose results will be averaged for ...


1

It should work: the variable is ordinal so using numerical values makes sense. So there's a bug somewhere, here are a few suggestions of things to look at: Possibly a type conversion error somewhere: make sure the variable is interpreted as numerical. Check whether the model actually uses the variable: if not then it's likely some type error; if yes then I ...


0

For 35 split, there is an error in the denominator. It should be 5 as the total number of items for D<35 is 5 D<35 => [2+, 3-], Entropy (D<35) = -[2/5 x $log_2$(2/5) + 3/5 x $log_2$⁡(3/5)]


0

The goal is to identify at least 98% of the customers, that do not repay their debt. So the bank can "accept a maximum number of 'good' customers, that can be granted loans" Here the goal is focused on the bad customers. There should be at least 85% good customers accepted while the side focus is to reject as many bad customers as possible. I ...


1

Very new release: genetic-tree The main objective of the package is to allow creating decision trees that are better in some aspects than trees made by greedy algorithms. The creation of trees is made by genetic algorithm. In order to achive as fast as possible evolution of trees the most time consuming components are wrtitten in Cython. Also there are ...


0

In general OneVsAll is a device useful when you want to transform a binary classifier into a multi-class one. This happens when models cannot handle multiple classes or when it is difficult to adapt it. By doing so, you have to normalize the probability estimates, otherwise they are not too useful, being rather non comparable. That alone is probably a ...


Top 50 recent answers are included