File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 1515# limitations under the License.
1616#
1717
18- import uuid
1918from abc import ABCMeta
2019
21- __all__ = ['Param' , 'Params' ]
22-
23-
24- class Identifiable (object ):
25- """
26- Object with a unique ID.
27- """
20+ from pyspark .ml .util import Identifiable
2821
29- def __init__ (self ):
30- #: A unique id for the object. The default implementation
31- #: concatenates the class name, "-", and 8 random hex chars.
32- self .uid = type (self ).__name__ + "-" + uuid .uuid4 ().hex [:8 ]
3322
34- def __repr__ (self ):
35- return self .uid
23+ __all__ = ['Param' , 'Params' ]
3624
3725
3826class Param (object ):
Original file line number Diff line number Diff line change 1515# limitations under the License.
1616#
1717
18+ import uuid
19+
1820
1921def inherit_doc (cls ):
2022 for name , func in vars (cls ).items ():
@@ -28,3 +30,17 @@ def inherit_doc(cls):
2830 func .__doc__ = parent_func .__doc__
2931 break
3032 return cls
33+
34+
35+ class Identifiable (object ):
36+ """
37+ Object with a unique ID.
38+ """
39+
40+ def __init__ (self ):
41+ #: A unique id for the object. The default implementation
42+ #: concatenates the class name, "-", and 8 random hex chars.
43+ self .uid = type (self ).__name__ + "-" + uuid .uuid4 ().hex [:8 ]
44+
45+ def __repr__ (self ):
46+ return self .uid
You can’t perform that action at this time.
0 commit comments