diff options
Diffstat (limited to 'python/pyspark/mllib/linalg/__init__.py')
-rw-r--r-- | python/pyspark/mllib/linalg/__init__.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/python/pyspark/mllib/linalg/__init__.py b/python/pyspark/mllib/linalg/__init__.py index 4cd7306edb..70509a6d9b 100644 --- a/python/pyspark/mllib/linalg/__init__.py +++ b/python/pyspark/mllib/linalg/__init__.py @@ -38,12 +38,14 @@ else: import numpy as np +from pyspark import since from pyspark.sql.types import UserDefinedType, StructField, StructType, ArrayType, DoubleType, \ IntegerType, ByteType, BooleanType __all__ = ['Vector', 'DenseVector', 'SparseVector', 'Vectors', - 'Matrix', 'DenseMatrix', 'SparseMatrix', 'Matrices'] + 'Matrix', 'DenseMatrix', 'SparseMatrix', 'Matrices', + 'QRDecomposition'] if sys.version_info[:2] == (2, 7): @@ -1235,6 +1237,34 @@ class Matrices(object): return SparseMatrix(numRows, numCols, colPtrs, rowIndices, values) +class QRDecomposition(object): + """ + .. note:: Experimental + + Represents QR factors. + """ + def __init__(self, Q, R): + self._Q = Q + self._R = R + + @property + @since('2.0.0') + def Q(self): + """ + An orthogonal matrix Q in a QR decomposition. + May be null if not computed. + """ + return self._Q + + @property + @since('2.0.0') + def R(self): + """ + An upper triangular matrix R in a QR decomposition. + """ + return self._R + + def _test(): import doctest (failure_count, test_count) = doctest.testmod(optionflags=doctest.ELLIPSIS) |