資源簡介
代碼片段和文件信息
import?numpy?as?np
import?matplotlib.pyplot?as?plt
from?matplotlib.pyplot?import?MultipleLocator
def?rmse(predictions?targets):
????return?np.sqrt(((predictions?-?targets)?**?2).mean())
#?p?=?np.array([-1E-132E-10-8E-082E-05-0.00150.07480])
x?=?[0?1?3?5?7?9?11?13?15?23?31?47?63?95?127?128?160?192?208?224?232?240?242?244?246?248?250
?????252?254?255]
#?x?=?[1020304050607080]
x?=?np.array(x)
#?print(‘x?is?:\n‘?x)
y?=?[0?0.332258065?0.372531769?0.448044966?0.553763441?0.644379277?0.729960899?0.79540567?0.870918866
?????1.052150538?1.21827957?1.454887586?1.651221896?1.928103617?2.189882698?2.194916911?2.476832845?2.814125122
?????3.040664712?3.347751711?3.559188661?3.851173021?3.93172043?4.027370479?4.123020528?4.274046921?4.420039101
?????4.621407625?4.933528837?5.15]
#?y?=?[174236305334349351342323]
y?=?np.array(y)
#?print(‘y?is?:\n‘?y)
#
評論
共有 條評論