コード例 #1
0
    Float(
        key="baggingTemperature",
        default=1,
        help="Defines the settings of the Bayesian bootstrap. ",
    )
)
@dc.param(
    String(
        key="evalMetric",
        default="MAE",
        help="""The metric used for overfitting detection and best model selection.
                MAE,MAPE,RMSE,Poisson,SMAPE,R2,MSLE,MedianAbsoluteError""",
    )
)
@dc.param(Bool(key="needTrain", default=True))
@dc.output(SklearnModel(key="outputModel"))
def SPCatBoostRegressor(context):
    # 从 Context 中获取相关数据
    args = context.args
    # 查看上一节点发送的 args.inputData1 数据

    df = args.inputData

    featureColumns = args.featureColumns
    labelColumn = args.labelColumn

    features = df[featureColumns].values if len(featureColumns)>0 else df.values
    label = df[labelColumn].values

    iterations = args.iterations
    learningRate = args.learningRate
コード例 #2
0
from suanpan.docker.arguments import Csv, String, Bool, ListOfString
import pandas as pd
import numpy as np
from statsmodels.tsa.ar_model import ARResultsWrapper
from statsmodels.tsa.statespace.sarimax import SARIMAXResultsWrapper
from statsmodels.tsa.arima_model import ARMAResultsWrapper, ARIMAResultsWrapper
from statsmodels.regression.linear_model import RegressionResultsWrapper
from statsmodels.discrete.discrete_model import (
    BinaryResultsWrapper,
    MultinomialResultsWrapper,
)
from arguments import SklearnModel


@dc.input(Csv(key="inputData"))
@dc.input(SklearnModel(key="inputModel"))
@dc.column(ListOfString(key="featureColumns", default=["a", "b", "c", "d"]))
@dc.column(String(key="predictColumn", default="prediction"))
@dc.param(String(key="start", default="2000-11-30"))
@dc.param(String(key="end", default="2001-05-31"))
@dc.param(Bool(key="dynamic", default=True))
@dc.output(Csv(key="outputData"))
def SPStatsPredict(context):
    args = context.args

    model = args.inputModel
    if isinstance(
            model,
        (
            ARResultsWrapper,
            ARMAResultsWrapper,