-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_file.py
78 lines (48 loc) · 1.59 KB
/
test_file.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# from MizuQuruma.KNearestNeighbours import KNN
# import numpy as np
# from icecream import ic
# model = KNN(regression_mode=True)
# X_train, y_train, X_test, y_test = model.generate_dataset(n_samples=200)
# model.fit(X_train, y_train)
# prediction = model.predict(X_test)
# print(prediction)
# #
# evaluation = model.evaluate(X_test, y_test)
# print(evaluation)
# model.save_model()
# model = model.load_model()
# evaluation = model.evaluate(X_test, y_test)
# print(evaluation)
# my_plot = model.plot_data(X_test, y_test)
# my_plot.show()
# # ---
# import requests
# def get_crypto_price(symbol):
# url = (
# f"https://api.coingecko.com/api/v3/simple/price?ids={symbol}&vs_currencies=usd"
# )
# response = requests.get(url)
# data = response.json()
# return data[symbol]["usd"]
# bitcoin_price = get_crypto_price("bitcoin")
# print("Bitcoin Price:", bitcoin_price)
# from MizuQuruma.Regression import LinearRegression
# from icecream import ic
# import numpy as np
# model = LinearRegression()
# X_train, y_train, X_test, y_test = model.generate_dataset(
# coeff=[2], intercept=5, n_features=1, n_samples=15
# )
# ic(X_train)
# ic(y_train)
# model.fit(X_train, y_train, num_iterations=200, verbosity=1)
# evaluation = model.evaluate(X_test, y_test, evaluation_metric="mse")
# print(evaluation)
# ic(coeff, intercept, loss)
from MizuQuruma.Regression import LogisticRegression
from icecream import ic
model = LogisticRegression()
X_train, y_train = model.generate_dataset(n_samples=10)
weights, bias = model.fit(X_train, y_train, num_iterations=1000)
ic(weights)
ic(bias)