Skip to content

Commit f7113d4

Browse files
committed
MNT : remove mlab.premca
Deprecated in dc13d25 (2009-11-03)
1 parent 6ee722c commit f7113d4

File tree

3 files changed

+6
-53
lines changed

3 files changed

+6
-53
lines changed

doc/api/api_changes/code_removal.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ Contained only a no-longer used port of functionality from PIL
7575
Remove ``mlab.FIFOBuffer``
7676
--------------------------
7777
Not used internally and not part of core mission of mpl.
78+
79+
80+
Remove ``mlab.prepca``
81+
----------------------
82+
Deprecated in 2009.

lib/matplotlib/mlab.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,6 @@
160160
gtk.main()
161161
162162
163-
Deprecated functions
164-
---------------------
165-
166-
The following are deprecated; please import directly from numpy (with
167-
care--function signatures may differ):
168-
169-
170-
:func:`load`
171-
Load ASCII file - use numpy.loadtxt
172-
173-
:func:`save`
174-
Save ASCII file - use numpy.savetxt
175-
176163
"""
177164

178165
from __future__ import (absolute_import, division, print_function,
@@ -1623,45 +1610,6 @@ def longest_ones(x):
16231610
return longest_contiguous_ones(x)
16241611

16251612

1626-
def prepca(P, frac=0):
1627-
"""
1628-
1629-
.. warning::
1630-
1631-
This function is deprecated -- please see class PCA instead
1632-
1633-
Compute the principal components of *P*. *P* is a (*numVars*,
1634-
*numObs*) array. *frac* is the minimum fraction of variance that a
1635-
component must contain to be included.
1636-
1637-
Return value is a tuple of the form (*Pcomponents*, *Trans*,
1638-
*fracVar*) where:
1639-
1640-
- *Pcomponents* : a (numVars, numObs) array
1641-
1642-
- *Trans* : the weights matrix, i.e., *Pcomponents* = *Trans* *
1643-
*P*
1644-
1645-
- *fracVar* : the fraction of the variance accounted for by each
1646-
component returned
1647-
1648-
A similar function of the same name was in the MATLAB
1649-
R13 Neural Network Toolbox but is not found in later versions;
1650-
its successor seems to be called "processpcs".
1651-
"""
1652-
warnings.warn('This function is deprecated -- see class PCA instead')
1653-
U, s, v = np.linalg.svd(P)
1654-
varEach = s**2/P.shape[1]
1655-
totVar = varEach.sum()
1656-
fracVar = varEach/totVar
1657-
ind = slice((fracVar >= frac).sum())
1658-
# select the components that are greater
1659-
Trans = U[:, ind].transpose()
1660-
# The transformed data
1661-
Pcomponents = np.dot(Trans, P)
1662-
return Pcomponents, Trans, fracVar[ind]
1663-
1664-
16651613
class PCA(object):
16661614
def __init__(self, a, standardize=True):
16671615
"""

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253

254254
from matplotlib.mlab import window_hanning, window_none, detrend, demean, \
255255
detrend_mean, detrend_none, detrend_linear, entropy, normpdf, \
256-
find, longest_contiguous_ones, longest_ones, prepca, \
256+
find, longest_contiguous_ones, longest_ones, \
257257
prctile, prctile_rank, \
258258
center_matrix, rk4, bivariate_normal, get_xyz_where, \
259259
get_sparse_matrix, dist, \

0 commit comments

Comments
 (0)