Page MenuHomec4science

build_polynomial.py
No OneTemporary

File Metadata

Created
Sun, Feb 23, 23:36

build_polynomial.py

# -*- coding: utf-8 -*-
"""implement a polynomial basis function."""
import numpy as np
def build_poly(x, degree):
sigma = np.zeros((degree+1,len(x)))
tx = np.array(x)
for deg in range(degree+1):
sigma[deg] = tx**deg
return sigma.T

Event Timeline