/// <summary> /// Creates a GeneralizedLinearRegression from a <see cref="LogisticRegression"/> object. /// </summary> /// /// <param name="regression">A <see cref="LogisticRegression"/> object.</param> /// <param name="makeCopy">True to make a copy of the logistic regression values, false /// to use the actual values. If the actual values are used, changes done on one model /// will be reflected on the other model.</param> /// /// <returns>A new <see cref="GeneralizedLinearRegression"/> which is a copy of the /// given <see cref="LogisticRegression"/>.</returns> /// public static GeneralizedLinearRegression FromLogisticRegression( LogisticRegression regression, bool makeCopy) { if (makeCopy) { double[] coefficients = (double[])regression.Coefficients.Clone(); double[] standardErrors = (double[])regression.StandardErrors.Clone(); return(new GeneralizedLinearRegression(new LogitLinkFunction(), coefficients, standardErrors)); } else { return(new GeneralizedLinearRegression(new LogitLinkFunction(), regression.Coefficients, regression.StandardErrors)); } }