이녀기의 자유 탐구

  • 홈
  • IT
  • Book
  • Study
  • Economy
  • Life
Study / Books / Life

shape 2

linear model 에러 정리(inconsistent numbers of samples, expected 2d got 1d)

Found input variables with inconsistent numbers of samples: [4, 5] x = X[: 2 + target_idx] y = X[: 2 + target_idx + 1] - 원인: X와 Y의 차원이 달라서 그렇다. - 해결: numpy.array인 X의 인덱싱 과정에서 ,를 빼먹어서 슬라이싱된 상황이었다. ,를 작성해서 해결. x = X[:, 2 + target_idx] y = X[:, 2 + target_idx + 1]​ Expected 2D array, got 1D array instead: from sklearn import linear_model regr = linear_model.LinearRegression() regr.fit(x, y) - 원인: l..

IT/Scikit-learn(sklearn) 2023.06.23

linear model 에러 정리(inconsistent numbers of samples, expected 2d got 1d)

Found input variables with inconsistent numbers of samples: [4, 5] x = X[: 2 + target_idx] y = X[: 2 + target_idx + 1] - 원인: X와 Y의 차원이 달라서 그렇다. - 해결: numpy.array인 X의 인덱싱 과정에서 ,를 빼먹어서 슬라이싱된 상황이었다. ,를 작성해서 해결. x = X[:, 2 + target_idx] y = X[:, 2 + target_idx + 1]​ Expected 2D array, got 1D array instead: from sklearn import linear_model regr = linear_model.LinearRegression() regr.fit(x, y) - 원인: l..

IT/Scikit-learn(sklearn) 2023.06.14
1
더보기
프로필사진

다양한 분야에 관심을 가지고 있는 스물네 살 대학생입니다. 프로그래밍, 주식, 게임, 운동 등등

  • 분류 전체보기 (30)
    • 블로그 소개 (1)
    • IT (14)
      • Programming (4)
      • Development (3)
      • Problem Solving (4)
      • Pytorch (1)
      • Scikit-learn(sklearn) (2)
    • Book (9)
    • 논문 (0)
    • Life (4)
      • 인생 이야기 (4)
      • 공부 관련 경험 (0)
    • Economy (1)
    • 홍보 (1)
    • Research (0)

Tag

Baekjoon online judge, sklearn, 자기계발, llmapp, 주식 투자, 난이도: 3, C, Django, backend, 황자, 경제, LangChain, 난이도 : 2, 독서, error, 도둑맞은 집중력, PYTHON, Dynamic Programming, Time Complexity, shape,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바