Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Utilities for easy use of custom losses in CatBoost, LightGBM, XGBoost. This sounds very simple, but in reality it took a lot of work.
Install this via pip (or your favourite package manager):
pip install boost-loss
import numpy as np
from boost_loss import LossBase
from numpy.typing import NDArray
class L2Loss(LossBase):
def loss(self, y_true: NDArray, y_pred: NDArray) -> NDArray:
return (y_true - y_pred) ** 2 / 2
def grad(self, y_true: NDArray, y_pred: NDArray) -> NDArray: # dL/dy_pred
return - (y_true - y_pred)
def hess(self, y_true: NDArray, y_pred: NDArray) -> NDArray: # d^2L/dy_pred^2
return np.ones_like(y_true)
import lightgbm as lgb
from boost_loss import apply_custom_loss
from sklearn.datasets import load_boston
X, y = load_boston(return_X_y=True)
apply_custom_loss(lgb.LGBMRegressor(), L2Loss()).fit(X, y)
Built-in losses are available. 1
from boost_loss.regression import LogCoshLoss
torch.autograd
Loss 2import torch
from boost_loss.torch import TorchLossBase
class L2LossTorch(TorchLossBase):
def loss_torch(self, y_true: torch.Tensor, y_pred: torch.Tensor) -> torch.Tensor:
return (y_true - y_pred) ** 2 / 2
Thanks goes to these wonderful people (emoji key):
34j 💻 🤔 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Inspired by orchardbirds/bokbokbok ↩
Inspired by TomerRonen34/treeboost_autograd ↩
FAQs
Utilities for easy use of custom losses in CatBoost, LightGBM, XGBoost
We found that boost-loss demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.