Skip to content

v0.22.3

Latest
Compare
Choose a tag to compare
@thierrymoudiki thierrymoudiki released this 06 Oct 04:28
· 54 commits to master since this release

Generalize LSBoost gradient boosting to any base learner (alert: high performance)

See: https://thierrymoudiki.github.io/blog/2024/10/06/python/r/genericboosting
and examples directory examples/genboost*

Example:

import os 
import mlsauce as ms 
from sklearn.datasets import load_breast_cancer, load_iris, load_wine, load_digits
from sklearn.model_selection import train_test_split
from time import time

load_models = [load_breast_cancer, load_iris, load_wine]

for model in load_models: 

    data = model()
    X = data.data
    y= data.target

    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = .2, random_state = 13)

    clf = ms.LazyBoostingClassifier(verbose=0, ignore_warnings=True, 
                                    custom_metric=None, preprocess=False)

    start = time()
    models, predictioms = clf.fit(X_train, X_test, y_train, y_test)
    print(f"\nElapsed: {time() - start} seconds\n")

    print(models)