6472faf3787ff54159f6bc6441054f31bc8340e2,test/unit_test/test_kmeans_model.py,,,#,177

Before Change



// ------------------------- Special test suite --------------------------------
// Create test DTM.
dtm_empty = pd.DataFrame()
// Create test id temp label map.
id_temp_label_map_empty = {}
// Create front end option for voronoi.
// noinspection PyTypeChecker
front_end_option_special = KMeansOption(
    viz="wrong",
    n_init=10,
    k_value=2,
    max_iter=100,
    tolerance=1e-4,
    init_method=KMeansInit.k_means
)
// Pack all test components.
test_option_empty = KMeansTestOptions(
    doc_term_matrix=dtm_empty,
    front_end_option=front_end_option_special,
    id_temp_label_map=id_temp_label_map_empty
)
// Create empty K-Means test.
test_empty = KMeansModel(test_options=test_option_empty)
// -----------------------------------------------------------------------------
// Create dtm special.
dtm_special = pd.DataFrame(data=[[1, 2], [1, 2]],
                           index=[0, 1],
                           columns=["A", "B"])
// Create test id temp label map.
id_temp_label_map_special = {0: "F1.txt", 1: "F2.txt"}
// Create special front end option.
test_option_special = KMeansTestOptions(
    doc_term_matrix=dtm_special,
    front_end_option=front_end_option_special,
    id_temp_label_map=id_temp_label_map_special
)
// Create special K-Means test.
test_special = KMeansModel(test_options=test_option_special)


class TestSpecialCase:

After Change


    index=np.array([0, 1, 2, 3]),
    columns=np.array(["A", "B", "C", "D", "E", "F", "G", "H"]))
// Create test id temp label map.
id_temp_label_map_threeD = \
    {0: "F1.txt", 1: "F2.txt", 2: "F3.txt", 3: "F4.txt"}
// Create test front end option for 3D.
front_end_option_threeD = KMeansOption(
    viz=KMeansViz.three_d,
    n_init=10,
    k_value=2,
    max_iter=100,
    tolerance=1e-4,
    init_method=KMeansInit.k_means
)
// Pack all test components.
test_option_threeD = KMeansTestOptions(
    doc_term_matrix=dtm_twoD,
    front_end_option=front_end_option_threeD,
    id_temp_label_map=id_temp_label_map_threeD
)
// Create test Model and get test result.
test_threeD = KMeansModel(test_options=test_option_threeD)
// noinspection PyProtectedMember
threeD_result = test_threeD._get_3d_scatter_result()

// ------------------------- 3D scatter test suite -----------------------------
// Get plot result.
threeD_scatter = threeD_result.plot


class Test3DScatter:
    def test_layout(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 59

Instances


Project Name: WheatonCS/Lexos
Commit Name: 6472faf3787ff54159f6bc6441054f31bc8340e2
Time: 2018-06-18
Author: cusanelli_krisandra@wheatoncollege.edu
File Name: test/unit_test/test_kmeans_model.py
Class Name:
Method Name:


Project Name: WheatonCS/Lexos
Commit Name: 6472faf3787ff54159f6bc6441054f31bc8340e2
Time: 2018-06-18
Author: cusanelli_krisandra@wheatoncollege.edu
File Name: test/unit_test/test_kmeans_model.py
Class Name:
Method Name:


Project Name: WheatonCS/Lexos
Commit Name: d1dd828fc580e7388625bf6ad5ab4495783e2139
Time: 2018-06-18
Author: cusanelli_krisandra@wheatoncollege.edu
File Name: test/unit_test/test_kmeans_model.py
Class Name:
Method Name:


Project Name: WheatonCS/Lexos
Commit Name: 8c1fb3d50a2ffc6216d1f3ed4f783bcf0c0e8ea2
Time: 2018-06-18
Author: cusanelli_krisandra@wheatoncollege.edu
File Name: test/unit_test/test_kmeans_model.py
Class Name:
Method Name: