, where rows are samples and columns are features.
Procedure
Predict the means for axis=0 and axis=1, then check with NumPy.
Select the first two rows, the last column, and elements that are 4 or greater, respectively.
Results to retain
A table with at least 5 rows of aggregation and selection results.
Items to record and points to check
Operations
Expected shape
Actual shape
Result
Points to check
Did you avoid swapping the meanings of rows and features?
2. Features with Different Scales
Starting conditions
Create data with only the last column multiplied by 100, and compare column-wise means and standard deviations before and after standardization.
Procedure
Preserve X and multiply only the last column of a copy, X2, by 100. Record each column's mean and standard deviation before and after the change.
Subtract each column's mean from that column of X2, and divide by its standard deviation. Use ddof=0, matching NumPy's default.
Record each column's means and standard deviations before and after Standardization side by side. Use both statistics to explain whether the column multiplied by 100 is now on the same scale as the other columns.
Results to retain
A table comparing the data and the mean and standard deviation of each column.
Items to record and points to check
Data and column
Means before and after the change
Standard deviations before and after the change
Standardization results
Points to check
Did you use each column's own mean and standard deviation for standardization?
3. Checking Other Inputs
Starting conditions
Add a constant feature column and handle the case where the Standardization denominator is 0.
Procedure
Append one column with the same value in every row to X, and record its value and column position. For example, append a column filled with 1.
Calculate each column's mean and standard deviation, and identify columns whose standard deviation is 0. Add a rule to the code for dividing those columns. For example, set only those denominators to 1.
Record the transformed constant column and np.isfinite(...).all() for the entire result. Explain what changes if you divide by the constant column's unmodified standard deviation.
Results to retain
The rule for handling the constant column, transformed results, and finite-value check.
Items to record and points to check
Constant column position and value
Mean and standard deviation
Rule for handling a denominator of 0
Transformed column and finite-value check
Points to check
Did you record how columns with a standard deviation of 0 were handled and their actual outputs?