M
M
Makfroy2019-07-29 13:11:36
Python
Makfroy, 2019-07-29 13:11:36

How to display API data correctly?

Hello, the task is: Display the reader's list of lending from the OPAC system.
There is a program that displays a list with book names and authors https://github.com/spb201/opac-api. It is working, but you need to display a list of the reader's lending.
API documentation: https://opac-global.ru/public/swagger/opac-global-... Required
identifier:
readerId

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danil, 2017-11-20
@DanilBaibak

 Let's go in order:
1. Add color to identify clusters:

clusters = KMeans(n_clusters=6).fit_predict(X)

plt.scatter(X[:, 0], X[:, 1], c=[matplotlib.cm.spectral(float(i) /10) for i in cluster.labels_])

2. KMeans is an example of unsupervised learning. If you had class labels in advance, you would apply linear regression, for example :) In order to understand how well clustering is, you can plot the results of the algorithm on a graph, which is what you want to do.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question