Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

SPARK-29381 #292

Merged
merged 4 commits into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 44 additions & 35 deletions third_party/3/pyspark/ml/classification.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,69 @@ from pyspark.ml.param.shared import *
from pyspark.ml.tree import _DecisionTreeModel, _DecisionTreeParams, _TreeEnsembleModel, _RandomForestParams, _GBTParams, _HasVarianceImpurity, _TreeClassifierParams, _TreeEnsembleParams
from pyspark.ml.regression import DecisionTreeRegressionModel
from pyspark.ml.util import *
from pyspark.ml.wrapper import JavaPredictionModel, JavaPredictor, JavaPredictorParams, JavaWrapper, JavaTransformer
from pyspark.ml.wrapper import JavaPredictionModel, JavaPredictor, _JavaPredictorParams, JavaWrapper, JavaTransformer
from pyspark.sql.dataframe import DataFrame

class JavaClassifierParams(HasRawPredictionCol, JavaPredictorParams): ...
class _JavaClassifierParams(HasRawPredictionCol, _JavaPredictorParams): ...

class JavaClassifier(JavaPredictor[JM], JavaClassifierParams, metaclass=abc.ABCMeta):
class JavaClassifier(JavaPredictor[JM], _JavaClassifierParams, metaclass=abc.ABCMeta):
def setRawPredictionCol(self: P, value: str) -> P: ...

class JavaClassificationModel(JavaPredictionModel[T], JavaClassifierParams):
class JavaClassificationModel(JavaPredictionModel[T], _JavaClassifierParams):
def setRawPredictionCol(self: P, value: str) -> P: ...
@property
def numClasses(self) -> int: ...

class JavaProbabilisticClassifierParams(HasProbabilityCol, HasThresholds, JavaClassifierParams): ...
class _JavaProbabilisticClassifierParams(HasProbabilityCol, HasThresholds, _JavaClassifierParams): ...

class JavaProbabilisticClassifier(JavaClassifier[JM], JavaProbabilisticClassifierParams, metaclass=abc.ABCMeta):
class JavaProbabilisticClassifier(JavaClassifier[JM], _JavaProbabilisticClassifierParams, metaclass=abc.ABCMeta):
def setProbabilityCol(self: P, value: str) -> P: ...
def setThresholds(self: P, value: List[float]) -> P: ...

class JavaProbabilisticClassificationModel(JavaClassificationModel[T], JavaProbabilisticClassifierParams):
class JavaProbabilisticClassificationModel(JavaClassificationModel[T], _JavaProbabilisticClassifierParams):
def setProbabilityCol(self: P, value: str) -> P: ...
def setThresholds(self, value: List[float]) -> P: ...

class LinearSVC(JavaClassifier[LinearSVCModel], HasMaxIter, HasRegParam, HasTol, HasFitIntercept, HasStandardization, HasWeightCol, HasAggregationDepth, HasThreshold, JavaMLWritable, JavaMLReadable[LinearSVC]):
class _LinearSVCParams(_JavaClassifierParams, HasRegParam, HasMaxIter, HasFitIntercept, HasTol, HasStandardization, HasWeightCol, HasAggregationDepth, HasThreshold):
threshold: Param[float]

class LinearSVC(JavaClassifier[LinearSVCModel], _LinearSVCParams, JavaMLWritable, JavaMLReadable[LinearSVC]):
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., tol: float = ..., rawPredictionCol: str = ..., fitIntercept: bool = ..., standardization: bool = ..., threshold: float = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> None: ...
def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., tol: float = ..., rawPredictionCol: str = ..., fitIntercept: bool = ..., standardization: bool = ..., threshold: float = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> LinearSVC: ...

class LinearSVCModel(JavaClassificationModel[Vector], JavaMLWritable, JavaMLReadable[LinearSVCModel]):
class LinearSVCModel(JavaClassificationModel[Vector], _LinearSVCParams, JavaMLWritable, JavaMLReadable[LinearSVCModel]):
@property
def coefficients(self) -> Vector: ...
@property
def intercept(self) -> float: ...

