def METHOD_NAME(pce_object: PolynomialChaosExpansion, target_error=1, check_overfitting=True):
    """
    LARS model selection algorithm for given TargetError of approximation
    measured by Cross validation: Leave-one-out error (1 is perfect approximation). Option to check overfitting by 
    empirical rule: if three steps in a row have a decreasing accuracy, stop the algorithm.
    :param PolynomialChaosExpansion: existing target PCE for model_selection
    :param target_error: Target error of an approximation (stoping criterion).
    :param check_overfitting: Whether to check over-fitting by empirical rule.
    :return: copy of input PolynomialChaosExpansion containing the best possible model for given data identified by LARs  
    """
    pce = copy.deepcopy(pce_object)
    x = pce.experimental_design_input
    y = pce.experimental_design_output
    pce.regression_method = LeastAngleRegression()
    pce.fit(x, y)
    LarsBeta = pce.regression_method.Beta_path
    P, steps = LarsBeta.shape
    polynomialbasis = pce.design_matrix
    multindex = pce.multi_index_set
    pce.regression_method = LeastSquareRegression()
    larsbasis = []
    OLSBetaList = []
    larsindex = []
    LarsError = []
    error = 0
    overfitting = False
    BestLarsError = 0
    step = 0
    if steps<3:
        raise Exception('LAR identified constant function! Check your data.')
    while BestLarsError < target_error and step < steps - 2 and overfitting == False:
        mask = LarsBeta[:, step + 2] != 0
        mask[0] = True
        larsindex.append(multindex[mask, :])
        larsbasis.append(list(np.array(pce_object.polynomial_basis.polynomials)[mask]))
        pce.polynomial_basis.polynomials_number = len(larsbasis[step])
        pce.polynomial_basis.polynomials = larsbasis[step]
        pce.multi_index_set = larsindex[step]
        pce.fit(x, y)
        coefficients = pce.coefficients
        LarsError.append(float(1 - pce.leaveoneout_error()))
        error = LarsError[step]
        if step == 0:
            BestLarsMultindex = larsindex[step]
            BestLarsBasis = larsbasis[step]
            BestLarsError = LarsError[step]
        else:
            if error > BestLarsError:
                BestLarsMultindex = larsindex[step]
                BestLarsBasis = larsbasis[step]
                BestLarsError = LarsError[step]
        if (step > 3) and (check_overfitting == True):
            if (BestLarsError > 0.6) and (error < LarsError[step - 1]) and (error < LarsError[step - 2]) and (
                    error < LarsError[step - 3]):
                overfitting = True
        step += 1
    pce.polynomial_basis.polynomials_number = len(BestLarsBasis)
    pce.polynomial_basis.polynomials = BestLarsBasis
    pce.multi_index_set = BestLarsMultindex
    pce.fit(x, y)
    return pce