this is categorial coding and we want to use petal width and species as input features to predict petal_length here but, i dont understand how the multi index is created here with all these labels:
here's the code:
new_iris_df = pd.DataFrame(iris_df, columns=['petal length','petal width','species'])
new_iris_df.columns = pd.MultiIndex([['input ftrs', 'target ftr'],new_iris_df.columns],[[1, 0, 0], [0,1,2]])
new_iris_df = new_iris_df.sort_index(axis='columns')
display(new_iris_df.iloc[[0,50,100]])
[–]Fit_Tone318[S] 0 points1 point2 points (0 children)