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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,756 | # model = Sequential()
# model.add(Conv2D(filters = 32, kernel_size = (5,5), padding = 'Same', activation = 'linear', input_shape = (96, 96, 1)))
# model.add(LeakyReLU(alpha=.001))
# model.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model.add(Dropout(0.7))
# model.add(Flatten())
# model.add(Dense(256, activation ... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,757 | # model2 = Sequential()
# model2.add(Conv2D(filters = 64, kernel_size = (4,4), padding = 'Same', activation = 'linear', input_shape = (96, 96, 1)))
# model2.add(LeakyReLU(alpha=.001))
# model2.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model2.add(Dropout(0.5))
# model2.add(Flatten())
# model2.add(Dense(256, acti... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,758 | # model3 = Sequential()
# model3.add(Conv2D(filters = 128, kernel_size = (5,5), padding = 'Same', activation = 'linear', input_shape = (96, 96, 1)))
# model3.add(LeakyReLU(alpha=.001))
# model3.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model3.add(Dropout(0.5))
# model3.add(Flatten())
# model3.add(Dense(256, act... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,759 | # np.random.seed(777)
# model4 = Sequential()
# model4.add(Conv2D(filters = 64, kernel_size = (5,5), padding = 'Same', activation = 'elu', input_shape = (96, 96, 1)))
# model4.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model4.add(Dropout(0.3))
# model4.add(Conv2D(filters = 64, kernel_size = (5,5), padding = 'S... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,760 | # np.random.seed(777)
# model5 = Sequential()
# model5.add(Conv2D(filters = 32, kernel_size = (4,4), padding = 'Same', activation = 'relu', input_shape = (96, 96, 1)))
# model5.add(Conv2D(filters = 64, kernel_size = (4,4), padding = 'Same', activation = 'relu'))
# model5.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,761 | # np.random.seed(777)
# model6 = Sequential()
# model6.add(Conv2D(filters = 64, kernel_size = (5,5), padding = 'Same', activation = 'elu', input_shape = (96, 96, 1)))
# model6.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model6.add(Dropout(0.3))
# model6.add(Conv2D(filters = 32, kernel_size = (4,4), padding = 'S... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,762 | # np.random.seed(777)
# model7 = Sequential()
# model7.add(Conv2D(filters = 64, kernel_size = (5,5), padding = 'Same', activation = 'relu', input_shape = (96, 96, 1)))
# model7.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model7.add(Dropout(0.5))
# model7.add(Conv2D(filters = 32, kernel_size = (4,4), padding = '... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,763 | # np.random.seed(777)
# model8 = Sequential()
# model8.add(Conv2D(filters = 64, kernel_size = (6,6), padding = 'Same', activation = 'relu', input_shape = (96, 96, 1)))
# model8.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model8.add(Dropout(0.3))
# model8.add(Conv2D(filters = 32, kernel_size = (4,4), padding = '... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 4 | 0 | 0 | 0 | 20 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,764 | # np.random.seed(777)
# model9 = Sequential()
# model9.add(Conv2D(filters = 128, kernel_size = (5,5), padding = 'Same', activation = 'linear', input_shape = (96, 96, 1)))
# model9.add(LeakyReLU(alpha=.001))
# model9.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
# model9.add(Dropout(0.5))
# model9.add(Flatten())
# mo... | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 2 | 0 | 0 | 0 | 10 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,766 | # model.compile(optimizer = 'adam', loss = 'mse', metrics = ['mae', 'accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,767 | # model2.compile(optimizer = 'adam', loss = 'mse', metrics = ['mae', 'accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,768 | # model3.compile(optimizer = 'adam', loss = 'mse', metrics = ['mae', 'accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,769 | # model4.compile(optimizer = 'adam', loss = 'mse', metrics = ['mae', 'accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,770 | # model5.compile(loss='mse', optimizer='adam', metrics = ['accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,771 | # model6.compile(loss='mse', optimizer='adam', metrics = ['accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,772 | # model7.compile(loss='mse', optimizer='adam', metrics = ['accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,773 | # model8.compile(loss='mse', optimizer='adam', metrics = ['accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,774 | # model9.compile(loss='mse', optimizer='adam', metrics = ['accuracy']) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,777 | # time1 = time.time()
# model.fit(x, y, epochs=100, batch_size=128, validation_split=0.2)
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,778 | # time1 = time.time()
# model2.fit(x, y, epochs=100, batch_size=100, validation_split=0.3)
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,779 | # time1 = time.time()
# model3.fit(x, y, epochs=100, batch_size=100, validation_split=0.2)
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,780 | # time1 = time.time()
# model4.fit(x, y, epochs=100, batch_size=100, validation_split=0.25)
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,781 | # time1 = time.time()
# history = model5.fit(x, y, validation_split=0.3, epochs=100, batch_size=100, verbose=1, callbacks=[early_stopping_callback, checkpointer])
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,782 | # time1 = time.time()
# history = model6.fit(x, y, validation_split=0.3, epochs=100, batch_size=100, verbose=1, callbacks=[early_stopping_callback, checkpointer])
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,783 | # time1 = time.time()
# history = model7.fit(x, y, validation_split=0.3, epochs=100, batch_size=100, verbose=1, callbacks=[early_stopping_callback, checkpointer])
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,784 | # time1 = time.time()
# history = model8.fit(x, y, validation_split=0.3, epochs=100, batch_size=100, verbose=1, callbacks=[early_stopping_callback, checkpointer])
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,785 | # time1 = time.time()
# history = model9.fit(x, y, validation_split=0.2, epochs=100, batch_size=100, verbose=1, callbacks=[early_stopping_callback, checkpointer])
# time2 = time.time()
# print('Learning Finished!')
# chk_processting_time(time1, time2) | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,793 | # !pip install kaggle | 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 |
7,794 | # !pip show kaggle | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,795 | # !kaggle config path | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,796 | # ! kaggle competitions submit -c facial-keypoints-detection -f predict.csv -m'submission | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,797 | # !kaggle competitions submissions -c facial-keypoints-detection | No | 5 | 76 | Debug | commented | 2,213,549 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
7,843 | '''df=pd.get_dummies(df,columns=[ 'Month',
'District'],drop_first=True)
df=pd.get_dummies(df,columns=[ 'Year'],drop_first=True)
#df_test=pd.get_dummies(df_test,columns=['DayOfWeek','PdDistrict','Year','Month','Day','Hour','Minute'],drop_first=True)
'''
| No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,844 | """df_test=pd.get_dummies(df_test,columns=[ \'Month\',
\'District\'],drop_first=True)
df_test=pd.get_dummies(df_test,columns=[ \'Year\'],drop_first=True)""" | 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,845 | #df=df[['Hour', 'Day', 'Month', 'Year', 'Address',
# 'District','X','radial60','Intersection']] | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,846 | #df=pd.get_dummies(df,columns=[ 'Hour'],drop_first=True)
| No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,847 | #df_test=pd.get_dummies(df_test,columns=[ 'Hour'],drop_first=True) | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,848 | #df.columns.nunique() | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,849 | #df_test.columns.nunique() | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,852 | '''import lightgbm as lgb
model5= lgb.LGBMClassifier(objective='multiclass')
model5.fit(X_train,y_train)
y_final=model5.predict_proba(X_test)
print (log_loss(y_test,y_final));''' | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 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"] | 2 | A |
7,911 | #print (log_loss(y_test,y_pred)); | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 0 | 0 | 0 | 0 | 0 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,912 | """temp = data[\'Category\']
le.fit_transform(temp)
le.classes_
""" | 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,913 | # y_pred= pd.DataFrame(y_pred, index=Id_test,columns = le.classes_)
| No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,914 | #from sklearn.linear_model import LogisticRegression
#weight={Address:3,District:3,X:1,Day:2}
#weight={LARCENY/THEFT:35}
#classifier = LogisticRegression(penalty='l1',random_state = 0,class_weight='balanced',multi_class='multinomial', solver='saga',n_jobs=-1)
#classifier = LogisticRegression(random_state=0, penalty='l1... | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,915 | #y_pred=model.predict_proba(X_test) | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
7,916 | """from sklearn.neighbors import KNeighborsClassifier
knn = KNeighborsClassifier(algorithm=\'auto\', leaf_size=60, metric=\'minkowski\',
metric_params=None, n_jobs=1, n_neighbors=5, p=2,
weights=\'uniform\')
knn.fit(X_train[0:100000], y_train[0:100000])
"""
| 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,917 | #y_pred=knn.predict_proba(X_test) | No | 5 | 76 | Debug | commented | 2,236,557 | 1 | A | 1 | 0 | 0 | 0 | 5 | 0 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 2 | A |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.