개발/AI 14

[Python] Logic Gate 클래스 만들기

클래스 연습 겸 Logic Gate 만들기 class LogicGate: def __init__(self, w1, w2, b): self.w1 = w1 self.w2 = w2 self.b = b # __call__ : 함수를 지정하지 않고 호출가능. 그러므로 하나만 설정 가능 # self.함수(x1, x2) -> self(x1, x2) 로 사용하게 됨. def __call__(self, x1, x2): z = self.w1 * x1 + self.w2 * x2 +self.b if z > 0: return 1 else: return 0 class ANDGate: def __init__(self): self.gate = LogicGate(0.5, 0.5, -0.7) def __call__(self, x1, x..

개발/AI 2023.11.07

[AutoViz] EDA를 도와줄 시각화 툴

!pip install AutoViz !pip install xlrd import warnings warnings.filterwarnings('ignore') import pandas as pd from autoviz.AutoViz_Class import AutoViz_Class AV = AutoViz_Class() # 데이터 불러오기 file = "csv 파일" df = pd.read_pickle(file) df.head() # AutoViz 실행 save_viz_dir = 'eda_viz' # 폴더 이름. chart_format 형식으로 저장될 파일 위치. dftc = AV.AutoViz(filename='', sep=',' , depVar='Attrition_Flag', # 타겟 데이터 컬럼명 df..

개발/AI 2023.10.31