I have a well defined data where i have cleaned up my data to final form which has 20 features mapping to a number between 1 to 100. Upto 5 features are enabled(value set to 1) for each row. The data looks something like below

 45    |0 | 1|... 1 | 0
 92    |0 | 0|... 1 | 1

I'm trying to build machine learning models that can give me good accuracy and preferably models which can handle warm_start since each iteration generates 1 row that i need to fit into existing build model.

below are 2 classifiers that i tried to set some baseline

randclf = RandomForestClassifier(n_estimators=50)
decclf = DecisionTreeClassifier(criterion = "gini", random_state = 100,max_depth=3, min_samples_leaf=5)

However even with 100,000 records i'm getting very poor result with accuracy around 15-20%. considering how predictable data is(data is generated based on finite set of rules) i was expecting very high accuracy.

I'm i doing something wrong, i want get the high accuracy in classifying data(predicting Result) based on features given, can you suggest some models that might work well this kind of data. what about tensorflow and neural network approach?



Update: Data imbalance is something i cant help as they are generated based on rules.


2 Answers 2


I think neural network will be computationally intensive and would require you to have a good GPU along with good amount of training data. You can try running a clustering algorithm like k-means or logistic regression using warm_start


I think the biggest problem is with your data. Accuracy only makes sense as a metric if your labels are balanced. Your labels (Result) are very unbalanced. Your most frequent label (Result = 60) appears 27326 times while your least frequent label (Result = 29) appears only 3 times. Your can check this yourself by doing:

import pandas as pd
data = pd.read_csv('/PATH/TO/FILE.csv', index_col=0)

or you can plot it:


Result Count Bar Plot

So I suggest you start with generating balanced data where all labels are distributed equally.

Regarding your questions about neural networks and tensorflow. I would not recommend it to for your problem. The way you tackle multi-class problems with neural networks is by doing something called One vs. All which requires you to train one entire network per class. You have 101 classes and training 101 neural networks is not really practical. I think you should try out a gradient boosting classifier like LightGBM or XGBoost.

  • $\begingroup$ Thank you for that, data imbalance is something i cant help, each of the data nodes are generated sequentially, plus the rules cannot be changed. Each row is generated sequentially at each iteration which then i have to fit into my existing model(thats why i prefer classifiers with warm_start). I will try the classifiers that you have suggested. $\endgroup$ Commented Mar 23, 2019 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.