-
Notifications
You must be signed in to change notification settings - Fork 1
/
ml_test.py
60 lines (39 loc) · 1.6 KB
/
ml_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from joblib import load
import pandas as pd
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
filename = 'finalized_google_playstore.sav'
loaded_model = load(filename)
gps_df = pd.read_csv('dataset/google-play-store-apps/googleplaystore.csv')
gps_df.dropna(inplace = True)
column_names = ['Category', 'Content Rating', 'Android Ver', 'Type', 'Size', 'Installs', 'Price', 'Reviews', 'Last Updated']
X = gps_df[column_names].copy()
y = gps_df['Rating'].copy()
a = loaded_model.predict(X.iloc[[1]])
print("*********************************")
print(y.iloc[[1]])
print(a)
print("*********************************")
########################################################################################################################################
filename = 'finalized_google_playstore_for_installs.sav'
loaded_model = load(filename)
column_names = ['Category', 'Content Rating', 'Android Ver', 'Size', 'Price', 'Reviews', 'Rating', 'Last Updated']
X = gps_df[column_names].copy()
y = gps_df['Installs'].copy()
a = loaded_model.predict(X.iloc[[1]])
print("*********************************")
print(y.iloc[[1]])
print(a)
print("*********************************")
filename = 'finalized_google_playstore_for_reviews.sav'
loaded_model = load(filename)
column_names = ['Category', 'Content Rating', 'Android Ver', 'Size', 'Installs', 'Price', 'Rating', 'Last Updated']
X = gps_df[column_names].copy()
y = gps_df['Reviews'].copy()
a = loaded_model.predict(X.iloc[[1]])
print("*********************************")
print(y.iloc[[1]])
print(a)
print("*********************************")