This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
recommendation.pyi
152 lines (144 loc) · 5.44 KB
/
recommendation.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http:https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import Any, Optional
import sys # noqa: F401
from pyspark import since, keyword_only # noqa: F401
from pyspark.ml.param.shared import (
HasBlockSize,
HasCheckpointInterval,
HasMaxIter,
HasPredictionCol,
HasRegParam,
HasSeed,
)
from pyspark.ml.wrapper import JavaEstimator, JavaModel
from pyspark.ml.common import inherit_doc # noqa: F401
from pyspark.ml.param import Param
from pyspark.ml.util import JavaMLWritable, JavaMLReadable
from pyspark.sql.dataframe import DataFrame
class _ALSModelParams(HasPredictionCol, HasBlockSize):
userCol: Param[str]
itemCol: Param[str]
coldStartStrategy: Param[str]
def getUserCol(self) -> str: ...
def getItemCol(self) -> str: ...
def getColdStartStrategy(self) -> str: ...
class _ALSParams(
_ALSModelParams, HasMaxIter, HasRegParam, HasCheckpointInterval, HasSeed
):
rank: Param[int]
numUserBlocks: Param[int]
numItemBlocks: Param[int]
implicitPrefs: Param[bool]
alpha: Param[float]
ratingCol: Param[str]
nonnegative: Param[bool]
intermediateStorageLevel: Param[str]
finalStorageLevel: Param[str]
def __init__(self, *args: Any): ...
def getRank(self) -> int: ...
def getNumUserBlocks(self) -> int: ...
def getNumItemBlocks(self) -> int: ...
def getImplicitPrefs(self) -> bool: ...
def getAlpha(self) -> float: ...
def getRatingCol(self) -> str: ...
def getNonnegative(self) -> bool: ...
def getIntermediateStorageLevel(self) -> str: ...
def getFinalStorageLevel(self) -> str: ...
class ALS(JavaEstimator[ALSModel], _ALSParams, JavaMLWritable, JavaMLReadable[ALS]):
def __init__(
self,
*,
rank: int = ...,
maxIter: int = ...,
regParam: float = ...,
numUserBlocks: int = ...,
numItemBlocks: int = ...,
implicitPrefs: bool = ...,
alpha: float = ...,
userCol: str = ...,
itemCol: str = ...,
seed: Optional[int] = ...,
ratingCol: str = ...,
nonnegative: bool = ...,
checkpointInterval: int = ...,
intermediateStorageLevel: str = ...,
finalStorageLevel: str = ...,
coldStartStrategy: str = ...,
blockSize: int = ...
) -> None: ...
def setParams(
self,
*,
rank: int = ...,
maxIter: int = ...,
regParam: float = ...,
numUserBlocks: int = ...,
numItemBlocks: int = ...,
implicitPrefs: bool = ...,
alpha: float = ...,
userCol: str = ...,
itemCol: str = ...,
seed: Optional[int] = ...,
ratingCol: str = ...,
nonnegative: bool = ...,
checkpointInterval: int = ...,
intermediateStorageLevel: str = ...,
finalStorageLevel: str = ...,
coldStartStrategy: str = ...,
blockSize: int = ...
) -> ALS: ...
def setRank(self, value: int) -> ALS: ...
def setNumUserBlocks(self, value: int) -> ALS: ...
def setNumItemBlocks(self, value: int) -> ALS: ...
def setNumBlocks(self, value: int) -> ALS: ...
def setImplicitPrefs(self, value: bool) -> ALS: ...
def setAlpha(self, value: float) -> ALS: ...
def setUserCol(self, value: str) -> ALS: ...
def setItemCol(self, value: str) -> ALS: ...
def setRatingCol(self, value: str) -> ALS: ...
def setNonnegative(self, value: bool) -> ALS: ...
def setIntermediateStorageLevel(self, value: str) -> ALS: ...
def setFinalStorageLevel(self, value: str) -> ALS: ...
def setColdStartStrategy(self, value: str) -> ALS: ...
def setMaxIter(self, value: int) -> ALS: ...
def setRegParam(self, value: float) -> ALS: ...
def setPredictionCol(self, value: str) -> ALS: ...
def setCheckpointInterval(self, value: int) -> ALS: ...
def setSeed(self, value: int) -> ALS: ...
def setBlockSize(self, value: int) -> ALS: ...
class ALSModel(JavaModel, _ALSModelParams, JavaMLWritable, JavaMLReadable[ALSModel]):
def setUserCol(self, value: str) -> ALSModel: ...
def setItemCol(self, value: str) -> ALSModel: ...
def setColdStartStrategy(self, value: str) -> ALSModel: ...
def setPredictionCol(self, value: str) -> ALSModel: ...
def setBlockSize(self, value: int) -> ALSModel: ...
@property
def rank(self) -> int: ...
@property
def userFactors(self) -> DataFrame: ...
@property
def itemFactors(self) -> DataFrame: ...
def recommendForAllUsers(self, numItems: int) -> DataFrame: ...
def recommendForAllItems(self, numUsers: int) -> DataFrame: ...
def recommendForUserSubset(
self, dataset: DataFrame, numItems: int
) -> DataFrame: ...
def recommendForItemSubset(
self, dataset: DataFrame, numUsers: int
) -> DataFrame: ...