Currently I am using pyprind, a library that implements a progress bar:
#Compute training time elapsed
pbar = pyprind.ProgBar(45, width=120, bar_char='█')
for _ in range(45):
#Fiting
clf = SVC().fit(X_train, y_train)
pbar.update()
#End of bar
However, I do not know if that is the correct way to use the pbar
, since I guess I am fitting 45 times clf
. Thus, how should I use correctly pbar
?.
I haven't used pyprind
but I have used progressbar
. Just install it using-
pip install progressbar
And then -
from progressbar import ProgressBar
pbar = ProgressBar()
for x in pbar(range(45)):
clf = SVC().fit(X_train, y_train)
and you are good to go.
Note that if you want more information regarding the learning process you can use vebose
flag for that:
X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
y = np.array([1, 1, 2, 2])
clf = SVC(verbose =True)
clf.fit(X, y)
Output:
optimization finished, #iter = 12
obj = -1.253423, rho = 0.000003
nSV = 4, nBSV = 0
Total nSV = 4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With