scikit-learn/scikit-learn — pull request #1445 by glouppe (2012-12-04 13:35:53+00:00)
Title: WIP: Simplify the shape of (n_)classes_ for single output trees/forests

This is a early pull request.

The goal is to simplify the shape of the `n_classes_` and `classes_` attributes in trees and forests when considering single output problems.

For single output problems,
- `n_classes_` should be a scalar corresponding to the number of classes;
- `classes_` should be the list of class labels.

For multi output problems,
- `n_classes_` should be a list of scalars, such that `n_classes_[i]` is the number of classes in the i-th output,
- `classes_` should be a list of lists of class labels, such that `classes_[i]` is the list of class labels for the i-th output.

TODO:
- ~~Update tree.py~~
- ~~Add a regression test~~
- Update forest.py
- Update gradient_boosting.py