Skip to content

Commit

Permalink
Merge branch 'dev' into dfrancisco1998-5
Browse files Browse the repository at this point in the history
  • Loading branch information
bdpedigo authored Sep 27, 2020
2 parents f99dd7c + e397c23 commit dbbb718
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graspy/embed/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class AdjacencySpectralEmbed(BaseEmbed):
Attributes
----------
n_features_in_: int
Number of features passed to the fit method.
latent_left_ : array, shape (n_samples, n_components)
Estimated left latent positions of the graph.
latent_right_ : array, shape (n_samples, n_components), or None
Expand Down Expand Up @@ -154,5 +156,6 @@ def fit(self, graph, y=None):
if self.diag_aug:
A = augment_diagonal(A)

self.n_features_in_ = len(A)
self._reduce_dim(A)
return self
2 changes: 2 additions & 0 deletions graspy/embed/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class BaseEmbed(BaseEstimator):
----------
n_components_ : int
Dimensionality of the embedded space.
n_features_in_: int
Number of features passed to the fit method.
See Also
--------
Expand Down
4 changes: 4 additions & 0 deletions graspy/embed/lse.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class LaplacianSpectralEmbed(BaseEmbed):
Attributes
----------
n_features_in_: int
Number of features passed to the fit method.
latent_left_ : array, shape (n_samples, n_components)
Estimated left latent positions of the graph.
Expand Down Expand Up @@ -157,6 +160,7 @@ def fit(self, graph, y=None):
)
warnings.warn(msg, UserWarning)

self.n_features_in_ = len(A)
L_norm = to_laplace(A, form=self.form, regularizer=self.regularizer)
self._reduce_dim(L_norm)
return self
4 changes: 4 additions & 0 deletions graspy/embed/mds.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class ClassicalMDS(BaseEstimator):
Equals the parameter n_components. If input n_components was None,
then equals the optimal embedding dimension.
n_features_in_: int
Number of features passed to the fit method.
components_ : array, shape (n_components, n_features)
Principal axes in feature space.
Expand Down Expand Up @@ -192,6 +195,7 @@ def fit(self, X, y=None):
self.components_ = U
self.singular_values_ = D ** 0.5
self.dissimilarity_matrix_ = dissimilarity_matrix
self.n_features_in_ = X.shape[1]

return self

Expand Down

0 comments on commit dbbb718

Please sign in to comment.