def compute_corr_mse_accel_gyro(self, exclude_col_names: list=[], accel_column_names: list=['accelerometer_x', 'accelerometer_y', 'accelerometer_z'], gyro_column_names: list=['gyroscope_y', 'gyroscope_x', 'gyroscope_z'], windowDuration: int=None, slideDuration: int=None, groupByColumnName: List[str]=[], startTime=None):
    '\n    Compute correlation and mean standard error of accel and gyro sensors\n\n    Args:\n        exclude_col_names list(str): name of the columns on which features should not be computed\n        accel_column_names list(str): name of accel data column\n        gyro_column_names list(str): name of gyro data column\n        windowDuration (int): duration of a window in seconds\n        slideDuration (int): slide duration of a window\n        groupByColumnName List[str]: groupby column names, for example, groupby user, col1, col2\n        startTime (datetime): The startTime is the offset with respect to 1970-01-01 00:00:00 UTC with which to start window intervals. For example, in order to have hourly tumbling windows that start 15 minutes past the hour, e.g. 12:15-13:15, 13:15-14:15... provide startTime as 15 minutes. First time of data will be used as startTime if none is provided\n\n\n    Returns:\n        DataStream object with all the existing data columns and FFT features\n    '
    feature_names = ['ax_ay_corr', 'ax_az_corr', 'ay_az_corr', 'gx_gy_corr', 'gx_gz_corr', 'gy_gz_corr', 'ax_ay_mse', 'ax_az_mse', 'ay_az_mse', 'gx_gy_mse', 'gx_gz_mse', 'gy_gz_mse']
    exclude_col_names.extend(['timestamp', 'localtime', 'user', 'version'])
    data = self._data.drop(*exclude_col_names)
    basic_schema = StructType([StructField('timestamp', TimestampType()), StructField('localtime', TimestampType()), StructField('user', StringType()), StructField('version', IntegerType()), StructField('start_time', TimestampType()), StructField('end_time', TimestampType())])
    features_list = []
    for fn in feature_names:
        features_list.append(StructField(fn, FloatType(), True))
    features_schema = StructType((basic_schema.fields + features_list))

    @pandas_udf(features_schema, PandasUDFType.GROUPED_MAP)
    def get_corr_mse_features_udf(df):
        timestamp = df['timestamp'].iloc[0]
        localtime = df['localtime'].iloc[0]
        user = df['user'].iloc[0]
        version = df['version'].iloc[0]
        start_time = timestamp
        end_time = df['timestamp'].iloc[(- 1)]
        ax_ay_corr = df[accel_column_names[0]].corr(df[accel_column_names[1]])
        ax_az_corr = df[accel_column_names[0]].corr(df[accel_column_names[2]])
        ay_az_corr = df[accel_column_names[1]].corr(df[accel_column_names[2]])
        gx_gy_corr = df[gyro_column_names[0]].corr(df[gyro_column_names[1]])
        gx_gz_corr = df[gyro_column_names[0]].corr(df[gyro_column_names[2]])
        gy_gz_corr = df[gyro_column_names[1]].corr(df[gyro_column_names[2]])
        ax_ay_mse = ((df[accel_column_names[0]] - df[accel_column_names[1]]) ** 2).mean()
        ax_az_mse = ((df[accel_column_names[0]] - df[accel_column_names[2]]) ** 2).mean()
        ay_az_mse = ((df[accel_column_names[1]] - df[accel_column_names[2]]) ** 2).mean()
        gx_gy_mse = ((df[accel_column_names[0]] - df[accel_column_names[1]]) ** 2).mean()
        gx_gz_mse = ((df[accel_column_names[0]] - df[accel_column_names[2]]) ** 2).mean()
        gy_gz_mse = ((df[accel_column_names[1]] - df[accel_column_names[2]]) ** 2).mean()
        basic_df = pd.DataFrame([[timestamp, localtime, user, int(version), start_time, end_time, ax_ay_corr, ax_az_corr, ay_az_corr, gx_gy_corr, gx_gz_corr, gy_gz_corr, ax_ay_mse, ax_az_mse, ay_az_mse, gx_gy_mse, gx_gz_mse, gy_gz_mse]], columns=['timestamp', 'localtime', 'user', 'version', 'start_time', 'end_time', 'ax_ay_corr', 'ax_az_corr', 'ay_az_corr', 'gx_gy_corr', 'gx_gz_corr', 'gy_gz_corr', 'ax_ay_mse', 'ax_az_mse', 'ay_az_mse', 'gx_gy_mse', 'gx_gz_mse', 'gy_gz_mse'])
        return basic_df
    data = self.compute(get_corr_mse_features_udf, windowDuration=windowDuration, slideDuration=slideDuration, groupByColumnName=groupByColumnName, startTime=startTime)
    return DataStream(data=data._data, metadata=Metadata())
Compute correlation and mean standard error of accel and gyro sensors

Args:
    exclude_col_names list(str): name of the columns on which features should not be computed
    accel_column_names list(str): name of accel data column
    gyro_column_names list(str): name of gyro data column
    windowDuration (int): duration of a window in seconds
    slideDuration (int): slide duration of a window
    groupByColumnName List[str]: groupby column names, for example, groupby user, col1, col2
    startTime (datetime): The startTime is the offset with respect to 1970-01-01 00:00:00 UTC with which to start window intervals. For example, in order to have hourly tumbling windows that start 15 minutes past the hour, e.g. 12:15-13:15, 13:15-14:15... provide startTime as 15 minutes. First time of data will be used as startTime if none is provided


Returns:
    DataStream object with all the existing data columns and FFT features
def compute_corr_mse_accel_gyro(self, exclude_col_names: list=[], accel_column_names: list=['accelerometer_x', 'accelerometer_y', 'accelerometer_z'], gyro_column_names: list=['gyroscope_y', 'gyroscope_x', 'gyroscope_z'], windowDuration: int=None, slideDuration: int=None, groupByColumnName: List[str]=[], startTime=None):
    '\n    Compute correlation and mean standard error of accel and gyro sensors\n\n    Args:\n        exclude_col_names list(str): name of the columns on which features should not be computed\n        accel_column_names list(str): name of accel data column\n        gyro_column_names list(str): name of gyro data column\n        windowDuration (int): duration of a window in seconds\n        slideDuration (int): slide duration of a window\n        groupByColumnName List[str]: groupby column names, for example, groupby user, col1, col2\n        startTime (datetime): The startTime is the offset with respect to 1970-01-01 00:00:00 UTC with which to start window intervals. For example, in order to have hourly tumbling windows that start 15 minutes past the hour, e.g. 12:15-13:15, 13:15-14:15... provide startTime as 15 minutes. First time of data will be used as startTime if none is provided\n\n\n    Returns:\n        DataStream object with all the existing data columns and FFT features\n    '
    feature_names = ['ax_ay_corr', 'ax_az_corr', 'ay_az_corr', 'gx_gy_corr', 'gx_gz_corr', 'gy_gz_corr', 'ax_ay_mse', 'ax_az_mse', 'ay_az_mse', 'gx_gy_mse', 'gx_gz_mse', 'gy_gz_mse']
    exclude_col_names.extend(['timestamp', 'localtime', 'user', 'version'])
    data = self._data.drop(*exclude_col_names)
    basic_schema = StructType([StructField('timestamp', TimestampType()), StructField('localtime', TimestampType()), StructField('user', StringType()), StructField('version', IntegerType()), StructField('start_time', TimestampType()), StructField('end_time', TimestampType())])
    features_list = []
    for fn in feature_names:
        features_list.append(StructField(fn, FloatType(), True))
    features_schema = StructType((basic_schema.fields + features_list))

    @pandas_udf(features_schema, PandasUDFType.GROUPED_MAP)
    def get_corr_mse_features_udf(df):
        timestamp = df['timestamp'].iloc[0]
        localtime = df['localtime'].iloc[0]
        user = df['user'].iloc[0]
        version = df['version'].iloc[0]
        start_time = timestamp
        end_time = df['timestamp'].iloc[(- 1)]
        ax_ay_corr = df[accel_column_names[0]].corr(df[accel_column_names[1]])
        ax_az_corr = df[accel_column_names[0]].corr(df[accel_column_names[2]])
        ay_az_corr = df[accel_column_names[1]].corr(df[accel_column_names[2]])
        gx_gy_corr = df[gyro_column_names[0]].corr(df[gyro_column_names[1]])
        gx_gz_corr = df[gyro_column_names[0]].corr(df[gyro_column_names[2]])
        gy_gz_corr = df[gyro_column_names[1]].corr(df[gyro_column_names[2]])
        ax_ay_mse = ((df[accel_column_names[0]] - df[accel_column_names[1]]) ** 2).mean()
        ax_az_mse = ((df[accel_column_names[0]] - df[accel_column_names[2]]) ** 2).mean()
        ay_az_mse = ((df[accel_column_names[1]] - df[accel_column_names[2]]) ** 2).mean()
        gx_gy_mse = ((df[accel_column_names[0]] - df[accel_column_names[1]]) ** 2).mean()
        gx_gz_mse = ((df[accel_column_names[0]] - df[accel_column_names[2]]) ** 2).mean()
        gy_gz_mse = ((df[accel_column_names[1]] - df[accel_column_names[2]]) ** 2).mean()
        basic_df = pd.DataFrame([[timestamp, localtime, user, int(version), start_time, end_time, ax_ay_corr, ax_az_corr, ay_az_corr, gx_gy_corr, gx_gz_corr, gy_gz_corr, ax_ay_mse, ax_az_mse, ay_az_mse, gx_gy_mse, gx_gz_mse, gy_gz_mse]], columns=['timestamp', 'localtime', 'user', 'version', 'start_time', 'end_time', 'ax_ay_corr', 'ax_az_corr', 'ay_az_corr', 'gx_gy_corr', 'gx_gz_corr', 'gy_gz_corr', 'ax_ay_mse', 'ax_az_mse', 'ay_az_mse', 'gx_gy_mse', 'gx_gz_mse', 'gy_gz_mse'])
        return basic_df
    data = self.compute(get_corr_mse_features_udf, windowDuration=windowDuration, slideDuration=slideDuration, groupByColumnName=groupByColumnName, startTime=startTime)
    return DataStream(data=data._data, metadata=Metadata())