Decision trees & random forests
Në shqip: Pemët e vendimeve
ShpjegimiSQ
Një pemë vendimesh bën pyetje me radhë („mosha > 18?“, „ka punë?“) derisa arrin te përgjigja. Random forest kombinon qindra pemë; XGBoost i ndërton njëra pas tjetrës. Shumë të fuqishme për të dhëna në tabela.
EnglishEN
A decision tree asks questions in turn (“age > 18?”, “employed?”) until it reaches an answer. A random forest combines hundreds of trees; XGBoost builds them one after another. Very powerful for tabular data.
Si ta mendosh
Si loja „20 pyetje“.
Lexoje në anglisht
Like the game “20 questions”.
Shembull kodipython
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier().fit(X_train, y_train)
print(model.score(X_test, y_test))