본문 바로가기

분류 전체보기

(104)
20문자로나타내기 from sympy import symbols, Eq, solve, diff, sin, cos, simplify, Matrix# 변수 정의x, y, a, b, c, d, s, l, w = symbols('x y a b c d s l w')# 예시 1: 대수 방정식equation = Eq(x + y, x*y)solution = solve(equation, y)print("Solution for y in equation x + y = x * y:", solution)# 예시 2: 미분 계산f = x**2 + xf_prime = diff(f, x)print("Derivative of f = x^2 + x with respect to x:", f_prime)# 예시 3: 삼각함수와 곱의 연산expression ..
python pip install Python pip Installation GuideScenario 1: Installing pip Without --user Option (Recommended)If you have administrator (root) access, you can install pip system-wide without using the --user option.Steps:Run the following command:python3 get-pip.pyVerify the installation:pip --versionScenario 2: Installing pip With --user OptionIf you do not have administrator access, you can install pip in your u..
python embedding + vector store for LLM """#디렉토리구조project_root/│├── images/│   └── example_image.png  # 분석할 이미지 파일들│├── embeddings/│   └── vector_store.index  # 생성된 벡터 스토어를 저장할 위치 (선택사항)│├── main.py  # 주요 Python 코드 파일│├── requirements.txt  # 필요한 라이브러리 목록 (선택사항)│└── README.md  # 프로젝트 설명 파일 (선택사항)""""""#requirements.txtpytesseractpillowfaiss-cpusentence-transformers""""""#operationpip install -r requirements.txtpython main.py""""""#setu..
python character recognition """#디렉토리구조my_character_recognition/├── dataset/│   ├── A/│   │   ├── image1.png│   │   ├── image2.png│   │   └── ...│   ├── B/│   │   ├── image3.png│   │   ├── image4.png│   │   └── ...│   └── ...  # 클래스별 폴더├── labels.pkl├── character_recognition_model.h5 #학습 후 자동생성├── ui_app.py└── requirements.txt""""""#requirements.txttensorflowopencv-pythonnumpy""" """#operationpip install -r requirements.txt..
python unittest - assertEqual # 'assertEqual'은 파이썬의 'unittest' 모듈에서 제공하는 메서드 중 하나로,# 단위 테스트에서 기대한 결과와 실제 결과가 같은지를 확인하는 데 사용됩니다.# 'assertEqual' 사용법# self.assertEqual(actual, expected)# actual: 테스트에서 실제로 나온 결과 값입니다.# expected: 우리가 기대하는 결과 값입니다.# 예제# 다음은 'add' 함수에 대한 'assertEqual'의 예입니다.def add(a, b):    return a + bimport unittestclass TestAddFunction(unittest.TestCase):    def test_add(self):        self.assertEqual(add(2, 3)..
classification - adagrad + dropout ( 분류 - 아다그라드 + 드랍아웃 ) import numpy as npimport matplotlib.pyplot as pltfrom sklearn import datasets# 아이리스 데이터셋 로드iris_data = datasets.load_iris()input_data = iris_data.datacorrect = iris_data.targetn_data = len(correct)# 입력 데이터 정규화ave_input = np.average(input_data, axis=0)std_input = np.std(input_data, axis=0)input_data = (input_data - ave_input) / std_input# 정답 데이터를 원-핫 인코딩으로 변환correct_data = np.zeros((n_data, 3))fo..
classification - GSD + dropout ( 분류 - 확률적 경사하강법 + 드랍아웃 ) import numpy as npimport matplotlib.pyplot as pltfrom sklearn import datasets# 아이리스 데이터셋 로드iris_data = datasets.load_iris()input_data = iris_data.datacorrect = iris_data.targetn_data = len(correct)# 입력 데이터 정규화ave_input = np.average(input_data, axis=0)std_input = np.std(input_data, axis=0)input_data = (input_data - ave_input) / std_input# 정답 데이터를 원-핫 인코딩으로 변환correct_data = np.zeros((n_data, 3))fo..
classification - adagrad ( 분류 - 아다그라드 ) import numpy as npimport matplotlib.pyplot as pltfrom sklearn import datasets# 아이리스 데이터셋 로드iris_data = datasets.load_iris()input_data = iris_data.datacorrect = iris_data.targetn_data = len(correct)# 입력 데이터 정규화ave_input = np.average(input_data, axis=0)std_input = np.std(input_data, axis=0)input_data = (input_data - ave_input) / std_input# 정답 데이터를 원-핫 인코딩으로 변환correct_data = np.zeros((n_data, 3))fo..