• 카테고리

    질문 & 답변
  • 세부 분야

    컴퓨터 비전

  • 해결 여부

    미해결

보스턴 집값 예제가 실행이 안 됩니다.

24.01.02 22:05 작성 조회수 183

0

/opt/conda/lib/python3.10/site-packages/sklearn/utils/deprecation.py:87: FutureWarning: Function load_boston is deprecated; `load_boston` is deprecated in 1.0 and will be removed in 1.2.

    The Boston housing prices dataset has an ethical problem. You can refer to
    the documentation of this function for further details.

    The scikit-learn maintainers therefore strongly discourage the use of this
    dataset unless the purpose of the code is to study and educate about
    ethical issues in data science and machine learning.

    In this special case, you can fetch the dataset from the original
    source::

        import pandas as pd
        import numpy as np


        data_url = "http://lib.stat.cmu.edu/datasets/boston"
        raw_df = pd.read_csv(data_url, sep="\s+", skiprows=22, header=None)
        data = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])
        target = raw_df.values[1::2, 2]

    Alternative datasets include the California housing dataset (i.e.
    :func:`~sklearn.datasets.fetch_california_housing`) and the Ames housing
    dataset. You can load the datasets as follows::

        from sklearn.datasets import fetch_california_housing
        housing = fetch_california_housing()

    for the California housing dataset and::

        from sklearn.datasets import fetch_openml
        housing = fetch_openml(name="house_prices", as_frame=True)

    for the Ames housing dataset.
    
  warnings.warn(msg, category=FutureWarning)

예전에 어떤 사람이 같은 내용으로 문의를 한 적이 있습니다. 그런데 답변의 내용대로 해도 해결이 안 됩니다. 사이킷런 버전 1.0.2로 바꾸고 run -> restart & clear cell output 누르고 다시 들어가도 이런 오류가 나옵니다.

어떻게 하면 좋을까요?

답변 2

·

답변을 작성해보세요.

0

안녕하십니까,

적어주신것은 오류가 아니라 warning 입니다. 이건 추후에 load_boston 데이터 세트가 지원하지 않는 다는 warning 이므로 수행에는 상관없습니다.

1.0.2 로 downgrade 하시면 warning을 무시하시고, 수행해 보시면 잘 될 겁니다. 안되시면 다시 답 부탁드립니다.

감사합니다.

0

인프런 AI 인턴님의 프로필

인프런 AI 인턴

2024.01.02

안녕하세요, 인프런 AI 인턴입니다.

보스턴 집값 예제에 대해 실행 중 오류가 발생한 관련 질문이 있어 해당 답변을 찾아드리겠습니다.
권 철민 강사님께서는 scikit-learn 버전을 다운그레이드한 후 커널을 재기동하라고 조언하셨습니다.

자세한 내용을 확인하려면 아래 링크를 참고해 주세요: