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,683
from keras.models import Sequential from keras.layers import LSTM,Dense,Conv1D,MaxPool1D from keras.layers.embeddings import Embedding
No
5
22
Environment
import_modules
11,266,342
1
A
0
0
0
0
0
3
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
2
A
5,684
model.fit(X_train,Y_train, batch_size=256, epochs=10, verbose=2)
No
5
7
Model_Train
train_model
11,266,342
1
A
0
0
0
0
0
4
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
2
A
5,685
test = pd.read_csv("/kaggle/input/sentiment-analysis-on-movie-reviews/test.tsv.zip",sep="\\t") test'
No
5
45
Data_Extraction
load_from_csv
null
1
A
0
null
0
0
0
null
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,686
x_test = [] x_test = test['Phrase'] print(type(x_train)) x_test = np.asarray(x_test) print(type(x_test)) x_test.shape
No
5
21
Data_Transform
prepare_x_and_y
11,266,342
1
A
0
0
0
0
0
6
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"]
2
A
5,687
x_test = [rev.replace(",","").replace(".","").lower() for rev in x_test]
No
5
78
Data_Transform
string_transform
11,266,342
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
2
A
5,688
predicts = model.predict(X_test, batch_size=256, verbose=2)
No
5
48
Model_Evaluation
predict_on_test
11,266,342
1
A
0
0
0
0
0
3
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
2
A
5,689
predicts.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
5,690
out = pd.DataFrame(data=test.PhraseId,columns=['PhraseId']) out
No
5
12
Data_Transform
create_dataframe
11,266,342
1
A
0
0
0
1
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
2
A
5,691
out['Sentiment'] = preds_final out
No
5
55
Data_Export
prepare_output
11,266,342
1
A
0
0
0
1
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"]
2
A
5,692
out.to_csv('../working/submission.csv', index=False)
No
5
25
Data_Export
save_to_csv
11,266,342
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: ../working/submission.csv. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 3"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
2
A
5,693
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e....
No
4
88
Debug
list_files
null
1
A
0
2
3
0
0
9
ok
3
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 13"}, {"detector": "general_ml", "framework": "General ML", "name": "Hardcode...
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
0
A
5,694
b"\ndf_train = pd.read_csv(train_zip_file,sep='\\t')\ndf_train.head()"
No
4
45
Data_Extraction
load_from_csv
null
1
A
0
0
0
0
0
0
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,695
b"\ndf_test = pd.read_csv(test_zip_file, sep='\\t')\ndf_test.head()\n"
No
4
45
Data_Extraction
load_from_csv
null
1
A
0
0
0
0
0
0
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,696
import string from nltk.corpus import stopwords
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
5,697
def cleanup_message(message): messsage_pun = [ char for char in message if char not in string.punctuation] message_punc_join = ''.join(messsage_pun) message_punc_join_clean = [ word for word in message_punc_join.split() if word.lower() not in stopwords.words('english')] return message_punc_join_clean
No
5
78
Data_Transform
string_transform
11,354,257
1
A
0
3
0
0
0
5
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Missing docstring for function: cleanup_message. Consider adding documentation for parameters and return values.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 5"}]
A
no applicable ML-specific findings
[]
["Missing function docstring"]
4
A
5,698
from sklearn.feature_extraction.text import CountVectorizer vectorizer = CountVectorizer(analyzer=cleanup_message) train_vector = vectorizer.fit_transform(df_train['Phrase'])
No
4
22
Environment
import_modules
11,354,257
1
A
0
0
0
0
0
3
ok
6
6
[{"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...
D
Cross Validation Checker=low, Data Leakage Checker=high
[{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Data Leakage Checker", "severity": "high"}]
["Column Selection Checker", "Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"]
4
D
5,699
from sklearn.naive_bayes import MultinomialNB
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
5,700
multinomialnb = MultinomialNB()
No
5
4
Model_Train
choose_model_class
11,354,257
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
4
A
5,701
labels = df_train['Sentiment'].values
No
5
77
Other
define_variables
11,354,257
1
A
0
null
0
0
0
null
invalid_python
0
0
[]
null
invalid_python
[]
[]
4
null
5,702
multinomialnb.fit(train_vector,labels)
No
5
7
Model_Train
train_model
11,354,257
1
A
0
0
0
0
0
1
ok
4
4
[{"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
[{"type": "Cross Validation Checker", "severity": "low"}]
["Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"]
4
B
5,703
pharaseid = df_test["PhraseId"]
No
5
77
Other
define_variables
11,354,257
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"]
4
A
5,704
pharaseid
No
5
53
Other
something_strange
11,354,257
1
A
0
0
0
1
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
4
A
5,705
y1 = multinomialnb.predict(test_vector)
No
5
48
Model_Evaluation
predict_on_test
11,354,257
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"]
4
A
5,706
y1
No
3
41
Debug
show_table
null
1
A
0
0
0
1
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,707
dataframe=pd.DataFrame(y1, columns=['Sentiment'])
No
5
12
Data_Transform
create_dataframe
11,354,257
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
4
A
5,708
dataframe
No
5
12
Data_Transform
create_dataframe
null
1
A
0
0
0
1
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,709
result = pd.concat([pharaseid, dataframe], axis=1)
No
5
11
Data_Transform
concatenate
11,354,257
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
4
A
5,710
result.to_csv('sentiment_submission.csv',index=False)
No
5
25
Data_Export
save_to_csv
11,354,257
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
4
A
5,712
b"train = pd.read_csv('/kaggle/input/sentiment-analysis-on-movie-reviews/train.tsv.zip', '\\t')"
No
5
45
Data_Extraction
load_from_csv
null
1
A
0
0
0
0
0
0
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,713
b"test = pd.read_csv('/kaggle/input/sentiment-analysis-on-movie-reviews/test.tsv.zip','\\t')"
No
5
45
Data_Extraction
load_from_csv
null
1
A
0
0
0
0
0
0
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,714
train.isnull().sum() #no missing values
No
5
39
EDA
count_missing_values
12,981,020
1
A
0
0
0
0
0
1
ok
3
3
[{"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": "general_ml", "framework": "General ML", "name...
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"}]
[]
3
B
5,715
test.isnull().sum() #no missing values
No
5
39
EDA
count_missing_values
12,981,020
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,716
import seaborn as sns sns.set() sns.countplot(x='Sentiment',data=train)
No
4
33
Visualization
distribution
12,981,020
1
A
0
0
0
0
0
3
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,717
#drop unecessary columns train.drop(['PhraseId','SentenceId'],inplace = True,axis='columns')
No
5
10
Data_Transform
drop_column
12,981,020
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 5"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": "Cross Validation Chec...
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
["InPlace Checker"]
3
B
5,718
from keras.preprocessing.text import text_to_word_sequence #convert sentences to tokenized words for i in range(len(train['Phrase'])): train['Phrase'][i] = text_to_word_sequence(train['Phrase'][i])
No
5
78
Data_Transform
string_transform
12,981,020
1
A
0
1
1
0
0
3
ok
2
2
[{"detector": "framework_specific", "framework": "Pandas", "name": "Chain Indexing", "fix": "Use single indexing or .loc[], .iloc[] methods.", "benefits": "Enhances code readability and prevents performance issues.", "location": "Line 8"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Column Select...
A
no applicable ML-specific findings
[]
["Chain Indexing", "Column Selection Checker"]
3
A
5,719
from keras.preprocessing.text import Tokenizer #convert tokenized words to numeric form required for model building tokenizer = Tokenizer(num_words=5000) tokenizer.fit_on_texts(train['Phrase']) train['Phrase'] = tokenizer.texts_to_sequences(train['Phrase'])
No
5
8
Data_Transform
feature_engineering
12,981,020
1
A
0
0
0
0
0
4
ok
5
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": "Cross Valida...
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
["Column Selection Checker", "Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"]
3
B
5,720
submission = pd.DataFrame() submission['PhraseId'] = test['PhraseId']
No
5
55
Data_Export
prepare_output
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,721
test.drop(['PhraseId''SentenceId'])
No
5
10
Data_Transform
drop_column
12,981,020
1
A
1
0
0
0
1
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,722
X = train_copy y = pd.get_dummies(train['Sentiment'])
No
5
21
Data_Transform
prepare_x_and_y
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,723
from sklearn.model_selection import train_test_split X_train, X_val, y_train, y_val = train_test_split(X, y, test_size = 0.3)
No
5
13
Data_Transform
split
12,981,020
2
B
1
0
0
0
5
2
ok
2
2
[{"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"}]
[]
3
B
5,724
train_history=model.fit(x=X_train,y=y_train,batch_size=64,epochs=10,verbose=2,validation_data=(X_val,y_val))
No
5
7
Model_Train
train_model
12,981,020
1
A
0
0
0
0
0
1
ok
3
3
[{"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
[{"type": "Cross Validation Checker", "severity": "low"}]
["Exception Handling Checker", "Unit Testing Checker"]
3
B
5,725
import matplotlib.pyplot as plt plt.figure(figsize=(5,5)) plt.plot(train_history.history['accuracy'],'r',label='Training accuracy') plt.plot(train_history.history['val_accuracy'],'b',label='Validation accuracy') plt.legend()
No
5
35
Visualization
learning_history
12,981,020
1
A
0
0
0
0
0
5
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,726
prediction = model.predict(test_copy)
No
5
48
Model_Evaluation
predict_on_test
12,981,020
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"]
3
A
5,727
final_prediction = [np.argmax(i) for i in prediction]
No
5
77
Other
define_variables
12,981,020
1
A
0
0
0
0
0
1
ok
1
1
[{"detector": "framework_specific", "framework": "NumPy", "name": "Missing Axis Specification", "fix": "Specify axis in array operations.", "benefits": "Improves performance and avoids unexpected behaviour.", "location": "Line 4"}]
C
Missing Axis Specification=medium
[{"type": "Missing Axis Specification", "severity": "medium"}]
[]
3
C
5,728
submission['Sentiment'] = final_prediction submission.head()
No
4
41
Debug
show_table
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,729
submission.to_csv('../working/submission.csv', index=False)
No
5
25
Data_Export
save_to_csv
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,730
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
No
5
88
Debug
list_files
2,110,762
1
A
0
0
0
0
0
14
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: ../input. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 32"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
10
A
5,731
dataset = pd.read_csv("../input/train.csv", names=['Store','Dept','Date','weeklySales','isHoliday'],sep=',', header=0) features = pd.read_csv("../input/features.csv",sep=',', header=0, names=['Store','Date','Temperature','Fuel_Price','MarkDown1','MarkDown2','MarkDown3','MarkDown4', ...
No
4
45
Data_Extraction
load_from_csv
null
1
A
0
null
0
0
0
null
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,732
def scatter(dataset, column): plt.figure() plt.scatter(dataset[column] , dataset['weeklySales']) plt.ylabel('weeklySales') plt.xlabel(column)
No
5
33
Visualization
distribution
null
1
A
0
1
0
0
0
5
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,733
scatter(dataset, 'Fuel_Price') scatter(dataset, 'Size') scatter(dataset, 'CPI') scatter(dataset, 'Type') scatter(dataset, 'isHoliday') scatter(dataset, 'Unemployment') scatter(dataset, 'Temperature') scatter(dataset, 'Store') scatter(dataset, 'Dept')
No
5
33
Visualization
distribution
null
1
A
0
0
0
0
0
9
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,734
def calculate_error(test_y, predicted, weights): return mean_absolute_error(test_y, predicted, sample_weight=weights)
No
5
84
Other
not_enough_vertices
null
1
A
0
1
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,735
dataset_test = pd.get_dummies(dataset_test, columns=["Type"]) dataset_test[['MarkDown1','MarkDown2','MarkDown3','MarkDown4', 'MarkDown5']] = dataset_test[['MarkDown1','MarkDown2','MarkDown3','MarkDown4','MarkDown5']].fillna(0) dataset_test = dataset_test.fillna(0) column_date = dataset_test['Date'] dataset_test['Month'...
No
4
17
Data_Transform
correct_missing_values
null
1
A
0
null
0
0
0
null
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,736
predicted_test = best_model.predict(dataset_test)
No
5
48
Model_Evaluation
predict_on_test
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,737
dataset_test['weeklySales'] = predicted_test dataset_test['Date'] = column_date dataset_test['id'] = dataset_test['Store'].astype(str) + '_' + dataset_test['Dept'].astype(str) + '_' + dataset_test['Date'].astype(str) dataset_test = dataset_test[['id', 'weeklySales']] dataset_test = dataset_test.rename(columns={'id': ...
No
3
8
Data_Transform
feature_engineering
null
1
A
0
0
0
0
0
5
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,738
dataset_test.to_csv('output.csv', index=False)
No
5
25
Data_Export
save_to_csv
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,739
train=pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/train.csv") train.head()
No
4
45
Data_Extraction
load_from_csv
6,213,142
1
A
0
0
0
0
0
2
ok
2
2
[{"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": "general_ml", "framework": "General ML", "name...
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
["Hardcoded file path"]
3
B
5,740
test=pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/test.csv") test.head()
No
4
45
Data_Extraction
load_from_csv
6,213,142
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/walmart-recruiting-store-sales-forecasting/test.csv. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 4"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,741
y=train["Weekly_Sales"]
No
5
21
Data_Transform
prepare_x_and_y
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,742
train["Date"]=train["Date"].astype("datetime64") test["Date"]=test["Date"].astype("datetime64") train.dtypes
No
4
16
Data_Transform
data_type_conversions
null
1
A
0
0
0
0
0
3
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,743
#train["day of week"]=train["Date"].dt.dayofweek #test["day of week"]=test["Date"].dt.dayofweek train["month"]=train["Date"].dt.month test["month"]=test["Date"].dt.month train["day"]=train["Date"].dt.day test["day"]=test["Date"].dt.day train["year"]=train["Date"].dt.year test["year"]=test["Date"].dt.year
No
5
8
Data_Transform
feature_engineering
null
1
A
1
0
0
0
5
6
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,745
import matplotlib.pyplot as plt import seaborn as sns A,B=plt.subplots(1,1,figsize=(10,10)) sns.boxplot(train["month"],train["Weekly_Sales"])
No
5
75
Visualization
time_series
null
1
A
0
0
0
0
0
4
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,746
train=pd.merge(train,store) test=pd.merge(test,store)
No
5
32
Data_Transform
merge
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,747
train["Type"].unique()
No
5
57
Debug
show_unique_values
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,748
train["Type"]=train["Type"].replace({"A":1,"B":2,"C":3}) test["Type"]=test["Type"].replace({"A":1,"B":2,"C":3})
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
5,749
train=train.drop(["Weekly_Sales","Date"],axis=1) train.head()
No
4
10
Data_Transform
drop_column
null
1
A
0
0
0
0
0
2
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,750
tesst=test.drop(["Date"],axis=1) test.head()
No
5
10
Data_Transform
drop_column
6,213,142
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,751
#from lightgbm import LGBMRegressor #lgb=LGBMRegressor() #lgb.fit(train,y) from sklearn.ensemble import RandomForestRegressor rf=RandomForestRegressor(n_estimators=100, n_jobs=-1) rf.fit(train,y)
No
5
7
Model_Train
train_model
null
3
C
3
0
0
0
15
3
ok
6
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"]
0
C
5,752
sample=pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/sampleSubmission.csv") sample.head()
No
4
7
Model_Train
train_model
6,213,142
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/walmart-recruiting-store-sales-forecasting/sampleSubmission.csv. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 4"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,753
sample["Weekly_Sales"]=value
No
5
8
Data_Transform
feature_engineering
null
1
A
0
0
0
0
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,754
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
No
4
88
Debug
list_files
null
1
A
0
null
0
0
0
null
invalid_python
0
0
[]
null
invalid_python
[]
[]
0
null
5,755
pd.read_csv('/kaggle/input/walmart-recruiting-store-sales-forecasting/sampleSubmission.csv').head()
No
5
45
Data_Extraction
load_from_csv
6,457,885
1
A
0
0
0
0
0
1
ok
2
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."]
17
A
5,756
X_train = pd.read_csv('/kaggle/input/walmart-recruiting-store-sales-forecasting/train.csv') stores = pd.read_csv('/kaggle/input/walmart-recruiting-store-sales-forecasting/stores.csv') features = pd.read_csv('/kaggle/input/walmart-recruiting-store-sales-forecasting/features.csv') X_train = X_train.merge(stores, on='Stor...
No
4
45
Data_Extraction
load_from_csv
6,457,885
2
B
3
0
0
0
15
7
ok
11
9
[{"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 22"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Column Selection Checker"...
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", "Data Augmentation Checker", "Hardcoded file path", "InPlace Checker", "Logging Checker", "No error handling detected in data processing. Consider adding try-except blocks or validation checks for robustness."]
17
B
5,757
X_train['Date'].dtype
No
5
70
Debug
show_data_types
6,457,885
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"]
17
A
5,758
train=pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/train.csv.zip") train.head()
Yes
4
45
Data_Extraction
load_from_csv
8,322,473
1
A
0
0
0
0
0
2
ok
2
2
[{"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": "general_ml", "framework": "General ML", "name...
B
Cross Validation Checker=low
[{"type": "Cross Validation Checker", "severity": "low"}]
["Hardcoded file path"]
3
B
5,759
test=pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/test.csv.zip") test.head()
Yes
5
45
Data_Extraction
load_from_csv
8,322,473
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/walmart-recruiting-store-sales-forecasting/test.csv.zip. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 4"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,760
tesst=test.drop(["Date"],axis=1) tesst.head()
Yes
3
10
Data_Transform
drop_column
8,322,473
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,761
sample=pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/sampleSubmission.csv.zip") sample.head()
Yes
4
7
Model_Train
train_model
8,322,473
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/walmart-recruiting-store-sales-forecasting/sampleSubmission.csv.zip. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 4"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,762
sample.to_csv("20200309.csv",index=False)
No
5
25
Data_Export
save_to_csv
8,322,473
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,763
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
Yes
5
88
Debug
list_files
8,666,356
1
A
0
2
3
0
0
7
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 15"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,764
train = pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/train.csv.zip",parse_dates=["Date"]) test = pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/test.csv.zip",parse_dates=["Date"])
No
5
45
Data_Extraction
load_from_csv
8,666,356
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."]
3
A
5,765
add = pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/features.csv.zip") add.head()
Yes
4
45
Data_Extraction
load_from_csv
8,666,356
1
A
0
0
0
0
0
2
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/walmart-recruiting-store-sales-forecasting/features.csv.zip. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 4"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,766
store = pd.read_csv("/kaggle/input/walmart-recruiting-store-sales-forecasting/stores.csv") store
Yes
5
45
Data_Extraction
load_from_csv
8,666,356
1
A
0
0
0
1
0
2
ok
1
1
[{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/walmart-recruiting-store-sales-forecasting/stores.csv. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 4"}]
A
no applicable ML-specific findings
[]
["Hardcoded file path"]
3
A
5,767
import seaborn as sns import matplotlib.pyplot as plt ax = sns.barplot(x="Type", y="Size", hue="Type", data=store) sns.catplot(x="Type", kind="count", palette="ch:.25", data=store)
No
5
33
Visualization
distribution
8,666,356
1
A
0
0
0
0
0
4
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,768
train = pd.merge(train,store,on = "Store",how="left") test = pd.merge(test,store,on = "Store",how="left")
No
5
32
Data_Transform
merge
8,666,356
1
A
0
0
0
0
0
2
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,769
train["year"] = train["Date"].dt.year train["month"] = train["Date"].dt.month train["day"] = train["Date"].dt.day train["week"] = train["Date"].dt.week test["year"] = test["Date"].dt.year test["month"] = test["Date"].dt.month test["day"] = test["Date"].dt.day test["week"] = test["Date"].dt.week
No
5
8
Data_Transform
feature_engineering
8,666,356
1
A
0
0
0
0
0
8
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"]
3
A
5,770
train["Type"] = train["Type"].replace({"A":0,"B":1,"C":2}) test["Type"] = test["Type"].replace({"A":0,"B":1,"C":2})
No
5
20
Data_Transform
categorify
8,666,356
1
A
0
0
0
0
0
2
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"]
3
B
5,771
def wmae(y_pred, targ, holiday_week): sumOfWeights = 0 sumofCol_B_X_Col_E = 0 for i in range(0, len(y_pred)): weight = 0 if holiday_week[i]: weight = 5 else: weight = 1 Col_B_X_Col_E = abs(targ[i] - y_pred[i])*weight sumOfWeights...
No
5
84
Other
not_enough_vertices
8,666,356
1
A
3
3
4
0
6
14
ok
3
3
[{"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": "Magic number detected...
A
no applicable ML-specific findings
[]
["Column Selection Checker", "Magic number", "Missing function docstring"]
3
A
5,772
train.groupby("IsHoliday")["Weekly_Sales"].median()
No
3
40
Debug
show_table_attributes
8,666,356
1
A
0
0
0
0
0
1
ok
3
3
[{"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": "general_ml", "framework": "General ML", "name...
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"}]
[]
3
B
5,773
plt.figure(figsize=(10,6)) sns.barplot(train["IsHoliday"],train["Weekly_Sales"])
No
5
33
Visualization
distribution
8,666,356
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"]
3
A
5,774
train.groupby("Type")["Weekly_Sales"].mean()
No
4
40
Debug
show_table_attributes
8,666,356
1
A
0
0
0
0
0
1
ok
3
3
[{"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": "general_ml", "framework": "General ML", "name...
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"}]
[]
3
B
5,775
plt.figure(figsize=(10,6)) sns.barplot(train["Type"],train["Weekly_Sales"])
No
5
33
Visualization
distribution
8,666,356
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"]
3
A
5,776
plt.figure(figsize=(10,6)) sns.boxplot(train["year"],train["Weekly_Sales"],showfliers=False)
No
5
75
Visualization
time_series
8,666,356
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"]
3
A
5,777
plt.figure(figsize=(10,6)) sns.boxplot(train["Store"],train["Weekly_Sales"],showfliers=False)
No
5
33
Visualization
distribution
8,666,356
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"]
3
A
5,778
plt.figure(figsize=(10,6)) sns.boxplot(train["Dept"],train["Weekly_Sales"],showfliers=False)
No
5
33
Visualization
distribution
8,666,356
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"]
3
A
5,779
feature = ["Store","Dept","year","month","day","week","IsHoliday", "Size"]
No
5
77
Other
define_variables
8,666,356
1
A
0
0
0
0
0
1
ok
0
0
[]
A
no applicable ML-specific findings
[]
[]
3
A
5,780
X_train = train[feature] X_test = test[feature]
No
5
21
Data_Transform
prepare_x_and_y
8,666,356
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"]
3
A
5,781
X_train
No
5
41
Debug
show_table
null
1
A
0
0
0
1
0
1
no_ml_import
0
0
[]
null
no_ml_import
[]
[]
0
null
5,782
y_train = train["Weekly_Sales"]
No
5
21
Data_Transform
prepare_x_and_y
8,666,356
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"]
3
A
5,783
from sklearn.model_selection import train_test_split X_train1, X_test1, y_train1, y_test1 = train_test_split(X_train,y_train, test_size=0.2)
Yes
5
13
Data_Transform
split
8,666,356
2
B
1
0
0
0
5
2
ok
2
2
[{"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"}]
[]
3
B
5,784
%%time from sklearn.ensemble import RandomForestRegressor model = RandomForestRegressor(n_estimators=10,n_jobs=4)
Yes
5
4
Model_Train
choose_model_class
8,666,356
1
A
0
null
0
0
0
null
invalid_python
0
0
[]
null
invalid_python
[]
[]
3
null