Downloads · 30 days
0
SHREE-03/nexadrug
nexadrug is a machine learning model from SHREE-03. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This repository contains a machine learning model designed to predict molecular properties like molecular weight and polar surface area from chemical compound data.
Downloads · 30 days
0
Access
Public
Updated Apr 5, 2025
Repo size
127 MB
Likes
0
Public
Click a slice to open those files.
.py4.6 KB · 62%
From the Hugging Face model README
This repository contains a machine learning model designed to predict molecular properties like molecular weight and polar surface area from chemical compound data.
| File Name | Description |
|---|---|
drug_model.py | Python script to train and use the model |
drug_prediction_model.pt | Trained PyTorch model file |
scaler.pkl | StandardScaler used for input preprocessing |
import torch
import joblib
import pandas as pd
from model import DrugPredictionModel # Your PyTorch model class
# Load scaler
scaler = joblib.load("scaler.pkl")
# Load model
model = DrugPredictionModel(input_size=11, output_size=2)
model.load_state_dict(torch.load("drug_prediction_model.pt"))
model.eval()
# Prepare new input
new_data = pd.DataFrame({...}) # input feature values
new_data_scaled = scaler.transform(new_data)
# Convert to tensor and predict
input_tensor = torch.tensor(new_data_scaled, dtype=torch.float32)
pred = model(input_tensor).detach().numpy()