Ejemplo n.º 1
0
def test_all_hyperparameters_regressor(sagemaker_session):
    knn = KNN(sagemaker_session=sagemaker_session,
              dimension_reduction_type='sign', dimension_reduction_target='2', index_type='faiss.Flat',
              index_metric='COSINE', faiss_index_ivf_nlists='auto', faiss_index_pq_m=1, **ALL_REQ_ARGS)
    assert knn.hyperparameters() == dict(
        k=str(ALL_REQ_ARGS['k']),
        sample_size=str(ALL_REQ_ARGS['sample_size']),
        predictor_type=str(ALL_REQ_ARGS['predictor_type']),
        dimension_reduction_type='sign',
        dimension_reduction_target='2',
        index_type='faiss.Flat',
        index_metric='COSINE',
        faiss_index_ivf_nlists='auto',
        faiss_index_pq_m='1'
    )
Ejemplo n.º 2
0
def test_all_hyperparameters_classifier(sagemaker_session):
    test_params = ALL_REQ_ARGS.copy()
    test_params['predictor_type'] = PREDICTOR_TYPE_CLASSIFIER

    knn = KNN(sagemaker_session=sagemaker_session,
              dimension_reduction_type='fjlt', dimension_reduction_target='2', index_type='faiss.IVFFlat',
              index_metric='L2', faiss_index_ivf_nlists='20', **test_params)
    assert knn.hyperparameters() == dict(
        k=str(ALL_REQ_ARGS['k']),
        sample_size=str(ALL_REQ_ARGS['sample_size']),
        predictor_type=str(PREDICTOR_TYPE_CLASSIFIER),
        dimension_reduction_type='fjlt',
        dimension_reduction_target='2',
        index_type='faiss.IVFFlat',
        index_metric='L2',
        faiss_index_ivf_nlists='20'
    )
Ejemplo n.º 3
0
def test_all_hyperparameters_regressor(sagemaker_session):
    knn = KNN(sagemaker_session=sagemaker_session,
              dimension_reduction_type='sign',
              dimension_reduction_target='2',
              index_type='faiss.Flat',
              index_metric='COSINE',
              faiss_index_ivf_nlists='auto',
              faiss_index_pq_m=1,
              **ALL_REQ_ARGS)
    assert knn.hyperparameters() == dict(
        k=str(ALL_REQ_ARGS['k']),
        sample_size=str(ALL_REQ_ARGS['sample_size']),
        predictor_type=str(ALL_REQ_ARGS['predictor_type']),
        dimension_reduction_type='sign',
        dimension_reduction_target='2',
        index_type='faiss.Flat',
        index_metric='COSINE',
        faiss_index_ivf_nlists='auto',
        faiss_index_pq_m='1')
Ejemplo n.º 4
0
def test_all_hyperparameters_regressor(sagemaker_session):
    knn = KNN(sagemaker_session=sagemaker_session,
              dimension_reduction_type="sign",
              dimension_reduction_target="2",
              index_type="faiss.Flat",
              index_metric="COSINE",
              faiss_index_ivf_nlists="auto",
              faiss_index_pq_m=1,
              **ALL_REQ_ARGS)
    assert knn.hyperparameters() == dict(
        k=str(ALL_REQ_ARGS["k"]),
        sample_size=str(ALL_REQ_ARGS["sample_size"]),
        predictor_type=str(ALL_REQ_ARGS["predictor_type"]),
        dimension_reduction_type="sign",
        dimension_reduction_target="2",
        index_type="faiss.Flat",
        index_metric="COSINE",
        faiss_index_ivf_nlists="auto",
        faiss_index_pq_m="1",
    )
Ejemplo n.º 5
0
def test_all_hyperparameters_classifier(sagemaker_session):
    test_params = ALL_REQ_ARGS.copy()
    test_params['predictor_type'] = PREDICTOR_TYPE_CLASSIFIER

    knn = KNN(sagemaker_session=sagemaker_session,
              dimension_reduction_type='fjlt',
              dimension_reduction_target='2',
              index_type='faiss.IVFFlat',
              index_metric='L2',
              faiss_index_ivf_nlists='20',
              **test_params)
    assert knn.hyperparameters() == dict(
        k=str(ALL_REQ_ARGS['k']),
        sample_size=str(ALL_REQ_ARGS['sample_size']),
        predictor_type=str(PREDICTOR_TYPE_CLASSIFIER),
        dimension_reduction_type='fjlt',
        dimension_reduction_target='2',
        index_type='faiss.IVFFlat',
        index_metric='L2',
        faiss_index_ivf_nlists='20')
Ejemplo n.º 6
0
def test_all_hyperparameters_classifier(sagemaker_session):
    test_params = ALL_REQ_ARGS.copy()
    test_params["predictor_type"] = PREDICTOR_TYPE_CLASSIFIER

    knn = KNN(sagemaker_session=sagemaker_session,
              dimension_reduction_type="fjlt",
              dimension_reduction_target="2",
              index_type="faiss.IVFFlat",
              index_metric="L2",
              faiss_index_ivf_nlists="20",
              **test_params)
    assert knn.hyperparameters() == dict(
        k=str(ALL_REQ_ARGS["k"]),
        sample_size=str(ALL_REQ_ARGS["sample_size"]),
        predictor_type=str(PREDICTOR_TYPE_CLASSIFIER),
        dimension_reduction_type="fjlt",
        dimension_reduction_target="2",
        index_type="faiss.IVFFlat",
        index_metric="L2",
        faiss_index_ivf_nlists="20",
    )