当前位置: 首页>>代码示例>>Python>>正文


Python DataSet.dataimport方法代码示例

本文整理汇总了Python中dataset.DataSet.dataimport方法的典型用法代码示例。如果您正苦于以下问题:Python DataSet.dataimport方法的具体用法?Python DataSet.dataimport怎么用?Python DataSet.dataimport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dataset.DataSet的用法示例。


在下文中一共展示了DataSet.dataimport方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: exp_

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import dataimport [as 别名]
 def exp_(self):
     #"""
     data = DataSet()
     self.quick = DataSet()
     data.dataimport("D:\Dropbox\St Andrews\IT\IS5189 MSc Thesis\\02 Data\InnoCentive_Challenge_9933493_training_data.csv")
     data.labelencode(columns=self.configLE)
     xtest, xtrain, ytest, ytrain = data.split(quick=True)
     self.quick.import_split(xtest, xtrain, ytest, ytrain)
     self.output_str("10 percent of original dataset loaded (into train. Testset is 90 percent).")
     rows_train = len(xtrain)
     self.feedback("Challenge data loaded. self.quick init with " + str(rows_train) + " rows.")
     correlation_list, descstats = self.quick.correlation()
     self._output_last(correlation_list)
     #print(test)
     #a = test.sort_values(by='Correlation', ascending=True).head(20)
     #b = test.sort_values(by='Correlation',ascending=False).head(20)
     #print(a)
     #print(b)
     #print(descstats)
     #self.quick.descstats()
     #"""
     #Clock.schedule_once(lambda dt: self.feedback("this is good"), -1)
     #descstats = data.descstats(self.configLE)
     ############################################################
     # df is short for DataFrame , to make it more readable when manipulating the Pandas DataFrame.
     # Might be easier (and is shorter) to read by developers as an in house var name.
     threshold = 0.7
     df = correlation_list[correlation_list['Correlation'] > threshold]
     df = df.sort_values(by='Correlation',ascending=False)
     column_a_b = df['Var1']
     column_a_b = column_a_b.append(df['Var2'])
     print(df[df['Var1'] == 'C31'])
     print(column_a_b.value_counts())
     #print(df.head(10))
     print(pd.crosstab(df['Var1'], df['Var2']))
开发者ID:Dismeth,项目名称:gui,代码行数:37,代码来源:main.py

示例2: load

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import dataimport [as 别名]
def load():
    data = DataSet()
    data.dprint("Import data.")
    data.dataimport("D:\Dropbox\St Andrews\IT\IS5189 MSc Thesis\\02 Data\InnoCentive_Challenge_9933493_training_data.csv")
    data.dprint("Label Encode.")
    data.labelencode(columns=categorical_columns)
    data.dprint("Split data. Test set size: " + str(test_set_size))
    data.split(target_column_name=target_value, test_set_size=test_set_size,random_state_is=True)
    return data
开发者ID:Dismeth,项目名称:gui,代码行数:11,代码来源:best_fit.py

示例3: exp_quick_load

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import dataimport [as 别名]
 def exp_quick_load(self):
     self.output_str("Import.")
     global data
     data = DataSet()
     data.dataimport("D:\Dropbox\St Andrews\IT\IS5189 MSc Thesis\\02 Data\InnoCentive_Challenge_9933493_training_data.csv")
     self.loaded = True
     self.output_str("Label Encode.")
     data.labelencode(columns=self.configLE)
     self.output_str("Split (quick = True).")
     data.split(target_column_name=self.configCV['target_value'], test_set_size=self.configCV['test_set_size'],
                seed=self.configCV['seed'], random_state_is=self.configCV['random_state_is'],quick=True)
     self.update_overview(trainrows=len(data.X_train), testrows=len(data.X_test),
                          ncols=len(data.X_train.columns.values))
     self.output_str("Function 'exp_quick_load()' finished running.")
     data.descstats(self.configLE,write=True,workdir=self.configGeneral['workdir'])
开发者ID:Dismeth,项目名称:gui,代码行数:17,代码来源:main.py

示例4: load

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import dataimport [as 别名]
 def load(self, path, filename):
     global last_path
     global last_filename
     global data
     last_path = path
     last_filename  = filename[0]
     try:
         data = DataSet()
         data.dataimport(filename[0])
         self.loaded = True
     except (RuntimeError, TypeError, NameError):
         data.dprint("Error: most likely not a csv file.")
     self.output_str("Successfully loaded the data set.")
     self.feedback("Fileimport completed")
     if self.configGeneral['desc_stats_on_load']:
         data.descstats(self.configLE)
         self.output_str("Descriptive statistics performed.")
     ncols = len(data.information())
     # Get the filename and cut it to fit the GUI..
     # Filename only used to remind the user of which dataset has been loaded.
     head, tail = os.path.split(filename[0])
     fname = tail[:5]+ "." + tail[-4:]
     self.update_overview(fname=fname,ncols=ncols)
     self.dismiss_popup()
开发者ID:Dismeth,项目名称:gui,代码行数:26,代码来源:main.py


注:本文中的dataset.DataSet.dataimport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。