inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

176만명의 커뮤니티!! 함께 토론해봐요.

Smoothing 과 Log 연산을 사용했을 때 다른 결과가 나옵니다.

미해결

밑바닥 부터 시작하는 머신러닝 입문

안녕하세요. 강의 잘 듣고 있습니다. 2_german_credit_application 따라하다가 Smoothing과 log를 적용해 보았는데, 결과가 원래와 다르게 나옵니다. 아래 코드입니다. 혹시 제가 실수한 곳이 있나요. 몇 시간이나 이것 저것 바꾸어 보았지만 찾지 못해서 질문드립니다. 고맙습니다. import pandas as pd import numpy as np df = pd.read_csv('./fraud.csv', sep=',') del df['ID'] y_data = df['Fraud'].as_matrix() x_df = pd.get_dummies(df[['History', 'CoApplicant', 'Accommodation']]) x_data = x_df.as_matrix() ix_y_is_true = np.where(y_data == True)[0] ix_y_is_false = np.where(y_data == False)[0] p_y_is_true = len(ix_y_is_true) / len(y_data) p_y_is_false = len(ix_y_is_false)/ len(y_data) # Smoothing... k = 2 p_x_when_y_is_true_sm = (np.sum(x_data[ix_y_is_true], axis=0) + k) / (len(ix_y_is_true) + k * 2) p_x_when_y_is_false_sm = (np.sum(x_data[ix_y_is_false], axis=0) + k) / (len(ix_y_is_false) + k * 2) # Test x_test = [0,1,0,0,0,1,0, 0,1,0] p_true = np.log(p_y_is_true) + np.dot(x_test, np.log(p_x_when_y_is_true_sm)) p_false = np.log(p_y_is_false) + np.dot(x_test, np.log(p_x_when_y_is_false_sm)) print('p_true > p_false :', p_true > p_false)

  • 머신러닝 배워볼래요?
감동기 댓글 2 좋아요 0 조회수 231

에러가 계속 나서 글을 남깁니다.

미해결

파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기

선생님, 안녕하세요? 저는 postgresql을 써서요. 그래도 하기와 같이 하면 되야하는데 같은 'psycopg2' 관련해서 계속 에러가 떠서요. 구글 찾아 가이드대로 깔아도 잘 안되는데 도와주십시요 ㅠ. 사실 pip install psycopg2하면 "Requirement already satisfied: psycopg2 in c:usersminanaconda3libsite-packages" 뜨기는 하거든요. 4시간을 헤메다가 ㅠ 글남깁니다. ----소스코드---- from sqlalchemy import create_engine engine = create_engine('postgresql://postgres:@비번@localhost/digitalclass') ----에러메시지---- Traceback (most recent call last): File "C:UsersminDownloadstest.py", line 4, in engine = create_engine('postgresql://postgres:@OPtimus7624@localhost/digitalclass') File "C:UsersminAnaconda3envsdigitalhw1libsite-packagessqlalchemyengine init .py", line 424, in create_engine return strategy.create(*args, kwargs) File "C:UsersminAnaconda3envsdigitalhw1libsite-packagessqlalchemyenginestrategies.py", line 81, in create dbapi = dialect_cls.dbapi( dbapi_args) File "C:UsersminAnaconda3envsdigitalhw1libsite-packagessqlalchemydialectspostgresqlpsycopg2.py", line 584, in dbapi import psycopg2 File "C:UsersminAnaconda3envsdigitalhw1libsite-packagespsycopg2-2.6.2-py3.4-win-amd64.eggpsycopg2 init .py", line 50, in from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID ImportError: No module named 'psycopg2._psycopg

  • python
  • 웹-크롤링
Seongmin Lee 댓글 1 좋아요 0 조회수 3601

seperated -> separated ^^

미해결

직장인을 위한 프로그래밍 입문과 업무자동화 활용

강사님~ 강의 잘 듣고 있습니다. 스펠링이 "separate"가 맞습니다 ^^

  • python
Joseph Ikseon Kang 댓글 1 좋아요 0 조회수 651

잘들었습니다~!

미해결

신입 프로그래머를 위한 실전 JSP 강좌

이번 강의부터 타블렛을 쓰시기 시작한듯요~! 훨씬 보기 좋습니다.

  • jsp
  • java
Jihoon Jeong 댓글 0 좋아요 0 조회수 164

ServletListener 클래스 생성시 오버라이드 생성 안되는 현상

미해결

신입 프로그래머를 위한 실전 JSP 강좌

