Downloads · 30 days
0
OsBaran/tg-xgb-morgan-879
tg-xgb-morgan-879 is a machine learning model from OsBaran. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for sklearn.
Bu model, moleküler SMILES dizilerini girdi olarak alıp bir 'value' (örn. pIC50, aktivite) değerini tahmin etmek için eğitilmiş bir XGBoost Regresörüdür.
Downloads · 30 days
0
Access
Public
Updated Nov 14, 2025
Repo size
5.8 MB
Likes
0
Public
Click a slice to open those files.
.joblib5.8 MB · 100%
From the Hugging Face model README
Bu model, moleküler SMILES dizilerini girdi olarak alıp bir 'value' (örn. pIC50, aktivite) değerini tahmin etmek için eğitilmiş bir XGBoost Regresörüdür.
Model, temizlenmiş veri setinin %20'si üzerinde test edilmiştir:
n_estimators: 527max_depth: 11learning_rate: 0.0823subsample: 0.9728colsample_bytree: 0.7048Modeli yüklemek ve tahmin yapmak için huggingface_hub, joblib ve rdkit gerekir.
import joblib
import numpy as np
from huggingface_hub import hf_hub_download
from rdkit import Chem
from rdkit.Chem import AllChem
# --- Gerekli fonksiyonlar ---
def get_morgan_fp(smiles, radius=3, n_bits=2048):
mol = Chem.MolFromSmiles(smiles)
if mol is None:
return np.zeros((n_bits,), dtype=int)
fp = AllChem.GetMorganFingerprintAsBitVect(mol, radius, nBits=n_bits)
return np.array(fp)
# --- Model ve ön işleyiciyi yükle ---
REPO_ID = "BURAYA-REPO-ID-GELECEK" # Örn: "kullanici-adi/model-adi"
MODEL_FILE = "xgb_morgan_regressor.joblib"
model_path = hf_hub_download(repo_id=REPO_ID, filename=MODEL_FILE)
model = joblib.load(model_path)
print("Model başarıyla yüklendi.")
# --- Tahmin yapma ---
smiles_list = ["CCO", "c1ccccc1O"]
fingerprints = np.array([get_morgan_fp(s) for s in smiles_list])
predictions = model.predict(fingerprints)
print(f"Tahminler: {predictions}")