We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mismatch with non-default transformer_weights
X, y = make_classification(n_features=100, n_samples=1000, random_state=42, n_classes=4, n_informative=8) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
model = FeatureUnion([('pca', PCA()), ('svd', TruncatedSVD())], transformer_weights={'pca': 100, 'svd': 3}).fit(X_train) onnx_model = convert_sklearn(model, 'pca', [('input', FloatTensorType(X_test.shape))]) save_model(onnx_model, 'pca3.onnx') sess = InferenceSession('pca3.onnx') res = sess.run(None, input_feed={'input': X_test.astype(np.float32)})
print(np.mean(np.isclose(model.transform(X_test), res[0], atol=1e-5)))
0.0196078431372549
The text was updated successfully, but these errors were encountered:
#222
Sorry, something went wrong.
No branches or pull requests
Mismatch with non-default transformer_weights
X, y = make_classification(n_features=100, n_samples=1000, random_state=42, n_classes=4, n_informative=8)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
model = FeatureUnion([('pca', PCA()), ('svd', TruncatedSVD())],
transformer_weights={'pca': 100, 'svd': 3}).fit(X_train)
onnx_model = convert_sklearn(model, 'pca', [('input', FloatTensorType(X_test.shape))])
save_model(onnx_model, 'pca3.onnx')
sess = InferenceSession('pca3.onnx')
res = sess.run(None, input_feed={'input': X_test.astype(np.float32)})
print(np.mean(np.isclose(model.transform(X_test), res[0], atol=1e-5)))
0.0196078431372549
The text was updated successfully, but these errors were encountered: