Spaces:
Sleeping
Sleeping
Commit
·
0059ef7
1
Parent(s):
b350495
Upload 3 files
Browse files- annotations_dataset.csv +0 -0
- app.py +27 -0
- fitted_model.sav +0 -0
annotations_dataset.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import pandas as pd
|
3 |
+
import pickle
|
4 |
+
import sys
|
5 |
+
import sklearn
|
6 |
+
import sklearn.neighbors._base
|
7 |
+
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
|
8 |
+
import xgboost
|
9 |
+
from missingpy import MissForest
|
10 |
+
import warnings
|
11 |
+
warnings.simplefilter(action="ignore", category=FutureWarning)
|
12 |
+
from warnings import filterwarnings
|
13 |
+
|
14 |
+
filterwarnings("ignore")
|
15 |
+
seed=42
|
16 |
+
|
17 |
+
annotations = pd.read_csv("annotations_dataset.csv")
|
18 |
+
annotations = annotations.set_index("Gene")
|
19 |
+
imputer = MissForest(random_state=seed)
|
20 |
+
data = imputer.fit_transform(annotations)
|
21 |
+
|
22 |
+
model = pickle.load(open('fitted_model.sav', 'rb'))
|
23 |
+
|
24 |
+
predictions = list(model.predict(data))
|
25 |
+
|
26 |
+
output = pd.Series(data=predictions, index=annotations.index, name="XGB_Score")
|
27 |
+
df_total = pd.concat([annotations, output], axis=1)
|
fitted_model.sav
ADDED
Binary file (57.6 kB). View file
|
|