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
2,469
test=pd.read_csv('/kaggle/input/rossmann-store-sales/test.csv') test['Date']=pd.to_datetime(test['Date'],format='%Y-%m-%d') store_id=test.Store.unique()[0] store_test_rows=test[test['Store']==store_id] store_test_rows['Date'].min(),store_test_rows['Date'].max()
No
3
16
Data_Transform
data_type_conversions
6,511,403
1
A
0
0
0
0
0
5
ok
2
2
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}, {"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path d...
A
no applicable ML-specific findings
[]
["Column Selection Checker", "Hardcoded file path"]
9
A
2,470
print(test.isna().sum()) print(store.isna().sum())
No
5
39
EDA
count_missing_values
6,511,403
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,471
store['Promo2SinceWeek']=store['Promo2SinceWeek'].fillna(0) store['Promo2SinceYear']=store['Promo2SinceYear'].fillna(store['Promo2SinceYear'].mode().loc[0]) store['PromoInterval']=store['PromoInterval'].fillna(store['PromoInterval'].mode().iloc[0])
No
5
17
Data_Transform
correct_missing_values
6,511,403
1
A
0
0
0
0
0
3
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,472
store['CompetitionDistance']=store['CompetitionDistance'].fillna(store['CompetitionDistance'].max()) store['CompetitionOpenSinceMonth']=store['CompetitionOpenSinceMonth'].fillna(store['CompetitionOpenSinceMonth'].mode().iloc[0]) store['CompetitionOpenSinceYear']=store['CompetitionOpenSinceYear'].fillna(store['Competiti...
No
5
17
Data_Transform
correct_missing_values
null
1
A
0
0
0
0
0
3
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,473
data_merged=data.merge(store,on='Store',how='left') print(data.shape) print(data_merged.shape)
No
3
32
Data_Transform
merge
null
1
A
0
0
0
0
0
3
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,474
data_merged.isna().sum()
No
5
39
EDA
count_missing_values
6,511,403
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,475
data_merged['Date']=pd.to_datetime(data_merged['Date'],format='%Y-%m-%d') data_merged['day']=data_merged['Date'].dt.day data_merged['year']=data_merged['Date'].dt.year data_merged['month']=data_merged['Date'].dt.month
No
4
8
Data_Transform
feature_engineering
6,511,403
1
A
0
0
0
0
0
4
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,476
data_merged.info()
No
5
40
Debug
show_table_attributes
6,511,403
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,477
data_merged.StoreType.value_counts()
No
5
72
EDA
count_values
6,511,403
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,478
data_merged.StateHoliday.value_counts()
No
5
72
EDA
count_values
6,511,403
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,479
data_merged['StateHoliday']=data_merged['StateHoliday'].map({'0':0,0:0,'a':1,'b':2,'c':3}) data_merged['StateHoliday']=data_merged['StateHoliday'].astype(int)
No
4
20
Data_Transform
categorify
6,511,403
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,480
data_merged.Assortment.value_counts()
No
5
72
EDA
count_values
6,511,403
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,481
data_merged['Assortment']=data_merged['Assortment'].map({'a':0,'b':1,'c':2}) data_merged['Assortment']=data_merged['Assortment'].astype(int)
No
4
20
Data_Transform
categorify
6,511,403
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,482
data_merged['PromoInterval'].value_counts()
No
5
72
EDA
count_values
6,511,403
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,483
data_merged['PromoInterval']=data_merged['PromoInterval'].map({'Jan,Apr,Jul,Oct':1,'Feb,May,Aug,Nov':2,'Mar,Jun,Sept,Dec':3}) data_merged['PromoInterval']=data_merged['PromoInterval'].astype(int)
No
4
20
Data_Transform
categorify
6,511,403
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,484
data_merged['StoreType'].value_counts()
No
5
72
EDA
count_values
6,511,403
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,485
data_merged['StoreType']=data_merged['StoreType'].map({'a':1,'b':2,'c':3,'d':4}) data_merged['StoreType']=data_merged['StoreType'].astype(int)
No
5
20
Data_Transform
categorify
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,486
X=data_merged.drop('Sales',axis=1) y=data_merged.Sales
No
5
21
Data_Transform
prepare_x_and_y
6,511,403
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,487
X=data_merged.drop(['Sales','Date','Customers'],axis=1) y=data_merged.Sales X_train, X_test, y_train, y_test = train_test_split(X, np.log(y+1), test_size=0.2, random_state=1)
No
4
21
Data_Transform
prepare_x_and_y
6,511,403
1
A
0
0
0
0
0
3
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Checker", "fix": "Implement cross-validation techniques for robust model evaluation.", "benefits": "Enhances model performance and reduces overfitting.", "location": ""}]
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
[]
9
B
2,488
X_train.shape,X_test.shape,y_train.shape,y_test.shape
No
5
58
Debug
show_shape
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,489
from sklearn.tree import DecisionTreeRegressor as DTR from sklearn.ensemble import RandomForestRegressor as RFR
No
5
22
Environment
import_modules
6,511,403
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,490
model_dtr=DTR(max_depth=11,random_state=1).fit(X_train,y_train) y_pred=model_dtr.predict(X_test)
Yes
3
7
Model_Train
train_model
6,511,403
1
A
0
0
0
0
0
2
ok
8
7
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Checker", "fix": "Implement cross-validation techniques for robust model evaluation.", "benefits": "Enhances model performance and reduces overfitting.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLear...
B
Cross Validation Checker=low, Cross-validation not detected=low, Randomness Control Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}, {"type": "Randomness Control Checker", "severity": "low"}]
["Exception Handling Checker", "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness.", "Unit Testing Checker", "Verbose Mode Checker"]
9
B
2,491
y_test_inv=np.exp(y_test)-1 y_pred_inv=np.exp(y_pred)-1 print('RMSE',np.sqrt(mean_squared_error(y_test_inv,y_pred_inv))) print('Accuracy',r2_score(y_test_inv,y_pred_inv))
No
2
48
Model_Evaluation
predict_on_test
6,511,403
1
A
0
0
0
0
0
4
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Unit Testing Checker", "fix": "Write unit tests for data processing and model components.", "benefits": "Ensures code reliability and prevents bugs.", "location": ""}]
A
no applicable ML-specific findings
[]
["Unit Testing Checker"]
9
A
2,492
def ToWeight(y): w = np.zeros(y.shape, dtype=float) ind = y != 0 w[ind] = 1./(y[ind]**2) return w def rmspe(y, yhat): w = ToWeight(y) rmspe = np.sqrt(np.mean( w * (y - yhat)**2 )) return rmspe y_test_inv=np.exp(y_test)-1 y_pred_inv=np.exp(y_pred)-1 rmse_test = np.sqrt(mean_squared_error(y_...
No
5
49
Model_Evaluation
compute_test_metric
6,511,403
1
A
1
2
0
0
10
14
ok
4
3
[{"detector": "framework_specific", "framework": "NumPy", "name": "Missing Axis Specification", "fix": "Specify axis in array operations.", "benefits": "Improves performance and avoids unexpected behaviour.", "location": "Line 18"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Che...
C
Missing Axis Specification=medium
[{"type": "Missing Axis Specification", "severity": "medium"}]
["Column Selection Checker", "Missing function docstring"]
9
C
2,493
from sklearn.model_selection import GridSearchCV
No
5
22
Environment
import_modules
null
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
0
A
2,500
model_dtr.feature_importances_
No
5
79
Visualization
model_coefficients
6,511,403
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
9
A
2,501
store_avg_cust=data.groupby(['Store'])[['Customers']].mean().reset_index().astype(int) test_1=test.merge(store_avg_cust,on='Store',how='left') test.shape,test_1.shape test_merged=test_1.merge(store,on='Store',how='left') test_merged['Open']=test['Open'].fillna(1) test_merged['Date']=pd.to_datetime(test_merged['Date'],f...
Yes
2
32
Data_Transform
merge
6,511,403
1
A
0
0
0
0
0
17
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
9
A
2,502
test_pred=model_dtr.predict(test_merged[data_merged.columns.drop(['Sales','Date','Customers'])]) test_pred_inv=np.exp(test_pred)-1 submission_predicted=pd.DataFrame({'Id':test['Id'],'Sales':test_pred_inv}) submission_predicted.to_csv('submission.csv',index=False) submission_predicted.head()
Yes
4
48
Model_Evaluation
predict_on_test
6,511,403
1
A
0
0
0
0
0
5
ok
7
5
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Unit Testing...
B
No random seed setting detected=low
[{"type": "No random seed setting detected", "severity": "low"}]
["Column Selection Checker", "Exception Handling Checker", "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness.", "Unit Testing Checker"]
9
B
2,503
from sklearn.ensemble import AdaBoostRegressor
No
5
22
Environment
import_modules
null
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
0
A
2,504
import seaborn as sns import matplotlib.pyplot as plt
No
5
22
Environment
import_modules
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,505
store = pd.read_csv('/kaggle/input/rossmann-store-sales/store.csv') data = pd.read_csv('/kaggle/input/rossmann-store-sales/train.csv')
No
5
45
Data_Extraction
load_from_csv
6,511,414
1
A
0
0
0
0
0
2
ok
3
2
[{"detector": "general_ml", "framework": "General ML", "name": "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness.", "fix": "Not specified", "benefits": "Not specified", "location": ""}, {"detector": "general_ml", "framework": "General ML", "name": "Har...
A
no applicable ML-specific findings
[]
["Hardcoded file path", "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness."]
6
A
2,506
print(data.shape,store.shape)
No
5
58
Debug
show_shape
6,511,414
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
6
A
2,507
data=pd.read_csv('/kaggle/input/rossmann-store-sales/train.csv') store=pd.read_csv('/kaggle/input/rossmann-store-sales/store.csv') test=pd.read_csv('/kaggle/input/rossmann-store-sales/test.csv') print(data.shape) print(store.shape) print(test.shape)
No
4
45
Data_Extraction
load_from_csv
6,511,456
1
A
0
0
0
0
0
6
ok
4
2
[{"detector": "general_ml", "framework": "General ML", "name": "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness.", "fix": "Not specified", "benefits": "Not specified", "location": ""}, {"detector": "general_ml", "framework": "General ML", "name": "Har...
A
no applicable ML-specific findings
[]
["Hardcoded file path", "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness."]
5
A
2,508
train=pd.read_csv('/kaggle/input/rossmann-store-sales/train.csv') test=pd.read_csv('/kaggle/input/rossmann-store-sales/test.csv') store=pd.read_csv('/kaggle/input/rossmann-store-sales/store.csv')
No
5
45
Data_Extraction
load_from_csv
6,511,492
1
A
0
0
0
0
0
3
ok
4
2
[{"detector": "general_ml", "framework": "General ML", "name": "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness.", "fix": "Not specified", "benefits": "Not specified", "location": ""}, {"detector": "general_ml", "framework": "General ML", "name": "Har...
A
no applicable ML-specific findings
[]
["Hardcoded file path", "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness."]
7
A
2,509
print(train.shape) print(test.shape) print(store.shape)
No
5
58
Debug
show_shape
null
1
A
0
0
0
0
0
3
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,510
train['StateHoliday'].value_counts()
No
5
72
EDA
count_values
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,511
train.describe()[['Sales','Customers']]
No
5
40
Debug
show_table_attributes
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,512
train.describe()[['Sales','Customers']].loc['mean']
No
5
40
Debug
show_table_attributes
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Checker", "fix": "Implement cross-validation techniques for robust model evaluation.", "benefits": "Enhances model performance and reduces overfitting.", "location": ""}]
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
[]
7
B
2,513
train.describe()[['Sales','Customers']].loc['min']
No
5
40
Debug
show_table_attributes
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,514
train.describe()[['Sales','Customers']].loc['max']
No
5
40
Debug
show_table_attributes
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,515
train['Store'].value_counts().head(20)
No
5
41
Debug
show_table
6,511,492
1
A
0
0
0
0
0
1
ok
4
4
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Valida...
B
Cross Validation Checker=low, Cross-validation not detected=low, No random seed setting detected=low
[{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}, {"type": "No random seed setting detected", "severity": "low"}]
["Column Selection Checker"]
7
B
2,516
train['Store'].value_counts().tail(20)
No
5
41
Debug
show_table
6,511,492
1
A
0
0
0
0
0
1
ok
4
4
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Valida...
B
Cross Validation Checker=low, Cross-validation not detected=low, No random seed setting detected=low
[{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}, {"type": "No random seed setting detected", "severity": "low"}]
["Column Selection Checker"]
7
B
2,517
train['DayOfWeek'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
2
2
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Valida...
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
["Column Selection Checker"]
7
B
2,518
train['Open'].value_counts()
No
5
72
EDA
count_values
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,519
train['Promo'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
2
2
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Valida...
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
["Column Selection Checker"]
7
B
2,520
train['Date']=pd.to_datetime(train['Date'],format='%Y-%m-%d')
No
5
16
Data_Transform
data_type_conversions
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,521
store.isna().sum()
No
5
39
EDA
count_missing_values
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,522
store1=train[train['Store']==1]
No
5
14
Data_Transform
filter
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,523
store1.head()
No
5
41
Debug
show_table
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,524
store1.shape
No
5
58
Debug
show_shape
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,525
store1.resample('1d',on='Date')['Sales'].sum().plot.line(figsize=(15,5))
No
5
75
Visualization
time_series
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,526
store1[store1['Sales']==0]
No
5
14
Data_Transform
filter
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,527
test_store1=test[test['Store']==1] test_store1['Date']=pd.to_datetime(test_store1['Date'],format='%Y-%m-%d')
No
5
16
Data_Transform
data_type_conversions
6,511,492
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,528
test_store1['Date'].min(),test_store1['Date'].max()
No
5
40
Debug
show_table_attributes
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,529
test_store1['Open'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,530
import seaborn as sns import matplotlib.pyplot as plt plt.hist(store1['Sales'])
Yes
3
22
Environment
import_modules
6,511,492
1
A
0
0
0
0
0
3
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,531
store[store['Store']==1].T
No
5
14
Data_Transform
filter
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,532
store=pd.read_csv('/kaggle/input/rossmann-store-sales/store.csv')
No
5
45
Data_Extraction
load_from_csv
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/rossmann-store-sales/store.csv. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 8"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
7
A
2,533
store['Promo2SinceWeek']=store['Promo2SinceWeek'].fillna(0)
No
5
17
Data_Transform
correct_missing_values
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,534
store['Promo2SinceYear']=store['Promo2SinceYear'].fillna(store['Promo2SinceYear'].mode().iloc[0])
No
5
17
Data_Transform
correct_missing_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,535
store['PromoInterval']=store['PromoInterval'].fillna(store['PromoInterval'].mode().iloc[0])
No
5
17
Data_Transform
correct_missing_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,536
df=train.merge(store,on='Store',how='left')
No
5
32
Data_Transform
merge
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Checker", "fix": "Implement cross-validation techniques for robust model evaluation.", "benefits": "Enhances model performance and reduces overfitting.", "location": ""}]
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
[]
7
B
2,537
print(train.shape) print(df.shape)
No
5
58
Debug
show_shape
6,511,492
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,538
df.isna().sum()
No
5
39
EDA
count_missing_values
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,539
df.info()
No
5
40
Debug
show_table_attributes
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,540
df['day']=df['Date'].dt.day df['year']=df['Date'].dt.year df['month']=df['Date'].dt.month
No
5
8
Data_Transform
feature_engineering
6,511,492
1
A
0
0
0
0
0
3
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,542
#Dummies: StateHoliday,StoreType,Assortment,PromoInterval df['StateHoliday']=df['StateHoliday'].apply(lambda x:'0' if x==0 or x=='0' else x)
No
5
8
Data_Transform
feature_engineering
6,511,492
1
A
0
2
2
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,543
df['StateHoliday']=df['StateHoliday'].map({'0':0,'a':1,'b':2,'c':3}) df['StateHoliday']=df['StateHoliday'].astype(int)
No
4
20
Data_Transform
categorify
6,511,492
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,544
df['StoreType'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,545
df['StoreType']=df['StoreType'].map({'a':0,'b':1,'c':2,'d':3})
No
5
20
Data_Transform
categorify
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,546
df['Assortment']=df['Assortment'].map({'a':0,'b':1,'c':2})
No
5
20
Data_Transform
categorify
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,547
df['Assortment']=df['Assortment'].astype(int)
No
5
16
Data_Transform
data_type_conversions
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,548
df['PromoInterval'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,549
df['PromoInterval']=df['PromoInterval'].map({'Jan,Apr,Jul,Oct':0,'Feb,May,Aug,Nov':1,'Mar,Jun,Sept,Dec':2})
No
5
20
Data_Transform
categorify
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,550
df['PromoInterval']=df['PromoInterval'].astype(int)
No
5
16
Data_Transform
data_type_conversions
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,551
df=df.drop('Date',1)
No
5
10
Data_Transform
drop_column
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,552
y=np.log1p(df['Sales'])
No
5
21
Data_Transform
prepare_x_and_y
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,553
X=df.drop(['Sales','Customers'],1)
No
5
10
Data_Transform
drop_column
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,554
from sklearn.model_selection import train_test_split X_train,X_val,y_train,y_val=train_test_split(X,y,random_state=1,test_size=0.2)
No
5
13
Data_Transform
split
6,511,492
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Checker", "fix": "Implement cross-validation techniques for robust model evaluation.", "benefits": "Enhances model performance and reduces overfitting.", "location": ""}]
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
[]
7
B
2,555
y.plot.hist()
No
5
33
Visualization
distribution
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,556
from sklearn.tree import DecisionTreeRegressor dt=DecisionTreeRegressor(max_depth=11,random_state=1).fit(X_train,y_train)
No
3
7
Model_Train
train_model
6,511,492
2
B
1
0
0
0
5
2
ok
5
5
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Checker", "fix": "Implement cross-validation techniques for robust model evaluation.", "benefits": "Enhances model performance and reduces overfitting.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLear...
B
Cross Validation Checker=low, Randomness Control Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Randomness Control Checker", "severity": "low"}]
["Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"]
7
B
2,557
y_pred_val=dt.predict(X_val)
No
5
48
Model_Evaluation
predict_on_test
6,511,492
1
A
0
0
0
0
0
1
ok
2
2
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Unit Testing Checker", "fix": "Write unit tests for data processing and model components.", "benefits": "Ensures code reliability and prevents bugs.", "location": ""}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Excepti...
A
no applicable ML-specific findings
[]
["Exception Handling Checker", "Unit Testing Checker"]
7
A
2,558
from sklearn.metrics import r2_score,mean_squared_error print(r2_score(y_val,y_pred_val)) print(np.sqrt(mean_squared_error(y_val,y_pred_val)))
No
5
49
Model_Evaluation
compute_test_metric
6,511,492
1
A
0
0
0
0
0
3
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Unit Testing Checker", "fix": "Write unit tests for data processing and model components.", "benefits": "Ensures code reliability and prevents bugs.", "location": ""}]
A
no applicable ML-specific findings
[]
["Unit Testing Checker"]
7
A
2,559
y_val_exp=np.exp(y_val)-1 y_pred_val_exp=np.exp(y_pred_val)-1 np.sqrt(mean_squared_error(y_val_exp,y_pred_val_exp))
No
5
49
Model_Evaluation
compute_test_metric
6,511,492
1
A
0
0
0
0
0
3
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,560
r2_score(y_val_exp,y_pred_val_exp)
No
5
49
Model_Evaluation
compute_test_metric
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Unit Testing Checker", "fix": "Write unit tests for data processing and model components.", "benefits": "Ensures code reliability and prevents bugs.", "location": ""}]
A
no applicable ML-specific findings
[]
["Unit Testing Checker"]
7
A
2,561
draw_tree(dt,X_train.columns)
No
5
84
Other
not_enough_vertices
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,562
print(dt.feature_importances_) plt.barh(y=X_train.columns,width=dt.feature_importances_) plt.show()
No
5
79
Visualization
model_coefficients
6,511,492
1
A
0
0
0
0
0
3
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,563
avg_cust=df.groupby(['Store'])[['Customers']].mean().astype(int) test1=test.merge(avg_cust,on='Store',how='left')
Yes
3
60
Data_Transform
groupby
6,511,492
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,564
test.shape,test1.shape
No
5
58
Debug
show_shape
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,565
test_merged=test1.merge(store,on='Store',how='left')
No
5
32
Data_Transform
merge
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,566
test1.shape,test_merged.shape
No
5
58
Debug
show_shape
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,567
test_merged.head()
No
5
41
Debug
show_table
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
2,568
test_merged['Open'].fillna(1,inplace=True)
No
5
17
Data_Transform
correct_missing_values
6,511,492
1
A
0
0
0
0
0
1
ok
2
2
[{"detector": "framework_specific", "framework": "Pandas", "name": "InPlace Checker", "fix": "Assign operations to a new DataFrame variable.", "benefits": "Prevents data loss and improves code clarity.", "location": "Line 8"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker",...
A
no applicable ML-specific findings
[]
["Column Selection Checker", "InPlace Checker"]
7
A
2,569
test_merged.isna().sum()
No
5
39
EDA
count_missing_values
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,570
test_merged['Date']=pd.to_datetime(test_merged['Date'],format='%Y-%m-%d') test_merged['day']=test_merged['Date'].dt.day test_merged['month']=test_merged['Date'].dt.month test_merged['year']=test_merged['Date'].dt.year
No
5
8
Data_Transform
feature_engineering
6,511,492
1
A
0
0
0
0
0
4
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,571
test_merged=test_merged.drop('Date',1)
No
5
10
Data_Transform
drop_column
6,511,492
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
7
A
2,572
test_merged['StateHoliday']=test_merged['StateHoliday'].apply(lambda x:'0' if x==0 or x=='0' else x)
No
5
8
Data_Transform
feature_engineering
6,511,492
1
A
0
2
2
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,573
test_merged['StateHoliday'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,574
test_merged['StoreType'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A
2,575
test_merged['Assortment'].value_counts()
No
5
72
EDA
count_values
6,511,492
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker", "fix": "Select necessary columns after importing DataFrame.", "benefits": "Clarifies data usage and improves performance.", "location": ""}]
A
no applicable ML-specific findings
[]
["Column Selection Checker"]
7
A