--- myst: substitutions: macro: python: 1-5,15-24,27-36 cpp: 4-5,11-16,19-27 bloc1: python: 16-17 cpp: 4,11 bloc2: python: "19" cpp: "13" bloc3: python: 31-33 cpp: 23-24 --- # Macro "**modelerCornellLinearRegression.{{extension}}**" ## Objective The objective of the macro is to build a multilinear regression between the predictors related to the normalisation of the variables **x1**, **x2**, **x3**, **x4**, **x5**, **x6**, **x7** and a target variable **y** from the database contained in the ASCII file `cornell.dat`: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/references/cornell.dat" + "\n" + ":language: none\n" + "```" }} ## Macro {{uranie}} {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerCornellLinearRegression." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + macro[language] + "\n" + "```" }} The ASCII data file `cornell.dat` is loaded in the {{tds}}: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerCornellLinearRegression." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} The variables are all normalised with a standardised method. The normalised attributes are created with the *cr* extension: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerCornellLinearRegression." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} The linear regression is initialised and characteristic values are computed for each normalised variable with the `estimate` method. The regression is built with no intercept: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/modeler/use_cases/" + language + "/modelerCornellLinearRegression." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + "```" }} ## Graph {{ "```{figure} " + parent_dir + "/roottest/build/uranie/doc/modeler/use_cases/" + language + "/cornell/modelerCornellLinearRegression.png\n" + ":align: center\n" + ":name: use_cases_modelerCornellLinearRegression\n" + figure_scale + "\n" + "\n" + "Graph of the macro **\"modelerCornellLinearRegression." + extension + "\"**" + "\n" + "```" }}