Skip to content

Commit

Permalink
주석 번역
Browse files Browse the repository at this point in the history
  • Loading branch information
rickiepark committed May 30, 2021
1 parent d228bee commit f6cf608
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions ml_editor/data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ def get_vectorized_inputs_and_label(df):

def get_feature_vector_and_label(df, feature_names):
"""
Generate input and output vectors using the vectors feature and
the given feature names
:param df: input DataFrame
:param feature_names: names of feature columns (other than vectors)
:return: feature array and label array
벡터 특성과 다른 특성을 사용해 입력과 출력 벡터를 만듭니다.
:param df: 입력 데이터프레임
:param feature_names: (‘vectors’ 열을 제외한) 특성 열 이름
:return: 특성 배열과 레이블 배열
"""
vec_features = vstack(df["vectors"])
num_features = df[feature_names].astype(float)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

def get_fixture_df():
"""
Use parser to return DataFrame
파서를 사용해 데이터프레임을 반환합니다
:return:
"""
curr_path = Path(os.path.dirname(__file__))
Expand All @@ -39,15 +39,15 @@ def get_fixture_df():

def test_parser_returns_dataframe():
"""
Tests that our parser runs and returns a DataFrame
파서가 데이터프레임을 반환하는지 테스트합니다.
"""
df = get_fixture_df()
assert isinstance(df, pd.DataFrame)


def test_feature_columns_exist():
"""
Validate that all required columns are present
필수 열이 모두 들어 있는지 검사합니다.
"""
df = get_fixture_df()
for col in REQUIRED_COLUMNS:
Expand All @@ -56,7 +56,7 @@ def test_feature_columns_exist():

def test_features_not_all_null():
"""
Validate that no features are missing every value
누락된 값을 포함한 특성이 있는지 검사합니다.
"""
df = get_fixture_df()
for col in REQUIRED_COLUMNS:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def test_model_prediction_dimensions(
)

probas = trained_v1_model.predict_proba(features)
# the model makes one prediction per input example
# 모델이 입력 샘플마다 하나의 예측을 만듭니다.
assert probas.shape[0] == features.shape[0]
# the model predicts probabilities for two classes
# 모델이 두 개의 클래스에 대한 확률을 예측합니다.
assert probas.shape[1] == 2


Expand All @@ -90,12 +90,12 @@ def test_model_proba_values(
)

probas = trained_v1_model.predict_proba(features)
# the model's probabilities are between 0 and 1
# 모델의 확률은 0과 1 사이입니다.
assert (probas >= 0).all() and (probas <= 1).all()


def test_model_predicts_no_on_bad_question():
input_text = "This isn't even a question. We should score it poorly"
is_question_good = get_model_predictions_for_input_texts([input_text])
# The model classifies the question as poor
# 모델이 이 샘플을 나쁜 질문으로 분류해야 합니다.
assert not is_question_good[0]

0 comments on commit f6cf608

Please sign in to comment.