class LogisticRegression(JavaProbabilisticClassifier[LogisticRegressionModel], HasMaxIter, HasRegParam, HasTol, HasElasticNetParam, HasFitIntercept, HasStandardization, HasThresholds, HasWeightCol, HasAggregationDepth, JavaMLWritable, JavaMLReadable[LogisticRegression]):
class _LogisticRegressionParams(_JavaProbabilisticClassifierParams, HasRegParam, HasElasticNetParam, HasMaxIter, HasFitIntercept, HasTol, HasStandardization, HasWeightCol, HasAggregationDepth, HasThreshold):
threshold: Param[float]
family: Param[str]
lowerBoundsOnCoefficients: Param[Matrix]
upperBoundsOnCoefficients: Param[Matrix]
lowerBoundsOnIntercepts: Param[Vector]
upperBoundsOnIntercepts: Param[Vector]
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> None: ...
def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> LogisticRegression: ...
def setThreshold(self, value: float) -> LogisticRegression: ...
def setThreshold(self: P, value: float) -> P: ...
def getThreshold(self) -> float: ...
def setThresholds(self, value: List[float]) -> LogisticRegression: ...
def setThresholds(self: P, value: List[float]) -> P: ...
def getThresholds(self) -> List[float]: ...
def setFamily(self, value: str) -> LogisticRegression: ...
def getFamily(self) -> str: ...
def setLowerBoundsOnCoefficients(self, value: Matrix) -> LogisticRegression: ...
def getLowerBoundsOnCoefficients(self) -> Matrix : ...
def setUpperBoundsOnCoefficients(self, value: Matrix) -> LogisticRegression: ...
def getUpperBoundsOnCoefficients(self) -> Matrix: ...
def setLowerBoundsOnIntercepts(self, value: Vector) -> LogisticRegression: ...
def getLowerBoundsOnIntercepts(self) -> Vector: ...
def setUpperBoundsOnIntercepts(self, value: Vector) -> LogisticRegression: ...
def getUpperBoundsOnIntercepts(self) -> Vector: ...

class LogisticRegressionModel(JavaProbabilisticClassificationModel[Vector], JavaMLWritable, JavaMLReadable[LogisticRegressionModel], HasTrainingSummary[LogisticRegressionTrainingSummary]):
class LogisticRegression(JavaProbabilisticClassifier[LogisticRegressionModel], _LogisticRegressionParams, JavaMLWritable, JavaMLReadable[LogisticRegression]):
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> None: ...
def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> LogisticRegression: ...
def setFamily(self, value: str) -> LogisticRegression: ...
def setLowerBoundsOnCoefficients(self, value: Matrix) -> LogisticRegression: ...
def setUpperBoundsOnCoefficients(self, value: Matrix) -> LogisticRegression: ...
def setLowerBoundsOnIntercepts(self, value: Vector) -> LogisticRegression: ...
def setUpperBoundsOnIntercepts(self, value: Vector) -> LogisticRegression: ...

