Skip to content

Commit

Permalink
0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Sep 12, 2023
1 parent 1bf98d0 commit fd3f41b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
37 changes: 21 additions & 16 deletions prince/gpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ class GPA(base.BaseEstimator, base.TransformerMixin):
3. Compute the mean shape of the superimposed shapes.
4. Repeat steps 2 and 3 until convergence.
Parameters:
max_iter (int): The maximum number of Procrustes analysis iterations.
tol (float): The tolerance for the optimization; stops if the
procrustes distance decreases by less or equal to ``tol`` between
iterations.
init ({'random', 'mean'}): Method for initializing reference shape.
'random' : choose reference shape from shape list
'mean' : initialize reference shape as mean of shape list
scale (bool): Whether to compute transformations with a scale component
copy (bool): Whether to copy data or perform the computations inplace.
If False, data passed to fit are overwritten and running
fit(X).transform(X) will not yield the expected results,
use fit_transform(X) instead.
check_input (bool): Whether to check the consistency of the inputs.
random_state (int, RandomState instance or None): Determines random
number generation for initialization when ``init=='random'``
Parameters
----------
max_iter
The maximum number of Procrustes analysis iterations.
tol
The tolerance for the optimization; stops if the Procrustes distance decreases by less or
equal to `tol` between iterations.
init
Method for initializing reference shape.
- 'random' : choose reference shape from shape list
- 'mean' : initialize reference shape as mean of shape list
scale
Whether to compute transformations with a scale component.
copy
Whether to copy data or perform the computations inplace. If False, data passed to fit are
overwritten and running fit(X).transform(X) will not yield the expected results,
use fit_transform(X) instead.
check_input
Whether to check the consistency of the inputs.
random_state
Determines random number generation for initialization when `init=='random'`.
"""

Expand Down
1 change: 1 addition & 0 deletions prince/mca.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def fit(self, X, y=None):
The MCA is computed on the indicator matrix (i.e. `X.get_dummies()`). If some of the columns are already
in indicator matrix format, you'll want to pass in `K` as the number of "real" variables that it represents.
(That's used for correcting the inertia linked to each dimension.)
"""

if self.check_input:
Expand Down
2 changes: 1 addition & 1 deletion prince/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def transform(self, X, as_array=False):
return rc.to_numpy() if as_array else rc

@utils.check_is_dataframe_input
def fit_transform(self, X, as_array=False):
def fit_transform(self, X, y=None, as_array=False):
"""A faster way to fit/transform.
This methods produces exactly the same result as calling `fit(X)` followed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prince"
version = "0.12.0"
version = "0.12.1"
description = "Factor analysis in Python: PCA, CA, MCA, MFA, FAMD, GPA"
authors = ["Max Halford <maxhalford25@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit fd3f41b

Please sign in to comment.