Scikit-learn Integration
The sklearn integration provides quantum-enhanced estimators that are fully compatible with the scikit-learn API.
Example Usage
Basic Regression Example:
from honeio.integrations import QCMLRegressor
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
# Generate sample data
X, y = make_regression(n_samples=1000, n_features=20, noise=0.1)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
# Create and train the quantum-enhanced regressor
qcml_regressor = QCMLRegressor(
hilbert_space_dim=16,
epochs=100,
lr=0.01,
random_state=42
)
qcml_regressor.fit(X_train, y_train)
# Make predictions
y_pred = qcml_regressor.predict(X_test)
Basic Classification Example:
from honeio.integrations import QCMLClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
# Generate sample data
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
# Create and train the quantum-enhanced classifier
qcml_classifier = QCMLClassifier(
hilbert_space_dim=16,
epochs=100,
lr=0.01,
random_state=42
)
qcml_classifier.fit(X_train, y_train)
# Make predictions
y_pred = qcml_classifier.predict(X_test)