전체 글(331)
-
[Python] Module에대한 이해
Module이란? 하나의 source code file을 그냥 module이라고 한다. 이 source file에는 함수가 들어있거나 프로그램의 일부를 담당할 때 module이라고 부르기도 한다. 어떤 함수를 만들었는데 한 번만 쓰고 버리기 아깝다면?. py 파일을 만들어서 다음에 쓰고 싶을 때 불러오면 된다. 이런 식으로 module을 사용한다. Module을 만들어보자. # module_ex.py def add_two_values(a,b): return a + b def multiple_two_values(a,b): return a * b위의 두 함수를 module_ex.py 파일로 저장해 둔다. 이제 add_two_values, multiple_two_values를 다른 파일에서 불러와 써보자..
2025.07.12 -
[ML_2] Let's convert pd.Dataframe to train_test dataset.
What if our dataset is a pd.DataFrame? In this case, we convert the DataFrame into a training dataset using the following code.from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split import pandas as pd iris_df = pd.DataFrame(iris_data.data, columns = iris_data.feature_n..
2025.07.10 -
[ML_1] Let's make iris classification model by Scikitlearn
First, we import the necessary modules:import sklearn from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_splitimport pandas as pd We start by importing the scikit-learn library (sklearn) along with the datasets module, the Decision Tree algorithm, and the train_test_split utility. We also import pandas for handlin..
2025.07.09 -
[numpy] np.array, np.zeros, np.ones, np.reshape
1. np. array : numpy를 이용해 array 형태로 바꿔준다. 사용법은 다음과 같다. import numpy as np arr1 = np.array([1,2,3]) 2. np.zeros : numpy를 이용해 array를 만드는데 이때 값들을 0으로 초기화해 준다. import numpy as np arr1 = np.zeros((3,2),dtype='int32') 3. np.ones : numpy를 이용해 array를 만드는데 이때 값들을 1로 초기화해 준다. import numpy as np arr1 = np.ones((3,2),dtype='int32') 4. np.reshape : 기존의 array의 shape을 수정할 때 사용한다. list라는 기존의 array가 있을 때 이 list..
2025.07.09 -
[Akkermansia muciniphila] Transcriptomics and metabolomics reveal the adaption of Akkermansia muciniphila to high mucin by regulating energy homeostasis 논문 데이터 분석(1)
※ Transcriptomics and metabolomics reveal the adaption of Akkermansia muciniphila to high mucin by regulating energy homeostasis 논문에서 쓰인 transcriptomics data를 직접 다운로드하여 분석하는 프로젝트를 진행하려 한다. 0. Reference Genome, Transcriptomics data 찾기 이 paper에서 "RNA isolation and analysis" 페이지에 Ref genome과 Transcriptomics data의 accession number를 제공해주고 있다. 정보를 정리해 보자면 다음과 같다. Raw sequencing data (transcriptomics ..
2024.11.22 -
[Docker] 1. 이미지 빌드하고 container에서 실행하기
1년 전부터 oracle vm을 써왔다. 하지만, 그래픽이 깨지는 현상, 너무 무겁다는 점, edit이 불편하다는 점 그리고 알 수 없는 오류가 지속적으로 발생한다는 점 때문에 지우고 설치하기를 반복했다. 이점 때문에 Docker를 배우기로 마음먹었다. Docker의 가장 강력한 점이라고 한다면 어디서든 코드가 돌아가도록 하는 것이라고 생각한다. 프로그램을 만들고 그것을 배포할 때 에러가 나는 경우가 많은데, docker는 이런 부분을 잡아준다. 0. 프로젝트 시작 : Ubuntu에서 python code를 실행시켜 보는 코드를 만들고 , 실행시켜 보자. 1. image 만들기 image라는 것은 밀키트와 같다. 내가 프로그램을 실행시키기 위해서 필요한 모든 것들을 담아낸 것이 image다. 따라서..
2024.11.20