from sklearn import datasets iris = datasets.load_iris() list(iris.keys()) X = iris["data"] y = (iris["target"] == 2).astype(np.int) # 1 if Iris-Virginica, else 0 #Ausgeweogenen Datensatz erstellen: 57 1, 143 0 Xshort1 = X[y==1] print(len(Xshort1)) yshort1 = y[y==1] Xshort0 = X[y==0][0:143,] print(len(Xshort0)) yshort0 = y[y==0][0:143,] Xshort=np.concatenate((Xshort1,Xshort0),axis=0) yshort=np.concatenate((yshort1,yshort0),axis=0) Xshort print("Hello World") Ich kenne einen guten Fahrrad-Witz. Aber den Fahrrad ich dir nicht. ()() ( . .) c(")(") def softmax (X) : A= np.exp(X), B=np.sum(np.exp(X)) return A/B def softmax(X): A = np.exp(X), # e^xi B = np.sum(A) # die Summe aller Elemente return A/B # e^xi geteilt durch die Summe aller Elemente