3048096493b85388ca00fc87c052e99767bddfc3,examples/plot_digits.py,,,#,24

Before Change


// Create images for a custom tooltip array
tooltip_s = []
for image_data in data:
    output = io.BytesIO()
    img = toimage(image_data.reshape((8, 8)))  // Data was a flat row of 64 "pixels".
    img.save(output, format="PNG")
    contents = output.getvalue()
    img_encoded = base64.b64encode(contents)

After Change


// Create images for a custom tooltip array
tooltip_s = []
for image_data in data:
    with io.BytesIO() as output:
        img = Image.fromarray(image_data.reshape((8, 8)), "L")
        img.save(output, "PNG")
        contents = output.getvalue()
        img_encoded = base64.b64encode(contents)
        img_tag = <img src="data:image/png;base64,{}">.format(img_encoded.decode("utf-8"))
        tooltip_s.append(img_tag)

tooltip_s = np.array(tooltip_s)  // need to make sure to feed it as a NumPy array, not a list

// Initialize to use t-SNE with 2 components (reduces data to 2 dimensions). Also note high overlap_percentage.
mapper = km.KeplerMapper(verbose=2)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: MLWave/kepler-mapper
Commit Name: 3048096493b85388ca00fc87c052e99767bddfc3
Time: 2021-03-04
Author: dave@daveeargle.com
File Name: examples/plot_digits.py
Class Name:
Method Name:


Project Name: matplotlib/matplotlib
Commit Name: 39fb7b5b96ea46aca94099d166106365eaf0647e
Time: 2018-03-08
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/tests/test_backend_ps.py
Class Name:
Method Name: test_savefig_to_stringio


Project Name: lanpa/tensorboardX
Commit Name: f4a6c738beabc312a848804e5c4d4f384919f026
Time: 2020-06-29
Author: prafullasd@gmail.com
File Name: tensorboardX/summary.py
Class Name:
Method Name: audio


Project Name: pandas-dev/pandas
Commit Name: fc9fdba6592bdb5d0d1147ce4d65639acd897565
Time: 2021-02-12
Author: twoertwein@users.noreply.github.com
File Name: pandas/tests/io/parser/test_network.py
Class Name: TestS3
Method Name: test_read_csv_handles_boto_s3_object