강사님께서 올려주신 동영상에는 클래스 생성시에 오버라이드가 자동적으로 함께 생성되는데 제가 할때는 안되네요 ㅠㅠ 조금 다른 개발환경이라 그런걸까요? jdk 1.8.0_171 tomcat 9.0.7 Eclipse Oxygen.3a 사용중입니다. (처음 자바 10 깔아쓸 때에는 톰캣조차 안되어 한참 삽질도 했었어요;)

  • java
  • jsp
Jihoon Jeong 댓글 1 좋아요 0 조회수 363

코드가 아니고 파일에 문제가있어 과제제출이 안됩니다

미해결

프로그래밍, 데이터 과학을 위한 파이썬 입문

python-kernel: skipping build phase due to missing "setup.py" file ✔ Build finished. Traceback (most recent call last): File "test.py", line 67, in exec(test_code, test_module. dict ) File "", line 5, in File "/home/work/gowithflow.py", line 262 import collections import OrderedDict ^ SyntaxError: invalid syntax 라며 과제제출 자체가 야예 안되는건 왜 그럴까요 선생님?

  • python
  • bigdata
조은해 댓글 1 좋아요 0 조회수 154

테스트 과정에서 before all 이라는 에러가 뜹니다.

미해결

테스트주도개발(TDD)로 만드는 NodeJS API 서버

before all hook 이라는 에러문구가 뜨는데 이게 무었인지 잘모르겠습니다.

  • nodejs
  • rest-api
  • express
  • tdd
안성욱 댓글 2 좋아요 0 조회수 306

예외처리시 try를 쓴다음에 except문을 반드시 안써주어도 되나요.

미해결

파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기

안녕하세요 궁금한게요 예외처리시 사용하는 try문 같은경우 아래쪽에 except를 써주어야 되는것으로 알고있는데요 반드시 써주어야 하는건 아닌간요? 안써주어도 무방하나요? 감사합니다

  • 웹-크롤링
  • python
Clark 댓글 2 좋아요 0 조회수 356

선생님...!!!

미해결

C 프로그래밍 - 입문부터 게임 개발까지

include include int getRandomNumber(int level); void showQuestion(int level, int num1, int num2); void success() void fail() int main(void) { //문이 5개, 각 문제마다 점점 어려운 수식 퀴즈 출제(랜덤) //맞히면 통과, 틀리면 실패 srand(time(NULL)); int count = 0; for (int i = 1; i <= 5; i++) { int num1 = getRandomNumber(i); int num2 = getRandomNumber(i); //printf("%d X %d ? ", num1, num2); showQuestion(i, num1, num2); int answer = -1; scanf_s("%d", &answer); if (answer == -1) { printf("프로그램을 종료합니다.\n"); break; } else if (answer == num1 + num2) { success(); count++; } else { fail(); } } printf("\n\n 당신은 5개의 비밀번호 중 %d 개를 맞혔습니다.\n", count); return 0; } int getRandomNumber(int level) { return rand() % (level * 7) + 1; } void showQuestion(int level, int num1, int num2) { printf("nnn########## %d 번째 비밀번호 ##########", level); printf("nt %d X %d 는?nn", num1, num2); printf("######################################n"); printf("n비밀번호를 입력하세요 (종료 : -1) >>"); } void success() { printf("n >> Good ! 정답입니다!n"); } void fail() { printf("n >> 땡! 틀렸습니다.n"); } 이렇게 코딩을 했는데... 에러가 나와요... fail에 여기서 선언이 매개 변수를 선언해야 한다고하고 int main(void) 에서는 ;가 필요하다고 나오고... return 0; 에서는 {가 필요하다고 하네요...ㅠㅠ VS 평가판 끝났다고 해서 2017말고 예전에 15쓰던거 쓰고있기는 한데... 도와주세요 ㅠㅠ

  • c
후니 댓글 1 좋아요 0 조회수 170

실행이 안되네요.

미해결

웹, 앱 풀스택개발 Boot Camp - 입문부터 서비스 개발까지

구름IDE에서 github에서 소스를 Clone 해서 하고 있습니다. 그런데 하라는 데로 다 했는데 실행이 안되네요. 아래처럼 메시지가 나오는데, 어떻게 해야 하나요? 루비나 레일즈 이런것들이 버전이 안맞아서 그런가요? root@goorm:/workspace/inflearn-rorproject-# cd /workspace/inflearn-rorproject- && rails s -b 0.0.0.0 -p 3000 /usr/local/rvm/gems/ruby-2.4.0/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:155: warning: constant ::Fixnum is deprecated => Booting WEBrick => Rails 4.2.5 application starting in development on http://0.0.0.0:3000 => Run`rails server -h`for more startup options => Ctrl-C to shutdown server /usr/local/rvm/gems/ruby-2.4.0/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:155: warning: constant ::Fixnum is deprecated /usr/local/rvm/gems/ruby-2.4.0/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:155: warning: constant ::Fixnum is deprecated /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated Exiting /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:124:in`block (2 levels) in ': stack level too deep (SystemStackError) from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' ... 5013 levels... from /workspace/inflearn-rorproject-/bin/spring:15:in `require' from /workspace/inflearn-rorproject-/bin/spring:15:in`<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in`'

  • Ruby-on-Rails
  • HTML/CSS
  • javascript
Do Hyun Kim 댓글 0 좋아요 0 조회수 265

hydrogen 2.4.1 사용시 오류 발생합니다. 어떻게 설정해야 하나요?

미해결

프로그래밍, 데이터 과학을 위한 파이썬 입문

저는 윈도우7 사용자입니다. import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() ModuleNotFoundError Traceback (most recent call last) in () ----> 1 import matplotlib.pyplot as plt 2 3 plt.plot([1, 2, 3, 4]) 4 plt.ylabel('some numbers') 5 plt.show() ModuleNotFoundError: No module named 'matplotlib'

  • python
  • bigdata
MIKE.aeon 댓글 1 좋아요 0 조회수 213

깃헙 프라이빗 리포지토리 접근 질문드립니다.

해결됨

Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex

안녕하세요 강의 매우 잘 듣고 있습니다. 강사님의 vue-intermediate 프라이빗 리포지토리 접근 하기위한 공유를 어떻게 받아야되는지 모르겠어서 질문 남깁니다~

  • vuejs
  • javascript
  • vuex
  • es6
seungwoo lee 댓글 2 좋아요 0 조회수 350

감사합니다

미해결

모두를 위한 딥러닝 - 기본적인 머신러닝과 딥러닝 강좌

(사진)

  • 강화학습
  • 딥러닝
김문주 댓글 0 좋아요 0 조회수 187

&#039;class&#039;:&#039;alchol&#039;라고 하였는데....

미해결

파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기

질문드립니당 <li class="alcohol high" data-lo="cn">양주 에서 양주의 class는 alcohol high 라고 적혀있는데, """ param = {'data-lo':'cn','class':'alcohol'} print("5",soup.find("li",param).string) """ 에서는 왜 class가 alcohol이라고 되어있는건가요?ㅠㅠ

  • python
  • 웹-크롤링
봉하윤 댓글 1 좋아요 0 조회수 137

Uncaught TypeError: Cannot read property &#039;func&#039; of undefined 에러ㅜㅜ

미해결

React & Express 를 이용한 웹 어플리케이션 개발하기

강의 재밌게 잘 보고있습니다! 다름이 아니라 에러가 하나 안잡히는 것이 있는데요. 'Contact 데이터 추가기능 구현 | 컴포넌트 응용' 수업 부분에 Uncaught TypeError: Cannot read property 'func' of undefined 이 에러rk 저는 도저히 안잡히는데요... npm install --save prop-types import PropTypes from 'prop-types'; (ContactCreate.js) 이 두단계를 모두 진행했는데 여전히 같은 에러가 뜹니다... 구글링을 계속 해봐도 같은 답변 뿐이어서 답이 없네요 ㅠㅠ

  • react
정중한 표범 댓글 2 좋아요 0 조회수 412

dvwa captcha v1이 shutdown 되었데요

미해결

화이트해커가 되기 위한 8가지 웹 해킹 기술

dvwa captcha v1이 shutdown 되었데요 실습 진행이 불가한 상태인것 같습니다.

  • 모의해킹
June Kim 댓글 1 좋아요 0 조회수 217

&#039;input&#039; 이 어떨 때 쓰는건가요 ?

미해결

프로그래밍, 데이터 과학을 위한 파이썬 입문

강의를 들어도 정확한 사용용도나 의미를 잘몰라서요 ㅠㅠ print가 출력할 때 쓰는걸로 알고 있고, 변수가 a='말' 이렇게 할당한다는건 알겠는데 input의 기능은 어떤건지 머리에 확 들어오지가 않아서요 ㅠ

  • python
  • bigdata
도리강 댓글 2 좋아요 0 조회수 246

&#039;input&#039; 이 어떨 때 쓰는건가요 ?

미해결

프로그래밍, 데이터 과학을 위한 파이썬 입문

강의를 들어도 정확한 사용용도나 의미를 잘몰라서요 ㅠㅠ print가 출력할 때 쓰는걸로 알고 있고, 변수가 a='말' 이렇게 할당한다는건 알겠는데 input의 기능은 어떤건지 머리에 확 들어오지가 않아서요 ㅠ

  • bigdata
  • python
도리강 댓글 0 좋아요 0 조회수 302

인기 태그

인프런 TOP Writers

주간 인기글