A computer-implemented method for controlling a production line, comprising: • sensing values of measurement variables for a plurality of measurement events during an operation of the production line, wherein a value is sensed for each measurement variable at each measurement event of the plurality of measurement events, each measurement variable representing an operation parameter of the production line; • determining a value of a target variable for each measurement event of the plurality of measurement events, wherein the target variable is a continuous variable representing a probability of a part produced in the production line being defective and/or having an anomaly; • determining, for each measurement event, a data point including the sensed values of the measurement variables and the determined value of the target variable by joining the sensed values of the measurement variables and the determined value of the target variable; • performing a principal component analysis or a kernel principal component analysis for the plurality of data points resulting in loading values and principal components of the data points; • determining, for the target variable, one or more principal components for which the absolute value of the loading value is greater than a first predetermined threshold, wherein the first predetermined threshold is set such that the totality of groups for the principal components includes at most a predetermined percentage of the measurement variables; • identifying, for each determined principal component, one or more measurement variables for which the absolute value of the loading value is higher than a second predetermined threshold, wherein the second predetermined threshold is set such that the totality of groups for the principal components includes at most a predetermined percentage of the measurement variables; • grouping the identified measurement variables for each determined principal component into a respective group; and • performing joint control of operation parameters represented by measurement variables grouped into the same group to modify the target variable. • sensing values of measurement variables for a plurality of measurement events during an operation of the production line, wherein a value is sensed for each measurement variable at each measurement event of the plurality of measurement events, each measurement variable representing an operation parameter of the production line; • determining a value of a target variable for each measurement event of the plurality of measurement events, wherein the target variable is a continuous variable representing a probability of a part produced in the production line being defective and/or having an anomaly; • determining, for each measurement event, a data point including the sensed values of the measurement variables and the determined value of the target variable by joining the sensed values of the measurement variables and the determined value of the target variable; • performing a principal component analysis or a kernel principal component analysis for the plurality of data points resulting in loading values and principal components of the data points; • determining, for the target variable, one or more principal components for which the absolute value of the loading value is greater than a first predetermined threshold, wherein the first predetermined threshold is set such that the totality of groups for the principal components includes at most a predetermined percentage of the measurement variables; • identifying, for each determined principal component, one or more measurement variables for which the absolute value of the loading value is higher than a second predetermined threshold, wherein the second predetermined threshold is set such that the totality of groups for the principal components includes at most a predetermined percentage of the measurement variables; • grouping the identified measurement variables for each determined principal component into a respective group; and • performing joint control of operation parameters represented by measurement variables grouped into the same group to modify the target variable.