class LogisticRegressionModel(JavaProbabilisticClassificationModel[Vector], _LogisticRegressionParams, JavaMLWritable, JavaMLReadable[LogisticRegressionModel], HasTrainingSummary[LogisticRegressionTrainingSummary]):
@property
def coefficients(self) -> Vector: ...
@property
Expand Down Expand Up @@ -178,12 +183,12 @@ class RandomForestClassificationModel(_TreeEnsembleModel, JavaProbabilisticClass
@property
def trees(self) -> List[DecisionTreeClassificationModel]: ...

class GBTClassifierParams(_GBTParams, _HasVarianceImpurity):
class _GBTClassifierParams(_GBTParams, _HasVarianceImpurity):
supportedLossTypes: List[str]
lossType: Param[str]
def getLossType(self) -> str: ...

class GBTClassifier(JavaProbabilisticClassifier[GBTClassificationModel], GBTClassifierParams, JavaMLWritable, JavaMLReadable[GBTClassifier]):
class GBTClassifier(JavaProbabilisticClassifier[GBTClassificationModel], _GBTClassifierParams, JavaMLWritable, JavaMLReadable[GBTClassifier]):
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxDepth: int = ..., maxBins: int = ..., minInstancesPerNode: int = ..., minInfoGain: float = ..., maxMemoryInMB: int = ..., cacheNodeIds: bool = ..., checkpointInterval: int = ..., lossType: str = ..., maxIter: int = ..., stepSize: float = ..., seed: Optional[int] = ..., subsamplingRate: float = ..., featureSubsetStrategy: str = ..., validationTol: float = ..., validationIndicatorCol: Optional[str] = ..., leafCol: str = ..., minWeightFractionPerNode: float = ...) -> None: ...
def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxDepth: int = ..., maxBins: int = ..., minInstancesPerNode: int = ..., minInfoGain: float = ..., maxMemoryInMB: int = ..., cacheNodeIds: bool = ..., checkpointInterval: int = ..., lossType: str = ..., maxIter: int = ..., stepSize: float = ..., seed: Optional[int] = ..., subsamplingRate: float = ..., featureSubsetStrategy: str = ..., validationTol: float = ..., validationIndicatorCol: Optional[str] = ..., leafCol: str = ..., minWeightFractionPerNode: float = ...) -> GBTClassifier: ...
def setMaxDepth(self, value: int) -> GBTClassifier: ...
Expand All @@ -198,62 +203,66 @@ class GBTClassifier(JavaProbabilisticClassifier[GBTClassificationModel], GBTClas
def setFeatureSubsetStrategy(self, value: str) -> GBTClassifier: ...
def setValidationIndicatorCol(self, value: str) -> GBTClassifier: ...

class GBTClassificationModel(_TreeEnsembleModel, JavaProbabilisticClassificationModel[Vector], GBTClassifierParams, JavaMLWritable, JavaMLReadable[GBTClassificationModel]):
class GBTClassificationModel(_TreeEnsembleModel, JavaProbabilisticClassificationModel[Vector], _GBTClassifierParams, JavaMLWritable, JavaMLReadable[GBTClassificationModel]):
@property
def featureImportances(self) -> Vector: ...
@property
def trees(self) -> List[DecisionTreeRegressionModel]: ...
def evaluateEachIteration(self, dataset: DataFrame) -> List[float]: ...

class NaiveBayes(JavaProbabilisticClassifier[NaiveBayesModel], HasThresholds, HasWeightCol, JavaMLWritable, JavaMLReadable[NaiveBayes]):
class _NaiveBayesParams(_JavaPredictorParams, HasWeightCol):
smoothing: Param[float]
modelType: Param[str]
def getSmoothing(self) -> float: ...
def getModelType(self) -> str: ...

class NaiveBayes(JavaProbabilisticClassifier[NaiveBayesModel], _NaiveBayesParams, HasThresholds, HasWeightCol, JavaMLWritable, JavaMLReadable[NaiveBayes]):
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., smoothing: float = ..., modelType: str = ..., thresholds: Optional[List[float]] = ..., weightCol: Optional[str] = ...) -> None: ...
def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., smoothing: float = ..., modelType: str = ..., thresholds: Optional[List[float]] = ..., weightCol: Optional[str] = ...) -> NaiveBayes: ...
def setSmoothing(self, value: float) -> NaiveBayes: ...
def getSmoothing(self) -> float: ...
def setModelType(self, value: str) -> NaiveBayes: ...
def getModelType(self) -> str: ...

class NaiveBayesModel(JavaProbabilisticClassificationModel[Vector], JavaMLWritable, JavaMLReadable[NaiveBayesModel]):
class NaiveBayesModel(JavaProbabilisticClassificationModel[Vector], _NaiveBayesParams, JavaMLWritable, JavaMLReadable[NaiveBayesModel]):
@property
def pi(self) -> Vector: ...
@property
def theta(self) -> Matrix: ...

