コード例 #1
0
ファイル: trained.py プロジェクト: Afey/ramp
 def _train(self, train_datas):
     train_data = concat(train_datas, axis=1)
     y, ff = build_target_safe(self.target, self.data)
     y = reindex_safe(y, train_data.index)
     arg = self.threshold_arg
     if arg is None:
         arg = self.n_keep
     cols = self.selector.select(train_data, y, arg)
     return cols
コード例 #2
0
 def _train(self, train_datas):
     train_data = concat(train_datas, axis=1)
     y, ff = build_target_safe(self.target, self.data)
     y = reindex_safe(y, train_data.index)
     arg = self.threshold_arg
     if arg is None:
         arg = self.n_keep
     cols = self.selector.select(train_data, y, arg)
     return cols
コード例 #3
0
ファイル: base.py プロジェクト: johnmcdonnell/ramp
 def build(self, data, prep_index=None, train_index=None):
     if prep_index is None:
         prep_index = data.index
     if train_index is None:
         train_index = data.index
     datas = []
     fitted_features = []
     for feature in self.features:
         feature_data, ff = feature.build(data, prep_index, train_index)
         datas.append(feature_data)
         fitted_features.append(ff)
     ff = FittedFeature(self,
                        prep_index=prep_index,
                        train_index=train_index,
                        inner_fitted_features=fitted_features)
     ff.prepped_data = self.prepare([reindex_safe(d, prep_index) for d in datas])
     ff.trained_data = self.train([reindex_safe(d, train_index) for d in datas])
     feature_data = self._combine_apply(datas, ff)
     feature_data = self._prepend_feature_name_to_all_columns(feature_data)
     return feature_data, ff
コード例 #4
0
ファイル: base.py プロジェクト: DailyActie/AI_ML_LIB-ramp
 def build(self, data, prep_index=None, train_index=None):
     if prep_index is None:
         prep_index = data.index
     if train_index is None:
         train_index = data.index
     datas = []
     fitted_features = []
     for feature in self.features:
         feature_data, ff = feature.build(data, prep_index, train_index)
         datas.append(feature_data)
         fitted_features.append(ff)
     ff = FittedFeature(self,
                        prep_index=prep_index,
                        train_index=train_index,
                        inner_fitted_features=fitted_features)
     ff.prepped_data = self.prepare(
         [reindex_safe(d, prep_index) for d in datas])
     ff.trained_data = self.train(
         [reindex_safe(d, train_index) for d in datas])
     feature_data = self._combine_apply(datas, ff)
     feature_data = self._prepend_feature_name_to_all_columns(feature_data)
     return feature_data, ff