This topic describes the One Sample T Test component provided by Machine Learning Studio.

The One Sample T Test component is used to determine whether a significant difference exists between the overall mean of a variable and a specific value. The sample on which you want to perform a T test must follow normal distribution. You can configure the component by using one of the following methods:
  • Machine Learning Platform for AI (PAI) console
    Tab Parameter Description
    Fields Setting Sample 1 Column The column that contains Sample 1.
    Parameters Setting Alternative Hypothesis Type The alternative hypothesis type.
    Confidence Level The confidence level of the test results.
    Hypothesized Mean The hypothesized mean.
    Variances of Two Populations Are Equal Specifies whether the variances of two populations are equal. Valid values: Yes and No.
    Cores The number of cores. The value of this parameter must be a positive integer.
    Memory Size per Core The memory size of each core. Valid values: 1 to 65536. Unit: MB.
  • PAI command
    pai -name t_test -project algo_public
        -DxTableName=pai_t_test_all_type
        -DxColName=col1_double
        -DoutputTableName=pai_t_test_out
        -DxTablePartitions=ds=2010/dt=1
        -Dalternative=less
        -Dmu=47
        -DconfidenceLevel=0.95
    Parameter Required Description Default value
    xTableName Yes The name of the input table. No default value
    xColName Yes The column that you want to select from the input table for testing. No default value
    outputTableName Yes The name of the output table. No default value
    xTablePartitions No The partitions that you want to select from the input table. No default value
    alternative No The alternative hypothesis type. Valid values: two.sided, less, and Greater. two.sided
    mu No The hypothesized mean. 0
    confidenceLevel No The confidence level. Valid values: 0.8, 0.9, 0.95, 0.99, 0.995, and 0.999. 0.95

Output

The output table is in the JSON format and contains only one row and one column.
{
    "AlternativeHypthesis": "mean not equals to 0",
    "ConfidenceInterval": "(44.72234194006504, 46.27765805993496)",
    "ConfidenceLevel": 0.95,
    "alpha": 0.05,
    "df": 99,
    "mean": 45.5,
    "p": 0,
    "stdDeviation": 3.919647479510927,
    "t": 116.081867662439
}