PROOF OF CONCEPT: multilabel onevsrest SGDC classification #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey!
He implementado un clasificador multilabel, OneVSRest (multi-class) with decision tree classifier o linear svm. Tambien se implementa un Random Forest. Para ver los resultados podéis ejecutar el script.
Para ello he hecho un binning del max_payment y del min_payment en los siguientes niveles:
["very-low", "low", "low-medium", "medium", "medium-high", "high", "very-high"]
Dada un perfil como:
'age_interval': '35-44',
'max_payment_level': 'low', # pago máximo que se puede permitir
'min_payment_level': 'low', # pago mínimo que suele hacer.
'gender': 'male',
'weekday': '5'
saca varios zip-codes (multilabel) que pueden ser apropiados para ese perfile. Esto es una primera iteración. Se puede mejorar mucho y seguramente la diferencia esta en la fase de crear nuevas features a partir del dataset para ayudar al clasificador.
Se ha añadido un scoring aunque hay que interpretarlo con cuidado porque estamos haciendo un multilabel classification:
Algunos links que he ido mirando para poder implementar esto:
http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MultiLabelBinarizer.html
http://scikit-learn.org/stable/modules/generated/sklearn.multiclass.OneVsRestClassifier.html
http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html
http://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.DictVectorizer.html