인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

shsms92232454's profile image
shsms92232454

asked

[Revised Edition] The Complete Guide to Python Machine Learning

Understanding Polynomial Regression and Predicting Boston Housing Prices Using Polynomial Regression

why5?

Written on

·

352

0

예측한 회귀계수의 변수들의 순서가 어떻게 되는지 궁금합니다.또한 위의 회귀계수들이 적용된 함수를 보는 방법도 궁금합니당.

python머신러닝 배워볼래요? 통계

Answer 1

1

dooleyz3525님의 프로필 이미지
dooleyz3525
Instructor

안녕하십니까,

PolynomialFeautures 객체의 get_feature_names()를 사용해 보시지요. 아래 예제 코드 참조 부탁드립니다.

from sklearn.preprocessing import PolynomialFeatures
import pandas as pd
import numpy as np

data = pd.DataFrame.from_dict({
    'x': np.random.randint(low=1, high=10, size=5),
    'y': np.random.randint(low=1, high=10, size=5),
})

p = PolynomialFeatures(degree=3).fit(data)
p.get_feature_names(data.columns)
shsms92232454's profile image
shsms92232454

asked

Ask a question