| eval_poly | R Documentation |
Evaluates one or several polynomials on the given data.
eval_poly(poly, newdata, monomials = FALSE)
poly |
List containing 2 items:
Example: If |
newdata |
Input data as matrix, vector or dataframe. Number of columns (or elements in vector) should be the number of variables in the polynomial (dimension p). Response variable to be predicted should not be included. |
monomials |
Boolean determining if the returned item should contain the
evaluations of all the monomials of the provided polynomials
( |
Note that this function is unstable and subject to change. Therefore it is
not exported but this documentations is left available so users can use it if
needed to simulate data by using nn2poly:::eval_poly().
If monomials==FALSE, returns a matrix containing the
evaluation of the polynomials on the given data. The matrix has dimensions
(n_sample, n_polynomials), meaning that each column corresponds to the
result of evaluating all the data for a polynomial. If a single polynomial is
provided, the output is a vector instead of a row matrix.
If monomials==TRUE, returns a 3D array containing the monomials of
each polynomial evaluated on the given data. The array has dimensions
(n_sample, n_monomial_terms, n_polynomials), where element
[i,j,k] contains the evaluation on observation i on
monomial j of polynomial k, where monomial j corresponds
to the one on poly$labels[[j]].
eval_poly() is also used in predict.nn2poly().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.