4
$\begingroup$

I have a text classification task. These are the metrics for different languages at present:

class1: 0.6823
class2: 0.7450
class3: 0.66
class4: 0.6719

How can I increase the performance of my random forest classifier in order to reach 90% accuracy? I already tried increasing the number of estimators and playing with the hyper-parameters that scikit provides, but I cannot significantly increase its performance. What hyper-parameter do I configure in order to increase its performance?

This is my current setup:

# For tfidf: 
tfidf_vect = TfidfVectorizer(norm=u'l1', use_idf=True, smooth_idf=True, 
                             sublinear_tf=False, min_df=2, stop_words=set(my_stop_words))

# For RF:
rbf = RandomForestClassifier(n_estimators=10000, criterion='entropy', max_depth=10000, 
                             max_leaf_nodes=None, bootstrap=True, oob_score=False, 
                             n_jobs=1, random_state=None, verbose=0, min_density=None, 
                             compute_importances=None)

What about using adaboost + random forest classifier in order to increase the performance? Is that possible?

$\endgroup$
3
  • $\begingroup$ A max depth of 10000 seems very large $\endgroup$
    – Aaron
    Commented Apr 21, 2015 at 17:25
  • $\begingroup$ What makes 90% accuracy a magic number? That level of accuracy is likely seriously over-fit to the training data. $\endgroup$ Commented Aug 19, 2015 at 15:02
  • $\begingroup$ How did you settle on RF as your model of choice? Another algorithm likely wouldn't improve your results up to 90%, but you could see a few percentage points improvement. $\endgroup$
    – Tchotchke
    Commented Aug 19, 2015 at 17:09

1 Answer 1

3
$\begingroup$

Since you're using scikit-learn, and you're trying to tweak the parameters of your classifier, you should consider using GridSearchCV. GridSearchCV allows to try out various parameter setups and pick the best one.

I really doubt this will let you achieve 90% accuracy, though. You should rather rethink whether the dataset you're using, and your feature extraction routines are sufficient to aim at such an accuracy level.

$\endgroup$

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.