This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import datasets | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.model_selection import train_test_split | |
import numpy as np | |
# prepare data | |
bc = datasets.load_breast_cancer() | |
X,y = bc.data,bc.target | |
n_samples,n_features = X.shape | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=1234) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
X = np.array( | |
[[1,2,3,1] | |
,[2,3,4,1] | |
,[3,4,5,1] | |
,[4,3,2,1] | |
,[12,13,14,1] | |
,[7,8,9,1] | |
,[5,2,10,1]] | |
,dtype=np.float32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# model = y = 2*x + 3 | |
X = np.array([1,2,3,4],dtype=np.float32) | |
Y = [(2*x + 3) for x in X] | |
w,b = 0.0,0.0 | |
def forward(x): | |
return w*x+b | |
def loss(y,y_pred): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide6.QtWidgets import ( | |
QApplication | |
,QMessageBox | |
,QWidget | |
,QLabel | |
,QPushButton | |
,QVBoxLayout | |
) | |
app = QApplication([]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from threading import Thread | |
from concurrent.futures import ThreadPoolExecutor,as_completed | |
def factorize(number): | |
result = [] | |
for i in range(1, number+1): | |
if number % i == 0: | |
result.append(i) | |
return result |
NewerOlder