From 34b8d803c3362388d4fe5d12a72e44c821070272 Mon Sep 17 00:00:00 2001 From: zero323 Date: Sat, 11 Jan 2020 15:59:17 +0100 Subject: [PATCH 1/4] Update ml.wrapper --- third_party/3/pyspark/ml/classification.pyi | 4 ++-- third_party/3/pyspark/ml/wrapper.pyi | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/third_party/3/pyspark/ml/classification.pyi b/third_party/3/pyspark/ml/classification.pyi index 27c8bd12..682da951 100644 --- a/third_party/3/pyspark/ml/classification.pyi +++ b/third_party/3/pyspark/ml/classification.pyi @@ -10,10 +10,10 @@ 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): def setRawPredictionCol(self: P, value: str) -> P: ... diff --git a/third_party/3/pyspark/ml/wrapper.pyi b/third_party/3/pyspark/ml/wrapper.pyi index 0576ad1f..cef998ba 100644 --- a/third_party/3/pyspark/ml/wrapper.pyi +++ b/third_party/3/pyspark/ml/wrapper.pyi @@ -28,14 +28,14 @@ class JavaModel(JavaTransformer, Model): __metaclass__: Type[abc.ABCMeta] = ... def __init__(self, java_model: Optional[Any] = ...) -> None: ... -class JavaPredictorParams(HasLabelCol, HasFeaturesCol, HasPredictionCol): ... +class _JavaPredictorParams(HasLabelCol, HasFeaturesCol, HasPredictionCol): ... -class JavaPredictor(JavaEstimator[JM], JavaPredictorParams, metaclass=abc.ABCMeta): +class JavaPredictor(JavaEstimator[JM], _JavaPredictorParams, metaclass=abc.ABCMeta): def setLabelCol(self: P, value: str) -> P: ... def setFeaturesCol(self: P, value: str) -> P: ... def setPredictionCol(self: P, value: str) -> P: ... -class JavaPredictionModel(Generic[T], JavaModel, JavaPredictorParams): +class JavaPredictionModel(Generic[T], JavaModel, _JavaPredictorParams): def setFeaturesCol(self: P, value: str) -> P: ... def setPredictionCol(self: P, value: str) -> P: ... @property From 191132856ad123a59a17ed01d117d3a2ecd51b58 Mon Sep 17 00:00:00 2001 From: zero323 Date: Sat, 11 Jan 2020 16:04:31 +0100 Subject: [PATCH 2/4] Update ml.classification --- third_party/3/pyspark/ml/classification.pyi | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/third_party/3/pyspark/ml/classification.pyi b/third_party/3/pyspark/ml/classification.pyi index 682da951..a91fe15f 100644 --- a/third_party/3/pyspark/ml/classification.pyi +++ b/third_party/3/pyspark/ml/classification.pyi @@ -13,23 +13,23 @@ from pyspark.ml.util import * 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: ... @@ -178,12 +178,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: ... @@ -198,7 +198,7 @@ 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 @@ -243,17 +243,17 @@ class MultilayerPerceptronClassificationModel(JavaProbabilisticClassificationMod @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: ... From 5b2ea56cd0de6c09ca625466ac3e6719e9481f57 Mon Sep 17 00:00:00 2001 From: zero323 Date: Sat, 11 Jan 2020 16:43:46 +0100 Subject: [PATCH 3/4] Update ml.classification, follow-up --- third_party/3/pyspark/ml/classification.pyi | 53 ++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/third_party/3/pyspark/ml/classification.pyi b/third_party/3/pyspark/ml/classification.pyi index a91fe15f..8bfef4f4 100644 --- a/third_party/3/pyspark/ml/classification.pyi +++ b/third_party/3/pyspark/ml/classification.pyi @@ -33,41 +33,46 @@ class JavaProbabilisticClassificationModel(JavaClassificationModel[T], _JavaProb 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 @@ -205,37 +210,41 @@ class GBTClassificationModel(_TreeEnsembleModel, JavaProbabilisticClassification 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 From 1cff875fe0cf90c7df2c53507656752dbfa07dbf Mon Sep 17 00:00:00 2001 From: zero323 Date: Sat, 11 Jan 2020 16:52:03 +0100 Subject: [PATCH 4/4] Update ml.regression annotations, follow-up --- third_party/3/pyspark/ml/regression.pyi | 41 +++++++++++++++---------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/third_party/3/pyspark/ml/regression.pyi b/third_party/3/pyspark/ml/regression.pyi index 603478a5..e6e6d792 100644 --- a/third_party/3/pyspark/ml/regression.pyi +++ b/third_party/3/pyspark/ml/regression.pyi @@ -7,14 +7,21 @@ from pyspark.ml.param.shared import * from pyspark.ml.linalg import Vector from pyspark.ml.util import * from pyspark.ml.tree import _DecisionTreeModel, _DecisionTreeParams, _TreeEnsembleModel, _TreeEnsembleParams, _RandomForestParams, _GBTParams, _HasVarianceImpurity, _TreeRegressorParams -from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaPredictionModel, JavaPredictor, JavaWrapper +from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaPredictionModel, JavaPredictor, _JavaPredictorParams, JavaWrapper from pyspark.sql.dataframe import DataFrame -class LinearRegression(JavaPredictor[LinearRegressionModel], HasMaxIter, HasRegParam, HasTol, HasElasticNetParam, HasFitIntercept, HasStandardization, HasSolver, HasWeightCol, HasAggregationDepth, HasLoss, JavaMLWritable, JavaMLReadable[LinearRegression]): - def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., standardization: bool = ..., solver: str = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> None: ... - def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., standardization: bool = ..., solver: str = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> LinearRegression: ... +class _LinearRegressionParams(_JavaPredictorParams, HasRegParam, HasElasticNetParam, HasMaxIter, HasTol, HasFitIntercept, HasStandardization, HasWeightCol, HasSolver, HasAggregationDepth, HasLoss): + solver: Param[str] + loss: Param[str] + epsilon: Param[float] + def getEpsilon(self) -> float: ... + +class LinearRegression(JavaPredictor[LinearRegressionModel], _LinearRegressionParams, JavaMLWritable, JavaMLReadable[LinearRegression]): + def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., standardization: bool = ..., solver: str = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., epsilon: float = ...) -> None: ... + def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., standardization: bool = ..., solver: str = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., epsilon: float = ...) -> LinearRegression: ... + def setEpsilon(self, value) -> LinearRegression: ... -class LinearRegressionModel(JavaPredictionModel[Vector], GeneralJavaMLWritable, JavaMLReadable[LinearRegressionModel], HasTrainingSummary[LinearRegressionSummary]): +class LinearRegressionModel(JavaPredictionModel[Vector], _LinearRegressionParams, GeneralJavaMLWritable, JavaMLReadable[LinearRegressionModel], HasTrainingSummary[LinearRegressionSummary]): @property def coefficients(self) -> Vector: ... @property @@ -65,19 +72,19 @@ class LinearRegressionTrainingSummary(LinearRegressionSummary): @property def totalIterations(self) -> int: ... -class _IsotonicRegressionBase(HasFeaturesCol, HasLabelCol, HasPredictionCol, HasWeightCol): +class _IsotonicRegressionParams(HasFeaturesCol, HasLabelCol, HasPredictionCol, HasWeightCol): isotonic: Param[bool] featureIndex: Param[int] def getIsotonic(self) -> bool: ... def getFeatureIndex(self) -> int: ... -class IsotonicRegression(JavaEstimator[IsotonicRegressionModel], _IsotonicRegressionBase, HasWeightCol, JavaMLWritable, JavaMLReadable[IsotonicRegression]): +class IsotonicRegression(JavaEstimator[IsotonicRegressionModel], _IsotonicRegressionParams, HasWeightCol, JavaMLWritable, JavaMLReadable[IsotonicRegression]): def __init__(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., weightCol: Optional[str] = ..., isotonic: bool = ..., featureIndex: int = ...) -> None: ... def setParams(self, *, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., weightCol: Optional[str] = ..., isotonic: bool = ..., featureIndex: int = ...) -> IsotonicRegression: ... def setIsotonic(self, value: bool) -> IsotonicRegression: ... def setFeatureIndex(self, value: int) -> IsotonicRegression: ... -class IsotonicRegressionModel(JavaModel, _IsotonicRegressionBase, JavaMLWritable, JavaMLReadable[IsotonicRegressionModel]): +class IsotonicRegressionModel(JavaModel, _IsotonicRegressionParams, JavaMLWritable, JavaMLReadable[IsotonicRegressionModel]): @property def boundaries(self) -> Vector: ... @property @@ -166,7 +173,7 @@ class AFTSurvivalRegressionModel(JavaModel, _AFTSurvivalRegressionParams, JavaML def predictQuantiles(self, features: Vector) -> Vector: ... def predict(self, features: Vector) -> float: ... -class GeneralizedLinearRegression(JavaPredictor[GeneralizedLinearRegressionModel], HasFitIntercept, HasMaxIter, HasTol, HasRegParam, HasWeightCol, HasSolver, JavaMLWritable, JavaMLReadable[GeneralizedLinearRegression]): +class _GeneralizedLinearRegressionParams(_JavaPredictorParams, HasFitIntercept, HasMaxIter, HasTol, HasRegParam, HasWeightCol, HasSolver): family: Param[str] link: Param[str] linkPredictionCol: Param[str] @@ -174,22 +181,24 @@ class GeneralizedLinearRegression(JavaPredictor[GeneralizedLinearRegressionModel linkPower: Param[float] solver: Param[str] offsetCol: Param[str] + def getFamily(self) -> str: ... + def getLinkPredictionCol(self) -> str: ... + def getLink(self) -> str: ... + def getVariancePower(self) -> float: ... + def getLinkPower(self) -> float: ... + def getOffsetCol(self) -> str: ... + +class GeneralizedLinearRegression(JavaPredictor[GeneralizedLinearRegressionModel], _GeneralizedLinearRegressionParams, JavaMLWritable, JavaMLReadable[GeneralizedLinearRegression]): def __init__(self, *, labelCol: str = ..., featuresCol: str = ..., predictionCol: str = ..., family: str = ..., link: Optional[str] = ..., fitIntercept: bool = ..., maxIter: int = ..., tol: float = ..., regParam: float = ..., weightCol: Optional[str] = ..., solver: str = ..., linkPredictionCol: Optional[str] = ..., variancePower: float = ..., linkPower: Optional[float] = ..., offsetCol: Optional[str] = ...) -> None: ... def setParams(self, *, labelCol: str = ..., featuresCol: str = ..., predictionCol: str = ..., family: str = ..., link: Optional[str] = ..., fitIntercept: bool = ..., maxIter: int = ..., tol: float = ..., regParam: float = ..., weightCol: Optional[str] = ..., solver: str = ..., linkPredictionCol: Optional[str] = ..., variancePower: float = ..., linkPower: Optional[float] = ..., offsetCol: Optional[str] = ...) -> GeneralizedLinearRegression: ... def setFamily(self, value: str) -> GeneralizedLinearRegression: ... - def getFamily(self) -> str: ... def setLinkPredictionCol(self, value: str) -> GeneralizedLinearRegression: ... - def getLinkPredictionCol(self) -> str: ... def setLink(self, value: str) -> GeneralizedLinearRegression: ... - def getLink(self) -> str: ... def setVariancePower(self, value: float) -> GeneralizedLinearRegression: ... - def getVariancePower(self) -> float: ... def setLinkPower(self, value: float) -> GeneralizedLinearRegression: ... - def getLinkPower(self) -> float: ... def setOffsetCol(self, value: str) -> GeneralizedLinearRegression: ... - def getOffsetCol(self) -> str: ... -class GeneralizedLinearRegressionModel(JavaPredictionModel[Vector], JavaMLWritable, JavaMLReadable[GeneralizedLinearRegressionModel], HasTrainingSummary[GeneralizedLinearRegressionTrainingSummary]): +class GeneralizedLinearRegressionModel(JavaPredictionModel[Vector], _GeneralizedLinearRegressionParams, JavaMLWritable, JavaMLReadable[GeneralizedLinearRegressionModel], HasTrainingSummary[GeneralizedLinearRegressionTrainingSummary]): @property def coefficients(self) -> Vector: ... @property