@FXML
    private void calculateGN(ActionEvent e) {
        try {
            Scanner sLine = new Scanner(input.getText());
            String line = null;
            dataset = new LinkedList<>();
            while (sLine.hasNextLine()) {
                line = sLine.nextLine();
                Scanner scanner = new Scanner(line);
                scanner.useDelimiter(" |,");
                if (scanner.hasNextDouble()) {
                    dataset.add(new Point(scanner.nextDouble(), scanner.nextDouble()));
                }
            }
            Function rf;
            switch (eqChoiceBox.getSelectionModel().getSelectedIndex()) {
                case 0:
                    rf = new QuadraticFunction();
                    break;
                case 1:
                    rf = new ExponentialFunction();
                    break;
                case 2:
                    rf = new LogarithmicFunction();
                    break;
                case 3:
                    rf = new RationalFunction();
                    break;
                default:
                    rf = new QuadraticFunction();
            }
            Vector beta = new Vector(Double.parseDouble(a.getText()), Double.parseDouble(b.getText()), Double.parseDouble(c.getText()));
            GaussNewton gn = new GaussNewton();
            gn.setUp(dataset, rf, beta, Integer.parseInt(numIterations.getText()));

            beta = gn.getBeta();
            output.setText(String.format("a = %.3f; b = %.3f; c = %.3f", beta.get(1), beta.get(2), beta.get(3)));
        } catch (Exception ex) {
            output.setText("INVALID INPUT");
        }
    }