本文整理汇总了Python中Preprocess.process方法的典型用法代码示例。如果您正苦于以下问题:Python Preprocess.process方法的具体用法?Python Preprocess.process怎么用?Python Preprocess.process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preprocess
的用法示例。
在下文中一共展示了Preprocess.process方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: zip
# 需要导入模块: import Preprocess [as 别名]
# 或者: from Preprocess import process [as 别名]
__author__ = 'Mounica'
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import SGDClassifier
import pandas as pd
import Preprocess
from sklearn.externals import joblib
import sys
PATH = sys.argv[1]
INPUTPATH = sys.argv[2]
FILE_NAME = sys.argv[3]
FILE_PATH = INPUTPATH + "/" + FILE_NAME
dataset = Preprocess.process(FILE_PATH)
userId = dataset['userId']
status = dataset['status']
gender = dataset['gender']
age = dataset['age']
datasetList = zip(userId, status, gender, age)
ds = pd.DataFrame(data=datasetList, columns=['userId', 'status', 'gender', 'age'])
ngram_vectorizer = CountVectorizer(ngram_range=(1,3), min_df=1)
tfidf_transformer = TfidfTransformer()
X_train = ds['status']
y_train_gender = ds['gender']
y_train_age = ds['age']
#Traindata vectorization