Startonix / Modular-AI

Advanced AI Training and Building Repository
0 stars 0 forks source link

Advanced Algorithms and Hyperparameter Tuning #139

Open Startonix opened 1 month ago

Startonix commented 1 month ago

XGBoost Example xgboost_example.py

import xgboost as xgb import numpy as np

Example data

data = np.random.rand(100, 10) labels = np.random.randint(2, size=100)

dtrain = xgb.DMatrix(data, label=labels) param = {'max_depth': 2, 'eta': 1, 'objective': 'binary:logistic'} bst = xgb.train(param, dtrain, num_boost_round=10)