class MultilayerPerceptronClassifier(JavaProbabilisticClassifier[MultilayerPerceptronClassificationModel], HasMaxIter, HasTol, HasSeed, HasStepSize, HasSolver, JavaMLWritable, JavaMLReadable[MultilayerPerceptronClassifier]):
class _MultilayerPerceptronParams(_JavaProbabilisticClassifierParams, HasSeed, HasMaxIter, HasTol, HasStepSize, HasSolver):
layers: Param[List[int]]
blockSize: Param[int]
solver: Param[str]
initialWeights: Param[Vector]
def getLayers(self) -> List[int]: ...
def getBlockSize(self) -> int: ...
def getStepSize(self) -> float: ...
def getInitialWeights(self) -> Vector: ...

class MultilayerPerceptronClassifier(JavaProbabilisticClassifier[MultilayerPerceptronClassificationModel], _MultilayerPerceptronParams, JavaMLWritable, JavaMLReadable[MultilayerPerceptronClassifier]):
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., tol: float = ..., seed: Optional[int] = ..., layers: Optional[List[int]] = ..., blockSize: int = ..., stepSize: float = ..., solver: str = ..., initialWeights: Optional[Vector] = ..., probabilityCol: str = ..., rawPredictionCol: str = ...) -> None: ...
def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., tol: float = ..., seed: Optional[int] = ..., layers: Optional[List[int]] = ..., blockSize: int = ..., stepSize: float = ..., solver: str = ..., initialWeights: Optional[Vector] = ..., probabilityCol: str = ..., rawPredictionCol: str = ...) -> MultilayerPerceptronClassifier: ...
def setLayers(self, value: List[int]) -> MultilayerPerceptronClassifier: ...
def getLayers(self) -> List[int]: ...
def setBlockSize(self, value: int) -> MultilayerPerceptronClassifier: ...
def getBlockSize(self) -> int: ...
def setStepSize(self, value: float) -> MultilayerPerceptronClassifier: ...
def getStepSize(self) -> float: ...
def setInitialWeights(self, value: Vector) -> MultilayerPerceptronClassifier: ...
def getInitialWeights(self) -> Vector: ...

class MultilayerPerceptronClassificationModel(JavaProbabilisticClassificationModel[Vector], JavaMLWritable, JavaMLReadable[MultilayerPerceptronClassificationModel]):
@property
def layers(self) -> List[int]: ...
@property
def weights(self) -> Vector: ...

class OneVsRestParams(JavaClassifierParams, HasWeightCol):
class _OneVsRestParams(_JavaClassifierParams, HasWeightCol):
classifier: Param[Estimator]
def getClassifier(self) -> Estimator[M]: ...

class OneVsRest(Estimator[OneVsRestModel], OneVsRestParams, HasParallelism, JavaMLReadable[OneVsRest], JavaMLWritable):
class OneVsRest(Estimator[OneVsRestModel], _OneVsRestParams, HasParallelism, JavaMLReadable[OneVsRest], JavaMLWritable):
def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., rawPredictionCol: str = ..., classifier: Optional[Estimator[M]] = ..., weightCol: Optional[str] = ..., parallelism: int = ...) -> None: ...
def setParams(self, *, featuresCol: Optional[str] = ..., labelCol: Optional[str] = ..., predictionCol: Optional[str] = ..., rawPredictionCol: str = ..., classifier: Optional[Estimator[M]] = ..., weightCol: Optional[str] = ..., parallelism: int = ...) -> OneVsRest: ...
def setClassifier(self, value: Estimator[M]) -> OneVsRest: ...
def copy(self, extra: Optional[ParamMap] = ...) -> OneVsRest: ...

class OneVsRestModel(Model, OneVsRestParams, JavaMLReadable[OneVsRestModel], JavaMLWritable):
class OneVsRestModel(Model, _OneVsRestParams, JavaMLReadable[OneVsRestModel], JavaMLWritable):
models: List[Transformer]
def __init__(self, models: List[Transformer]) -> None: ...
def setClassifier(self, value: Estimator[M]) -> OneVsRest: ...
Expand Down
Loading