Пример #1
0
    def __init__(self, pipeline_):
        train = pd.read_csv('data/train.csv', index_col=0)
        test = pd.read_csv('data/test.csv', index_col=0)

        add_features = AddFeatures(train, test)
        add_features.add_bmi_sist_dist_map()
        add_features.add_f_score()
        add_features.add_ap_features()
        add_features.del_features()

        train = add_features.train
        test = add_features.test

        self.Y = train['cardio'].values
        train.drop('cardio', axis=1, inplace=True)
        self.X = train
        self.test = test

        self.pipeline = pipeline_
        self.model = None
        self.kf = None

        self.results = pd.DataFrame()
Пример #2
0
from FEATURES import AddFeatures

from mlxtend.classifier import EnsembleVoteClassifier

pd.set_option('display.max_columns', 16)
pd.set_option('display.width', 1000)
plt.style.use('ggplot')
warnings.filterwarnings('ignore')

train = pd.read_csv('data/train.csv', index_col=0)
test = pd.read_csv('data/test.csv', index_col=0)

add_features = AddFeatures(train, test)
add_features.add_bmi_sist_dist_map()
add_features.add_f_score()
add_features.add_ap_features()
add_features.del_features()

train = add_features.train
test = add_features.test

Y = train['cardio'].values
train.drop('cardio', axis=1, inplace=True)
X = train

best_columns_first = [
    'gender', 'height', 'ap_hi', 'ap_lo', 'smoke', 'alco', 'active', 'age_y',
    'ch_1', 'ch_2', 'ch_3', 'gl_1', 'gl_2', 'gl_3', 'bmi', 'sist_formula',
    'map', 'F_score', 'ap_log'
]