-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstand_ml.py
More file actions
18 lines (13 loc) · 735 Bytes
/
stand_ml.py
File metadata and controls
18 lines (13 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pandas as pd
import numpy as np
from pycaret.classification import *
data = pd.read_csv('latent_space.tsv',sep='\t', header=0, index_col=0)
sample_list_path = 'data/ABC_inter/Normalized/sample_lists/class/ABC_inter/sample_list.tsv'
sample_list = np.loadtxt(sample_list_path, delimiter='\t', dtype='<U32')
labels_path = 'data/ABC_inter/Normalized/labels.tsv'
labels = pd.read_csv(labels_path, sep='\t', header=0, index_col=0)
labels = labels.loc[sample_list]
input_data = pd.concat([data, labels], axis=1)
exp = setup(data=input_data, target='sample_type.samples', use_gpu=True, fold_strategy='stratifiedkfold', fold=5, feature_selection=True, fix_imbalance=True, normalize=False)
best = compare_models()
predict_model(best)