I am getting accuracy 52% in test data in decision tree in option trading. How can I increase accuracy??
Hello Bhaskar,
The general approach to getting better accuracy is hyperparameter tuning. Now, in the official docs, you can have a look at the model architecture parameters you can possibly optimize. Once you have a list, you can use functions like GridSearchCV that intelligently goes over combinations of all architecture parameters to arrive at the ones that give the best result.
Here is an example:
from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import GridSearchCV params = {'max_leaf_nodes': list(range(2, 100)), 'min_samples_split': [2, 3, 4]} grid_search_cv = GridSearchCV(DecisionTreeClassifier(random_state=42), params, verbose=1, cv=3) grid_search_cv.fit(X_train, y_train)
Do get back if further assistance is needed.
only getting
Train Accuracy: 60.00%
Test Accuracy: 57.69% not more than that
after gridsearchcv the accuracy has changed only 3%. how i can improve it in better way??
Hello Bhaskar,
To improve further you might want to try using other features. Read about fractional differentiation. Also, try out combinations of various indicators. You can gauge the importance of a feature by using methods in this Kaggle kernel. This will help you keep your model trim. You might also find this section in the book "Interpretable Machine Learning" useful.
Do get back if further help is needed.