5 votes
Accepted

Why isn't my decision tree classifier able to solve the XOR problem properly?

I can reproduce this problem for an even more easily separable dataset: The ideal tree for it should be as follows: However, when I run DecisionTreeClassifier ...
Vladislav Gladkikh's user avatar
2 votes

Why isn't my decision tree classifier able to solve the XOR problem properly?

The algorithm fails because it is greedy. This means that it takes the first split decision immediately, without taking into account what will happen in next steps. An alternative would be given by ...
Jaume Oliver Lafont's user avatar
2 votes
Accepted

How can I interpret the value returned by score(X) method of sklearn.neighbors.KernelDensity?

The KernelDensity model learns a probability distribution from the training data. The score reflects how likely it is that any given sample has been drawn from the ...
Chillston's user avatar
  • 1,703
2 votes

I'm trying to understand the use model for different Python libraries

In short: Gym is complementary (but optional) to both tensorflow and pytorch. Stable-baselines (be sure to check version 3, which is based on Pytorch) supports gym natively (if I remember correctly.) ...
Luca Anzalone's user avatar
2 votes

I'm trying to understand the use model for different Python libraries

Your choices here are not really any different to choosing an open source library for any other purpose. Each library will have its own idiosyncratic parts, but usually these are minor things compared ...
Neil Slater's user avatar
  • 32.1k
1 vote
Accepted

Can I implement a sklearn model inside a Pytorch nn.Module?

Yes, you can define a totally custom Model, maybe with a clustering method you can call after forward only during inference. Clustering parameters (e.g centroids in ...
Ciodar's user avatar
  • 400
1 vote

Why does KNN Model return 99% accuracy on dataset with default parameters?

First assess whether the accuracy is unreasonably high. You as the domain expert are the best arbiter of that. Keep in mind that a high accuracy is not always impossible. For example, 99% accuracy ...
Snehal Patel's user avatar
1 vote
Accepted

Why does sklearn perceptron converge for linearly inseparable data points?

Line 30 of your jupyter notebook: Perceptron(max_iter=40, random_state=0) The perceptron does not converge, it simply stops after going through the data 40 times. Always read carefully the code and ...
Edoardo Guerriero's user avatar
1 vote
Accepted

How to make a proper approximation of Sine function with Neural Networks?

Two things are happening here: As you increase the number of $sin$ cycles that the neural network needs to approximate, the problem becomes harder for it to learn. The network - being 5 layers with ...
Neil Slater's user avatar
  • 32.1k
1 vote

Can ML be used to curve fit data based on dataset of example fits?

While John's answer I think gives a better idea of which direction I might want to go to seriously tackle this, it turns out that just throwing the data straight into some ...
argentum2f's user avatar
1 vote

Can ML be used to curve fit data based on dataset of example fits?

Yes, ML can fit a curve based on examples that include hyperparameters but not a model specification. To do this, you need to specify a family of models that is large enough to include the true model. ...
John Doucette's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible