-
Notifications
You must be signed in to change notification settings - Fork 286
Description
I am using lightgbm4.6.0, and i use linear_tree=True to train a model
`
from hummingbird.ml import convert
import numpy as np
import lightgbm as lgb
from sklearn.model_selection import train_test_split
np.random.seed(42)
n_samples = 5000
X = np.random.rand(n_samples, 5) * 10
y = 1.5 * X[:, 0] + 0.8 * X[:, 1] - 2.0 * X[:, 2] + np.sin(X[:, 3]) + 0.1 * np.random.randn(n_samples)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
params = {
'objective': 'regression',
'linear_tree': True,
'num_leaves': 31,
'learning_rate': 0.05,
'verbose': -1
}
train_data = lgb.Dataset(X_train, label=y_train)
test_data = lgb.Dataset(X_test, label=y_test, reference=train_data)
model = lgb.train(
params,
train_data,
num_boost_round=200
)
onnx_model = convert(model, "onnx", test_input=X_train[:1])
onnx_model.save("linear_tree_model.onnx")
`
Thus, the output is different, how to deal it?