def run_LDA(df):
<EOL>X = df[range(<NUM_LIT:1>, df.shape[<NUM_LIT:1>])].values     <EOL>y = df["<STR_LIT>"].values               <EOL>sklearn_lda = LDA()<EOL>X_lda_sklearn = sklearn_lda.fit_transform(X, y)<EOL>try:<EOL><INDENT>exp_var = sklearn_lda.explained_variance_ratio_<EOL><DEDENT>except AttributeError as ae:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(ae))<EOL>return X_lda_sklearn, y, "<STR_LIT>"<EOL><DEDENT>return X_lda_sklearn, y, exp_var<EOL>
Run LinearDiscriminantAnalysis on input dataframe (df) and return
transformed data, scalings and explained variance by discriminants.