Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102765755
build_polynomial.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 23, 23:36
Size
268 B
Mime Type
text/x-python
Expires
Tue, Feb 25, 23:36 (2 d)
Engine
blob
Format
Raw Data
Handle
24418747
Attached To
rTZUCT ML_Project1
build_polynomial.py
View Options
# -*- 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
Log In to Comment