id int64 0 7.95k | code_block stringlengths 1 52.9k | too_long stringclasses 2
values | marks int64 1 5 | graph_vertex_id float64 1 88 | graph_vertex_class stringclasses 12
values | graph_vertex_subclass stringclasses 70
values | kernel_id float64 25.8k 14.7M ⌀ | sqale_rating float64 1 4 | maintainability_rating stringclasses 4
values | code_smells int64 0 36 | complexity float64 0 15 ⌀ | cognitive_complexity int64 0 33 | bugs int64 0 7 | sqale_index int64 0 125 | ncloc float64 0 101 ⌀ | mlscent_analysis_status stringclasses 3
values | mlscent_smell_count int64 0 31 | mlscent_unique_smell_count int64 0 12 | mlscent_findings_json stringlengths 2 7.76k | mlscent_ml_rating stringclasses 5
values | mlscent_ml_rating_basis stringclasses 52
values | mlscent_ml_findings_json stringclasses 50
values | mlscent_ignored_findings_json stringclasses 199
values | context_line_count int64 0 33 | combined_rating stringclasses 5
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,581 | # test = pd.read_csv("../input/test.tsv", sep=\ | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,631 | #train_data = train.drop(['Phrase'], axis=1)\n#test_data = test.drop(['Phrase'], axis=1) | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,711 | #np.savetxt("outpu.csv", y1, delimiter=",")\n | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,744 | #train["day of week"].value_counts() | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,791 | #grid_search.fit(X_train, y_train) | No | 5 | 76 | Debug | commented | 8,666,356 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
5,793 | #!pip install xgboost | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,797 | #from sklearn.model_selection import GridSearchCV\n#from sklearn.model_selection import ShuffleSplit | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,798 | '''\nxgb1 = xg_reg\nparameters = {'nthread':[3], #when use hyperthread, xgboost may become slower\n 'objective':['reg:linear'],\n 'learning_rate': [.03, 0.05, .07], #so called `eta` value\n 'max_depth': [5, 6, 7],\n 'min_child_weight': [4],\n 'silent': [1... | No | 5 | 76 | Debug | commented | null | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,799 | '''xg_reg = xgb.XGBRegressor(colsample_bytree= 0.7, learning_rate= 0.07, max_depth= 5, min_child_weight= 4, n_estimators= 300, nthread= 4, objective= 'reg:linear', silent= 1, subsample=0.7)''' | No | 5 | 76 | Debug | commented | 8,666,356 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
5,800 | '''xg_reg.fit(X_train,y_train)\n\nresult = xg_reg.predict(X_test)''' | No | 5 | 76 | Debug | commented | null | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,834 | # sub_prev_year_median.to_csv('submission_prev_year.csv',index=False)\n# FileLink('submission_prev_year.csv') | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,838 | # sub_prev_year_median.to_csv('sub_median_60.csv',index=False)\n# FileLink('sub_median_60.csv') | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,876 | #world_population = pd.read_csv("/kaggle/input/population-by-country-2020/population_by_country_2020.csv")\n#display(world_population.head()) #for next round | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,968 | # ## Add 1-year `Weekly_Sales` lag ##\n\n# X_all = pd.concat([X_train, X_test])\n# X_all['Date2'] = pd.to_datetime(X_all['Date'], utc = True)\n# X_all['52_Week_Lag'] = X_all['Date2'] - np.timedelta64(52,'W')\n# X_all_temp = X_all[['Weekly_Sales', 'Date2', 'Store', 'Dept']]\n\n# X_all = X_all.merge(X_all_temp,\n# ... | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,969 | # X_train['Date2'] = pd.to_datetime(X_train['Date'], utc = True)\n# X_test['Date2'] = pd.to_datetime(X_test['Date'], utc = True)\n\n# X_train['Weekly_Sales_Lag_52_Weeks'] = X_train.merge(X_all, \n# left_on=['Store', 'Dept', 'Date2'], \n# ... | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,971 | # sns.set(style="ticks", color_codes=True)\n\n# for col in X_train.columns.drop(\ | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,980 | ## takes too long ## | No | 5 | 76 | Debug | commented | 6,457,885 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 17 | A |
5,981 | # hist = pd.DataFrame(history.history)\n# hist.plot() | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,982 | ## create 1-year lag value of store sales (can't use 1-week as test set doesn't have any `Weekly_Sales` ##\n## X_train ends at 2012-10-26 and X_test ends at 2013-07-26, so no NaN values for `Weekly_Sales_Lag` in X_test ## | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
5,983 | # X_all = pd.concat([X_train, X_test])\n# X_all.tail() | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
6,013 | ### GridSearchCV test
#X_test, _ = loadData(test, test = True)
#prediction = grid_search.predict(X_test) | No | 5 | 76 | Debug | commented | 67,301 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 5 | A |
6,014 | ### RF validation
'''
X_train, X_test, y_train, y_test = train_test_split(X, new_y, test_size = 0.33, random_state = 42)
rf = RandomForestRegressor()
rf.fit(X_train, y_train)
prediction = rf.predict(X_test)
mean_squared_error(y_test, prediction)
''' | No | 5 | 76 | Debug | commented | 67,301 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 5 | A |
6,711 | # standizer = StandardScaler()
# data[np.array(data.columns[:])] = standizer.fit_transform(data[np.array(data.columns[:])])
# test[np.array(test.columns[:])] = standizer.transform(test[np.array(test.columns[:])])
| No | 5 | 76 | Debug | commented | 1,274,949 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | ok | 1 | 1 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Dependent Threshold Checker", "fix": "Use threshold-independent metrics alongside threshold-dependent ones.", "benefits": "Provides a comprehensive evaluation of model performance.", "location": ""}] | A | no applicable ML-specific findings | [] | ["Dependent Threshold Checker"] | 15 | A |
6,713 | # rbs = RobustScaler()
# data[np.array(data.columns[:])] = rbs.fit_transform(data[np.array(data.columns[:])])
# test[np.array(test.columns[:])] = rbs.fit_transform(test[np.array(test.columns[:])]) | No | 5 | 76 | Debug | commented | 1,274,949 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | ok | 1 | 1 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Dependent Threshold Checker", "fix": "Use threshold-independent metrics alongside threshold-dependent ones.", "benefits": "Provides a comprehensive evaluation of model performance.", "location": ""}] | A | no applicable ML-specific findings | [] | ["Dependent Threshold Checker"] | 15 | A |
6,714 | # pca = PCA()
# data[np.array(data.columns[:])] = pca.fit_transform(data[np.array(data.columns[:])])
# test[np.array(test.columns[:])] = pca.fit_transform(test[np.array(test.columns[:])]) | No | 5 | 76 | Debug | commented | 1,274,949 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | ok | 1 | 1 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Dependent Threshold Checker", "fix": "Use threshold-independent metrics alongside threshold-dependent ones.", "benefits": "Provides a comprehensive evaluation of model performance.", "location": ""}] | A | no applicable ML-specific findings | [] | ["Dependent Threshold Checker"] | 15 | A |
6,715 | # krc = KernelCenterer()
# data[np.array(data.columns[:])] = krc.fit_transform(data[np.array(data.columns[:])])
# test[np.array(test.columns[:])] = krc.transform(test[np.array(test.columns[:])]) | No | 5 | 76 | Debug | commented | 1,274,949 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | ok | 1 | 1 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Dependent Threshold Checker", "fix": "Use threshold-independent metrics alongside threshold-dependent ones.", "benefits": "Provides a comprehensive evaluation of model performance.", "location": ""}] | A | no applicable ML-specific findings | [] | ["Dependent Threshold Checker"] | 15 | A |
6,716 | # kf = KFold(n_splits=5,shuffle=True)
# random_forest_acc = 0
# adaboost_acc = 0
# extraRandom_acc = 0
# svm_acc = 0
# gradientBoosting_acc = 0
# for train_index, test_index in kf.split(data):
# X_train = data.filter(items=train_index, axis=0)
# X_test = data.filter(items=test_index, axis=0)
# y_tr... | No | 5 | 76 | Debug | commented | 1,274,949 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | ok | 1 | 1 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Dependent Threshold Checker", "fix": "Use threshold-independent metrics alongside threshold-dependent ones.", "benefits": "Provides a comprehensive evaluation of model performance.", "location": ""}] | A | no applicable ML-specific findings | [] | ["Dependent Threshold Checker"] | 15 | A |
6,723 | #feature selection
# from sklearn.feature_selection import SelectKBest
# from sklearn.feature_selection import chi2
# select = SelectKBest(chi2, k=6)
# train = select.fit_transform(train, train_labels)
# test = select.transform(test)
# from sklearn.feature_selection import VarianceThreshold
# sel = VarianceThreshold(t... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,724 | # #linearSVM (1)
# linearSVM_clf = svm.SVC(kernel='linear', C=1).fit(train_normalized,train_labels)
# #acc1=cross_val_score(clf, train_normalized, train_labels, cv=20, scoring='accuracy')
# trainpred=linearSVM_clf.predict(train_normalized)
# testpred=linearSVM_clf.predict(test_normalized)
# print(metrics.accuracy_sc... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 3 | 0 | 0 | 0 | 15 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,725 | # #rbfSVM (2)
# rbfSVM_clf = svm.SVC(kernel='rbf', C=1).fit(train_normalized,train_labels)
# #rbfSVM_acc=cross_val_score(rbfSVM_clf, train_normalized, train_labels, cv=20, scoring='accuracy')
# trainpred=rbfSVM_clf.predict(train_normalized)
# testpred=rbfSVM_clf.predict(test_normalized)
# print(metrics.accuracy_scor... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,728 | # #logReg (5)
# from sklearn.linear_model import LogisticRegression
# logReg= LogisticRegression().fit(train_normalized,train_labels)
# trainpred=logReg.predict(train_normalized)
# testpred=logReg.predict(test_normalized)
# print(metrics.accuracy_score(train_labels, trainpred))
# # logreg_acc=cross_val_score(logReg... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 5 | 0 | 0 | 0 | 25 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,729 | # #NearestCentroid (6)
# from sklearn.neighbors.nearest_centroid import NearestCentroid
# NC_clf = NearestCentroid()
# NC_clf.fit(train_normalized, train_labels)
# trainpred=NC_clf.predict(train_normalized)
# testpred=NC_clf.predict(test_normalized)
# print(metrics.accuracy_score(train_labels, trainpred))
# # NC_a... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 5 | 0 | 0 | 0 | 25 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,734 | # #SGD (11)
# from sklearn.linear_model import SGDClassifier
# sgd_clf = SGDClassifier(loss="hinge", penalty="l2").fit(train_normalized,train_labels)
# trainpred=clf.predict(train_normalized)
# print(metrics.accuracy_score(train_labels, trainpred))
# results.append(sgd_clf.predict(test_normalized))
| No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,736 | # #LDA (13)
# from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
# LDA_clf = LinearDiscriminantAnalysis().fit(train_normalized,train_labels)
# LDA_clf.fit(train_normalized,train_labels)
# trainpred=LDA_clf.predict(train_normalized)
# testpred=LDA_clf.predict(test_normalized)
# print(metrics.accura... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 6 | 0 | 0 | 0 | 30 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,737 | # #GaussianNB (14)
# from sklearn.naive_bayes import GaussianNB
# GNB_clf = GaussianNB()
# GNB_clf.fit(train_normalized,train_labels)
# trainpred=GNB_clf.predict(train_normalized)
# testpred=GNB_clf.predict(test_normalized)
# print(metrics.accuracy_score(train_labels, trainpred))
# # #GNB_acc = cross_val_score(GNB_c... | No | 5 | 76 | Debug | commented | 1,275,111 | 1 | A | 5 | 0 | 0 | 0 | 25 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 18 | A |
6,749 | # svmodel = svm.SVC(C=1, kernel="poly")
# svmodel.fit(main, labels) | No | 5 | 76 | Debug | commented | 1,278,958 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 16 | A |
6,750 | # sklearn.metrics.accuracy_score(labels, svmodel.predict(features)) | No | 5 | 76 | Debug | commented | 1,278,958 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 16 | A |
6,751 | # sklearn.metrics.accuracy_score(tlabels, svmodel.predict(sfeatures)) | No | 5 | 76 | Debug | commented | 1,278,958 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 16 | A |
6,752 | # cols = { \'PlayerID\': [i+901 for i in range(440)] , \'TARGET_5Yrs\': svmodel.predict(test_principalComponenta) }
# submission = pd.DataFrame(cols)
# submission.to_csv("submission.csv", index=False)
# submission | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
6,753 | inputf = features
# frst1 = IsolationForest(n_estimators=5)
# frst1.fit(inputf, labels)
# frst2 = IsolationForest(n_estimators=5)
# frst2.fit(inputf, labels)
# frst3 = IsolationForest(n_estimators=5)
# frst3.fit(inputf, labels)
# frst4 = IsolationForest(n_estimators=5)
# frst4.fit(inputf, labels)
# frst5 = IsolationFor... | Yes | 4 | 76 | Debug | commented | 1,278,958 | 3 | C | 1 | 0 | 0 | 0 | 5 | 1 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 16 | C |
6,754 | testf = sfeatures
# pred1 = frst1.predict(testf)
# pred2 = frst2.predict(testf)
# pred3 = frst3.predict(testf)
# pred4 = frst4.predict(testf)
# pred5 = frst5.predict(testf)
# pred6 = frst6.predict(testf)
# pred7 = frst7.predict(testf)
# pred8 = frst8.predict(testf)
# pred9 = frst9.predict(testf)
# pred10 = frst10.predi... | Yes | 4 | 76 | Debug | commented | 1,278,958 | 3 | C | 1 | 0 | 0 | 0 | 5 | 1 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 16 | C |
6,755 | # res1 = []
# for i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 in zip(pred1, pred2, pred3, pred4, pred5, pred6, pred7, pred8, pred9, pred10):
# j = np.sum([i1,i2,i3,i4,i5,i6,i7,i8,i9,i10])
# if j >= 5:
# res1.append(1)
# else:
# res1.append(0) | No | 5 | 76 | Debug | commented | 1,278,958 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 16 | A |
6,769 | # from keras.preprocessing import image
# from os import walk
# data=[]
# input_file_names=[]
# #####get the file names of the images to read them one by one
# for (dirpath, dirnames, filenames) in walk("../input/dogs-vs-cats-redux-kernels-edition/train"):
# input_file_names=filenames
# for x in input_file_names:
... | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,770 | # plt.imshow(data[5]) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,771 | # data=np.array(data)
# ####generating labels for the data
# labels=[]
# for x in input_file_names:
# if x.find("cat")>=0:
# labels.append(0)
# else:
# labels.append(1)
# ###checking if the labels are properly tagged or not,both the classes have equal images 12500 each
# a=np.array(labels)
# np... | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,772 | # #####rescaling the data
# data=data/255.
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,774 | # model=Sequential()
# model.add(Conv2D(64,kernel_size=(2,2),strides=(1,1),kernel_initializer=glorot_normal(seed=100),input_shape=(64,64,3) ))
# model.add(Conv2D(64,kernel_size=(2,2),strides=(1,1),kernel_initializer=glorot_normal(seed=100)))
# model.add(BatchNormalization())
# model.add(Activation("relu"))
# model.add(... | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 5 | 0 | 0 | 0 | 25 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,775 | ###train test split
# from sklearn.model_selection import train_test_split
# train_x,test_x,train_y,test_y=train_test_split(data,labels,test_size=0.2,random_state=100)
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,776 | # train_y.shape | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,777 | ####compiling the model
# o=optimizers.adam()
# model.compile(loss="binary_crossentropy",metrics=["accuracy"],optimizer=o)
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,778 | ####fitting the model
# H=model.fit(train_x,train_y,epochs=16,validation_split=0.2)
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,779 | # plt.plot(range(1,17),H.history["acc"])
# plt.plot(range(1,17),H.history["val_acc"])
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,780 | #####making predictions on the test data
# preds=model.predict_classes(test_x) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,781 | # sum(preds==test_y)/len(test_y) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,782 | # test_data=[]
# input_test_file_names=[]
# #####get the file names of the images to read them one by one
# for (dirpath, dirnames, filenames) in walk("../input/test"):
# input_test_file_names=filenames
# for x in input_test_file_names:
# img_file_name=x##getting name of the image file
# path=str("../input... | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,783 | # test_data=np.array(test_data)
# test_data=test_data/255. | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,784 | # test_preds=model.predict(test_data)
# test_preds=test_preds.reshape(len(test_preds)) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,785 | ####as per the submission file rule only numerical part from the file wwas needed
####like 3090.jpg should be saved in as 3090
# new_input_test_file_names=[]
# for x in input_test_file_names:
# k=int(x[0:x.find(".jpg")])
# new_input_test_file_names.append(k) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,786 | # df=pd.DataFrame({'id':new_input_test_file_names,
# 'label':test_preds}) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,787 | # df.to_csv("submission.csv",index=False) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,789 | # from keras.applications import resnet50
# from keras.preprocessing.image import ImageDataGenerator
# r=resnet50.ResNet50(weights='imagenet',include_top=False,input_shape=(197,197,3)) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,790 | #########33getting data in in sahpe of (197,197,3) as min reqrmnt of resnet 50
# from keras.preprocessing import image
# from os import walk
# data=[]
# input_file_names=[]
# #####get the file names of the images to read them one by one
# for (dirpath, dirnames, filenames) in walk("../input/dogs-vs-cats-redux-kernels-e... | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,791 | # data=np.array(data)
# ####generating labels for the data
# labels=[]
# for x in new_input_file_names:
# if x.find("cat")>=0:
# labels.append(0)
# else:
# labels.append(1)
# ###reshaping the labels
# a=np.array(labels)
# labels=a.reshape(14000,1) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,792 | # #########defining the new model by defining my own last layer
# new_model=r.output
# new_model=Flatten()(new_model)
# new_model=Dense(10)(new_model)
# new_model=Activation("relu")(new_model)
# new_model=Dense(1,activation="sigmoid")(new_model)
# final_model=Model(input=r.input,output=new_model)
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,793 | ###freezin all layers except from last 3 layers
# total_layers=len(final_model.layers)
# print(total_layers)
# for x in range(0,total_layers-4):
# final_model.layers[x].trainable=False
# final_model.layers | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,794 | ##checking if the layers have been frozen or not
# for x in range(0,total_layers):
# print(final_model.layers[x])
# print(final_model.layers[x].trainable) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,795 | ###train test split
# from sklearn.model_selection import train_test_split
# train_x,test_x,train_y,test_y=train_test_split(data,labels,test_size=0.2,random_state=100)
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,796 | ####compiling the model
# o=optimizers.adam()
# final_model.compile(loss="binary_crossentropy",metrics=["accuracy"],optimizer=o) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,797 | # final_model.fit(train_x,train_y,epochs=2,validation_split=0.2) | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,798 | # predicted_test=final_model.predict(train_x)
| No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,799 | ##########################trying vgg19 model################################### | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,808 | # final_model.save_weights("vgg_19.h5") | No | 5 | 76 | Debug | commented | 1,361,826 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 3 | A |
6,841 | #lrf= learn.lr_find() | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,842 | #learn.sched.plot_lr() | No | 5 | 76 | Debug | commented | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
6,843 | #learn.sched.plot() | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,844 | #learn.save('model1') | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,849 | #learn.save('model2') | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,850 | #learn.load('model2') | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,853 | #learn.save('model3') | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,855 | #tmpk= log_preds
#tmpk= log_preds[:,:,0]
#tmpk=tmpk.reshape(tmpk.shape[1],tmpk.shape[0]) | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,856 | #tmpk= [np.mean(i) for i in tmpk] | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,857 | #tmpk= [ np.exp(i) for i in tmpk] | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,864 | # model 2 mean 5.006981e-01 std 4.964828e-01 min 1.536870e-09 [0.025943222, 0.9912974683544303] | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,865 | #model 1 mean 5.014179e-01 std 4.955358e-01 min 2.701442e-08 [0.026336912, 0.991495253164557] | No | 5 | 76 | Debug | commented | 1,443,020 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
6,916 | # from sklearn.ensemble import RandomForestRegressor
# rfr = RandomForestRegressor(n_estimators=300, criterion='mae', max_depth=12, n_jobs=-1, verbose=True)
# rfr.fit(X_train.values, np.log(y_train.values) + 1)
# y_hat = rfr.predict(X_test.values)
# y_hat = np.exp(y_hat) - 1
# print(f'MAE: {mae(y_test, y_hat)}')
# p... | No | 5 | 76 | Debug | commented | 1,460,440 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 5 | A |
6,918 | # params = {'colsample_bytree': 0.7000000000000001,
# 'eta': 0.625,
# 'gamma': 0.8,
# 'max_depth': 6,
# 'eval_metric': 'rmse',
# 'min_child_weight': 6.0,
# 'n_estimators': 8.0, # 585
# 'silent': 1,
# 'subsample': 0.9500000000000001}
... | No | 5 | 76 | Debug | commented | 1,460,440 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 5 | A |
6,919 | # fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(20, 20));
# xgb.plot_importance(xgb_regressor, axes) | No | 5 | 76 | Debug | commented | 1,460,440 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 5 | A |
6,920 | # print("Validating")
# train_probs = xgb_regressor.predict(xtest)
# indices = train_probs < 0
# train_probs[indices] = 0
# error = rmspe(np.exp(train_probs) - 1, y_test.values)
# print(\'error\', error)
# xgb_regressor = xgb.train(params, xtest, 1000, feval=rmspe_xg, xgb_model=xgb_regressor) | No | 5 | 76 | Debug | commented | null | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
6,934 | # print(best_opts) | No | 5 | 76 | Debug | commented | 1,460,440 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 5 | A |
6,983 | #PMR3508 - Tarefa1 Adult
#hash: PMR3508-2018-d59e43f3c1 | No | 5 | 76 | Debug | commented | 1,527,751 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 1 | 1 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Dependent Threshold Checker", "fix": "Use threshold-independent metrics alongside threshold-dependent ones.", "benefits": "Provides a comprehensive evaluation of model performance.", "location": ""}] | A | no applicable ML-specific findings | [] | ["Dependent Threshold Checker"] | 4 | A |
7,156 | # This is based on Fujisan's kernel on Invasive Species Monitoring | No | 5 | 76 | Debug | commented | 1,617,863 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 4 | A |
7,243 | # Grid Search is an ideal candidate for distributed machine learning
# Pseudo code for hyperparameters Grid Search
'''
from sklearn.grid_search import ParameterGrid
param_grid = {'epochs': [5, 10, 15], 'steps_per_epoch' : [10, 20, 50]}
grid = ParameterGrid(param_grid)
# Accumulate history of all permutations (may be... | No | 5 | 76 | Debug | commented | null | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,310 | # Normalizar las imgenes (1pt)
#x_train = x_train.reshape([1712, 96*96])/255
#x_val = x_val.reshape([428, 96*96])/255
#x_train[0] #valores entre 0 y 1, usara una capa de batchnormalization en la red
#Se realiz esto en iteraciones previas, el resultado fue peor, se decide no scalar a [0,1] ni utilizar batch normaliza... | No | 5 | 76 | Debug | commented | null | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,316 | #labels_axis =np.array([['_x','_y']])
#labels_axis = np.repeat(labels_axis,26745,axis=0).flatten()
#labels_axis.shape | No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
7,317 | #labels= np.core.defchararray.add(labels_area, labels_axis)
#labels.shape | No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
7,318 | #ImageId = np.arange(1,1784)
#ImageId =np.repeat(ImageId, 30)
#ImageId.shape | No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
7,319 | #RowId=np.int32(np.arange(1,53491))
#RowId.shape | No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
7,321 | #sub = np.array([RowId,ImageId,labels,results])
#sub = np.swapaxes(sub,0,1)
#sub.shape | No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
7,322 | #sub_df = pd.DataFrame(data=sub,columns=['RowId','ImageId','FeatureName','Location'])
#sub_df.ImageId = pd.to_numeric(sub_df.ImageId)
| No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
7,324 | #sub_df[(sub_df['FeatureName'] == 'left_eye_center_x') & (sub_df['ImageId'] == 1)] | No | 5 | 76 | Debug | commented | 1,888,718 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 1 | A |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.