This topic describes the One Sample T Test component provided by Machine Learning Designer. 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 a normal distribution.

Configure the component

You can use one of the following methods to configure the One Sample T Test component:

Method 1: Configure the component in Machine Learning Designer

Configure the component on the pipeline configuration tab of Machine Learning Designer in the Machine Learning Platform for AI console. The following table describes the parameters that are used to configure the component.
TabParameterDescription
Fields SettingSample 1 ColumnThe column that contains Sample 1.
Parameters SettingAlternative Hypothesis TypeThe alternative hypothesis type.
Confidence LevelThe confidence level of the test results.
Hypothesized MeanThe hypothesized mean.
Variances of Two Populations Are EqualSpecifies whether the variances of two populations are equal. Valid values: Yes and No.
Core numberThe number of cores. The value must be a positive integer.
Memory Size per CoreThe memory size of each core. Valid values: 1 to 65536. Unit: MB.

Method 2: Run Machine Learning Platform for AI commands

Configure the component parameters by running a Machine Learning Platform for AI command. You can use the SQL Script component to run Machine Learning Platform for AI commands. For more information, see SQL Script. The following table describes the parameters of the 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
ParameterRequiredDescriptionDefault value
xTableNameYesThe name of the input table.None
xColNameYesThe column that you want to select from the input table for testing.None
outputTableNameYesThe name of the output table.None
xTablePartitionsNoThe partitions that you want to select from the input table.Null
alternativeNoThe alternative hypothesis type. Valid values: two.sided, less, and greater. two.sided
muNoThe hypothesized mean.0
confidenceLevelNoThe confidence level. Valid values: 0.8, 0.9, 0.95, 0.99, 0.995, and 0.999. 0.95

Output description

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
}