<Kaggle>/[Costa Rican Household Poverty Level]
-
-
-
2022-02-26<Kaggle>/[Costa Rican Household Poverty Level] 2022. 2. 26. 21:47
from sklearn.metrics import make_scorer scorer = make_scorer(f1_score, greater_is_better=True, average='macro') cv_score = cross_val_score(model, train_set, train_labels, cv = 10, scoring = scorer) .sort_values('importance', ascending=False)
-
2022-02-25<Kaggle>/[Costa Rican Household Poverty Level] 2022. 2. 25. 21:28
list vs np.array (list(Counter(list).values())) == 1 # False np.array(list(Counter(list).values())) == 1 # array([ True, True, True, True, True, True, True, True]) list == 1 np.array == 1 -> [1, 1, 1, 1] (1) pd.DataFrame.iterrows() : 행에 대해 순환 반복 (Iterate over DataFrame rows as (index, Series) pairs.) (2) pd.DataFrame.iteritems() : 열에 대해 순환 반복 (Iterate over DataFrame (column name, Series) pairs.)..
-
2022-02-24<Kaggle>/[Costa Rican Household Poverty Level] 2022. 2. 24. 21:43
df['x'] == 1 # 결과는 boolean series df.groupby('x') # 'x'는 index로 .isin()(= ==+for) vs == households_no_head = df.loc[df['x'].isin(s[s == 0].index), :] # series.value.isin(index) for i in (s[s == 0].index): households_no_head = df.loc[df['x']==i, :] df['x'] == np.nan -> df.loc[df['x'].isnull()] Counter(x) -> dict