Arnaudding001 commited on
Commit
14db87c
1 Parent(s): 540f528

Upload 2 files

Browse files
Files changed (2) hide show
  1. LGmodel.joblib +3 -0
  2. MLmodel.py +28 -0
LGmodel.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c5662d66d4103e9b40f49f34b782165bbe9c86a2fa679ff140f146e3bfbb919
3
+ size 1007
MLmodel.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import numpy as np
3
+ from sklearn.base import BaseEstimator, TransformerMixin
4
+ from sklearn.impute import SimpleImputer
5
+ import re
6
+ from sklearn.preprocessing import StandardScaler
7
+
8
+
9
+ class PrepProcesor(BaseEstimator, TransformerMixin):
10
+ def fit(self, X, y=None):
11
+ self.ageImputer = SimpleImputer()
12
+ self.ageImputer.fit(X[['Locked_period']])
13
+ return self
14
+
15
+ def transform(self, X, y=None):
16
+ X['Locked_period'] = self.ageImputer.transform(X[['Locked_period']])
17
+ # X['CabinClass'] = X['Cabin'].fillna('M').apply(lambda x: str(x).replace(" ", "")).apply(lambda x: re.sub(r'[^a-zA-Z]', '', x))
18
+ # X['CabinNumber'] = X['Cabin'].fillna('M').apply(lambda x: str(x).replace(" ", "")).apply(lambda x: re.sub(r'[^0-9]', '', x)).replace('', 0)
19
+ # X['Embarked'] = X['Embarked'].fillna('M')
20
+ X = StandardScaler.fit_transform(X)
21
+ #X = X.drop(['PassengerId', 'Name', 'Ticket','Cabin'], axis=1)
22
+ return X
23
+
24
+
25
+ columns = ['Wallet_distribution', 'Whale_anomalie_activities', 'Locked_period', 'Operation_duration', 'PR_articles', 'Decentralized_transaction','twitter_followers_growthrate','unique_address_growthrate', 'month_transaction_growthrate','github_update', 'code_review_report', 'publicChain_safety' , 'investedProjects','token_price', 'token_voltality_overDot', 'negative', 'neutre', 'positive', 'KOL_comments', 'media_negatifReport']
26
+
27
+
28
+