igl.models
scikit-learn-compatible estimators: classifier, regressor, autoencoder.
igl.models.classifier.IGLClassifier
Bases: _BaseIGLEstimator[CrossEntropyLoss], ClassifierMixin
scikit-learn-compatible classifier built on :class:igl.IGLModule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_dim
|
int
|
Latent dimension |
16
|
n_anchors
|
int | None
|
Anchor count. |
None
|
n_scales
|
int | None
|
Scale count. |
None
|
operator
|
OperatorNameLike | None
|
Kernel operator. |
None
|
normalize
|
NormalizeModeLike | None
|
Φ-normalization mode. |
None
|
encoder_hidden
|
int | tuple[int, ...] | None
|
Encoder |
None
|
encoder_depth
|
int | None
|
Encoder depth shorthand. |
None
|
config
|
IGLConfig | None
|
Optional :class: |
None
|
random_state
|
int | None
|
Optional integer seed for reproducible training. |
None
|
validation_fraction
|
float | None
|
If set, hold out this fraction of training data for early-stopping and dimension-curve evaluation. |
0.2
|
Attributes:
| Name | Type | Description |
|---|---|---|
classes_ |
Sorted unique training labels. |
|
n_features_in_ |
Ambient input dimension seen during fit. |
|
module_ |
The underlying :class: |
|
history_ |
:class: |
|
dimension_curve_ |
|
|
effective_dimension_ |
Detected elbow |
|
scaler_ |
:class: |
fit(x, y)
Fit the classifier on (x, y).
predict(x)
Predict class labels for x.
predict_proba(x)
Predict class probabilities for x.
igl.models.regressor.IGLRegressor
Bases: _BaseIGLEstimator[MSELoss], RegressorMixin
scikit-learn-compatible regressor.
Supports scalar and multi-output regression. Targets y may be a
1-D array ([n_samples]) for scalar regression, or 2-D
([n_samples, n_outputs]) for multi-output. The output dimension is
inferred from y in :meth:fit.
Args mirror :class:IGLClassifier except for validation_fraction.
Attributes:
| Name | Type | Description |
|---|---|---|
n_features_in_ |
Ambient input dimension seen during fit. |
|
n_outputs_ |
Number of output dimensions inferred from |
|
module_ |
The underlying :class: |
|
history_ |
:class: |
|
dimension_curve_ |
|
|
effective_dimension_ |
Discovered |
|
scaler_ |
:class: |
fit(x, y)
Fit the regressor on (x, y).
predict(x)
Predict targets for x. Returns 1-D if fit with scalar targets.
igl.models.autoencoder.IGLAutoencoder
Bases: _BaseIGLEstimator[MSELoss], TransformerMixin
Train an IGL model with y = x (reconstruction).
The :meth:fit method ignores its y argument and uses x as both
input and target.
Attributes:
| Name | Type | Description |
|---|---|---|
n_features_in_ |
Ambient input dimension. |
|
n_outputs_ |
Equal to |
|
module_ |
The underlying :class: |
|
history_, |
(dimension_curve_, effective_dimension_, scaler_)
|
same as
:class: |
fit(x, y=None)
Fit the autoencoder. y is ignored; the scaled x is the target.
Reconstruction is therefore measured in the StandardScaler-scaled
feature space. :meth:reconstruct inverse-transforms back to the
original feature space for users who need real-space outputs.
reconstruct(x)
Inverse-transform the reconstruction back to the original feature space.
transform(x)
Return the reconstructed input (in the scaled feature space).