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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,552 | for i in df_train.groupby('weather').count().index:
s = 'w'+str(i)
a=[]
for j in df_train.weather:
if j==i:
a.append(1)
else:
a.append(0)
df_train[s]=a
df_train.sample(5) | Yes | 3 | 12 | Data_Transform | create_dataframe | 8,791,489 | 1 | A | 0 | 3 | 7 | 0 | 0 | 10 | 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"] | 8 | B |
4,553 | for i in df_train.groupby('Hour').count().index:
s = 'Hour'+str(i)
a=[]
for j in df_train.Hour:
if j==i:
a.append(1)
else:
a.append(0)
df_train[s]=a
df_train.sample(5) | Yes | 3 | 12 | Data_Transform | create_dataframe | 8,791,489 | 1 | A | 0 | 3 | 7 | 0 | 0 | 10 | 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"] | 8 | B |
4,554 | for i in df_train.groupby("Month").count().index:
s = 'Month' + str(i)
a = []
for j in df_train.Month:
if j==i:
a.append(1)
else:
a.append(0)
df_train[s] = a
df_train.sample(5)' | Yes | 3 | 12 | Data_Transform | create_dataframe | null | 1 | A | 0 | null | 0 | 0 | 0 | null | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,555 | df_train = df_train[['Hour0', 'Hour1', 'Hour2', 'Hour3', 'Hour4', 'Hour5',
'Hour6', 'Hour7', 'Hour8', 'Hour9', 'Hour10', 'Hour11', 'Hour12',
'Hour13', 'Hour14', 'Hour15', 'Hour16', 'Hour17', 'Hour18', 'Hour19',
'Hour20', 'Hour21', 'Hour22', 'Hour23','Month1', 'Month2', 'Month3',
'Month4', 'M... | No | 5 | 10 | Data_Transform | drop_column | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 7 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 8 | A |
4,556 | df_train_x = df_train.drop('casual',axis = 1).drop('registered',axis=1)
df_train_x.describe() | Yes | 4 | 10 | Data_Transform | drop_column | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | 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"}] | [] | 8 | B |
4,557 | df_reg_train_y = df_train['registered']
df_reg_train_y.describe | Yes | 5 | 40 | Debug | show_table_attributes | 8,791,489 | 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"] | 8 | A |
4,558 | df_cas_train_y = df_train['casual']
df_cas_train_y.describe | Yes | 4 | 40 | Debug | show_table_attributes | 8,791,489 | 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"] | 8 | A |
4,559 | x1_train, x1_test, y1_train, y1_test = train_test_split(df_train_x, df_reg_train_y,
test_size=0.15, random_state=42)
x2_train, x2_test, y2_train, y2_test = train_test_split(df_train_x, df_cas_train_y,
test_si... | No | 5 | 13 | Data_Transform | split | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 4 | 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, Cross-validation not detected=low | [{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}] | [] | 8 | B |
4,560 | poly = PolynomialFeatures(degree=2)
poly_x1_train = poly.fit_transform(x1_train)
poly_x1_test = poly.fit_transform(x1_test)
poly_x2_train = poly.fit_transform(x2_train)
poly_x2_test = poly.fit_transform(x2_test) | No | 5 | 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 |
4,561 | rf = RandomForestRegressor()
xg = xgb.XGBRegressor()
parameter = {"max_depth": [1,2,3,4,5,6],
"eta": [0.01,0.03,0.05],
"alpha":[0],'n_estimators': [100,500,800,1000,1200,1400]}
parameters = {'n_estimators':[50,100,150,200,250],
'min_impurity_decrease':[0.0,0.001,0.01],
... | Yes | 4 | 5 | Hyperparam_Tuning | define_search_space | null | 1 | A | 0 | null | 0 | 0 | 0 | null | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,562 | def custom_scorer(y_true,y_pred):
for i in range(len(y_pred)):
if y_pred[i]<0:
y_pred[i] = 1
return np.sqrt(mean_squared_log_error(y_true, y_pred ))
scorer = make_scorer(custom_scorer,greater_is_better = False) | No | 5 | 84 | Other | not_enough_vertices | null | 1 | A | 0 | 3 | 3 | 0 | 0 | 6 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,563 | predict = []
reg = LinearRegression().fit(x1_train, y1_train)
pre_reg = reg.predict(x1_test)
reg_poly = LinearRegression().fit(poly_x1_train, y1_train)
pre_reg_poly = reg_poly.predict(poly_x1_test)
rf_reg = GridSearchCV(rf, parameters, cv=5, verbose=2,scoring = scorer,n_jobs = -1)
rf_reg.fit(x1_train, y1_train)
pre_r... | Yes | 3 | 7 | Model_Train | train_model | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 15 | ok | 21 | 5 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Verbose Mode Checker", "fix": "Enable verbose mode for long training processes.", "benefits": "Provides better insights into model training progress.", "location": "Line 10"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": ... | B | No random seed setting detected=low | [{"type": "No random seed setting detected", "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"] | 8 | B |
4,564 | for prediction in range(len(predict)):
pre = []
for p in predict[prediction]:
if p < 1:
pre.append(1)
else:
pre.append(p)
print(models[prediction]+str(np.sqrt(mean_squared_log_error(y1_test, pre )))) | No | 3 | 49 | Model_Evaluation | compute_test_metric | null | 1 | A | 0 | 3 | 7 | 0 | 0 | 8 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,565 | predict = []
cas = LinearRegression().fit(x2_train, y2_train)
pre_cas = cas.predict(x2_test)
cas_poly = LinearRegression().fit(poly_x2_train, y2_train)
pre_cas_poly = cas_poly.predict(poly_x2_test)
rf_cas = GridSearchCV(rf, parameters, cv=5, verbose=2,scoring = scorer,n_jobs = -1)
rf_cas.fit(x2_train, y2_train)
pre_r... | Yes | 3 | 7 | Model_Train | train_model | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 15 | ok | 21 | 5 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Verbose Mode Checker", "fix": "Enable verbose mode for long training processes.", "benefits": "Provides better insights into model training progress.", "location": "Line 10"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": ... | B | No random seed setting detected=low | [{"type": "No random seed setting detected", "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"] | 8 | B |
4,566 | for prediction in range(len(predict)):
pre = []
for p in predict[prediction]:
if p < 1:
pre.append(1)
else:
pre.append(p)
print(models[prediction]+str(np.sqrt(mean_squared_log_error(y2_test, pre )))) | No | 3 | 49 | Model_Evaluation | compute_test_metric | null | 1 | A | 0 | 3 | 7 | 0 | 0 | 8 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,567 | print("For Random Forest Model: ")
print("\\t Best Parametres for registered are: ",end='')
print(rf_reg.best_params_)
print("\\t Best Parametres for casual are: ",end = '')
print(rf_cas.best_params_)
print("\
For XGBoost Model: ")
print("\\t Best Parametres for registered are: ",end='')
print(xg_reg.best_params_)
prin... | No | 2 | 2 | Hyperparam_Tuning | find_best_params | null | 1 | A | 0 | null | 0 | 0 | 0 | null | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,568 | predict1 = []
reg1 = LinearRegression().fit(x1_train, y1_train)
pre_reg1 = reg1.predict(x1_test)
reg1_poly = LinearRegression().fit(poly_x1_train, y1_train)
pre_reg1_poly = reg1_poly.predict(poly_x1_test)
rf1 = RandomForestRegressor(n_estimators = 250,min_impurity_decrease = 0.001,
max_de... | Yes | 2 | 7 | Model_Train | train_model | 8,791,489 | 1 | A | 0 | 6 | 10 | 0 | 0 | 37 | ok | 25 | 9 | [{"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, Randomness Control Checker=low | [{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}, {"type": "No random seed setting detected", "severity": "low"}, {"type": "Randomness Control Checker", "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", "Verbose Mode Checker"] | 8 | B |
4,569 | predict2 = []
reg2 = LinearRegression().fit(x2_train, y2_train)
pre_reg2 = reg2.predict(x2_test)
reg2_poly = LinearRegression().fit(poly_x2_train, y2_train)
pre_reg2_poly = reg2_poly.predict(poly_x2_test)
rf2 = RandomForestRegressor(n_estimators = 100,min_impurity_decrease = 0.001,
max_de... | No | 2 | 7 | Model_Train | train_model | 8,791,489 | 1 | A | 0 | 6 | 10 | 0 | 0 | 37 | ok | 25 | 9 | [{"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, Randomness Control Checker=low | [{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}, {"type": "No random seed setting detected", "severity": "low"}, {"type": "Randomness Control Checker", "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", "Verbose Mode Checker"] | 8 | B |
4,570 | name1 = ['Residual for casual without polynomial features'] *1633
name2 = ['Residual for casual with polynomial features'] *1633
name3 = ['Residual for registered without polynomial features'] *1633
name4 = ['Residual for registered with polynomial features'] *1633
dic = {'Lin': 'Output Predicted using linear model',
... | No | 5 | 56 | Visualization | plot_predictions | 8,791,489 | 1 | A | 2 | 0 | 0 | 0 | 13 | 34 | ok | 5 | 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 31"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Chain Indexi... | A | no applicable ML-specific findings | [] | ["Chain Indexing", "Column Selection Checker"] | 8 | A |
4,571 | name5 = ['Residual for casual using RandomForest Model'] *1633
name6 = ['Residual for casual using XGBoost Model'] *1633
name7 = ['Residual for registered using RandomForest Model'] *1633
name8 = ['Residual for registered using XGBoost Model'] *1633
dic = {'Lin': 'Output Predicted using linear model',
'Lin_poly... | No | 5 | 56 | Visualization | plot_predictions | 8,791,489 | 1 | A | 2 | 0 | 0 | 0 | 13 | 32 | ok | 5 | 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 31"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Chain Indexi... | A | no applicable ML-specific findings | [] | ["Chain Indexing", "Column Selection Checker"] | 8 | A |
4,572 | rf1 = RandomForestRegressor(n_estimators = 200,min_impurity_decrease = 0.001,
max_depth=80).fit(df_train_x,df_reg_train_y)
xg2 = xgb.XGBRegressor(alpha = 0, eta = 0.05, max_depth = 6,
n_estimators = 800).fit(df_train_x,df_cas_train_y) | No | 5 | 7 | Model_Train | train_model | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 4 | ok | 12 | 8 | [{"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, No random seed setting detected=low, Randomness Control Checker=low | [{"type": "Cross Validation Checker", "severity": "low"}, {"type": "Cross-validation not detected", "severity": "low"}, {"type": "No random seed setting 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"] | 8 | B |
4,573 | df_test = pd.read_csv('/kaggle/input/bike-sharing-demand/test.csv') | No | 5 | 45 | Data_Extraction | load_from_csv | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | ok | 1 | 1 | [{"detector": "general_ml", "framework": "General ML", "name": "Hardcoded file path detected: /kaggle/input/bike-sharing-demand/test.csv. Consider using configuration files or environment variables.", "fix": "Not specified", "benefits": "Not specified", "location": "Line 9"}] | A | no applicable ML-specific findings | [] | ["Hardcoded file path"] | 8 | A |
4,574 | test=df_test
test.describe() | No | 5 | 40 | Debug | show_table_attributes | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 8 | A |
4,575 | test['mth'] = pd.DatetimeIndex(test['datetime']).month
test['Year'] = pd.DatetimeIndex(test['datetime']).year
test['dy'] = pd.DatetimeIndex(test['datetime']).day
test['hr'] = pd.DatetimeIndex(test['datetime']).hour
for i in test.groupby("season").count().index:
s = 's' + str(i)
a = []
for j in test.season:... | Yes | 5 | 8 | Data_Transform | feature_engineering | null | 1 | A | 0 | null | 0 | 0 | 0 | null | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,576 | test = test[['Hour0','Hour1','Hour2','Hour3','Hour4','Hour5','Hour6','Hour7','Hour8',
'Hour9','Hour10','Hour11','Hour12','Hour13','Hour14','Hour15','Hour16',
'Hour17','Hour18','Hour19','Hour20','Hour21','Hour22','Hour23','Month1',
'Month2','Month3','Month4','Month5','Month6','Mont... | Yes | 5 | 40 | Debug | show_table_attributes | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 7 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 8 | A |
4,577 | pre_reg = rf1.predict(test)
pre_cas = xg2.predict(test)
final_predictions = pd.DataFrame(pre_cas+pre_reg,columns = ['cout'])
final_predictions.describe | Yes | 4 | 48 | Model_Evaluation | predict_on_test | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 4 | ok | 5 | 4 | [{"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... | B | No random seed setting detected=low | [{"type": "No random seed setting detected", "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"] | 8 | B |
4,578 | s=[]
for j in final_predictions.cout:
if int(j)<1:
s.append(1)
else:
s.append(j)
final_predictions['count'] = s | No | 2 | 78 | Data_Transform | string_transform | null | 1 | A | 0 | 2 | 4 | 0 | 0 | 7 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,579 | final_predictions.describe | 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 |
4,580 | final_predictions['datetime']=df_test['datetime']
final_predictions = final_predictions[['datetime','count']] | No | 5 | 55 | Data_Export | prepare_output | 8,791,489 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 8 | A |
4,581 | final_predictions.describe() | 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 |
4,582 | final_predictions.to_csv('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 |
4,583 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.filterwarnings("ignore") | No | 5 | 23 | Environment | set_options | 9,485,463 | 1 | A | 0 | null | 0 | 0 | 0 | null | invalid_python | 0 | 0 | [] | null | invalid_python | [] | [] | 10 | null |
4,584 | train = pd.read_csv("/kaggle/input/bike-sharing-demand/train.csv")
test = pd.read_csv("/kaggle/input/bike-sharing-demand/test.csv") | No | 5 | 45 | Data_Extraction | load_from_csv | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,585 | target = train['count'] | No | 3 | 12 | Data_Transform | create_dataframe | 9,485,463 | 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"] | 10 | A |
4,586 | from scipy import stats
from scipy.stats import norm | 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 |
4,587 | sns.distplot(train['count'],fit=norm) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,588 | train["log_count"] = np.log(target+1) | No | 5 | 8 | Data_Transform | feature_engineering | 9,485,463 | 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"] | 10 | A |
4,589 | sns.distplot(train["log_count"], fit=norm) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,590 | feature_names=list(test)
df_train=train[feature_names]
df=pd.concat((df_train, test)) | No | 4 | 11 | Data_Transform | concatenate | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 3 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,591 | print(train.shape, test.shape, df.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 |
4,592 | import datetime | No | 5 | 22 | Environment | import_modules | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,593 | tmp = pd.to_datetime(train['datetime']) | No | 5 | 16 | Data_Transform | data_type_conversions | 9,485,463 | 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"] | 10 | A |
4,594 | df['datetime'] = pd.to_datetime(df['datetime'])
df['day'] = df['datetime'].dt.day
df['hour'] = df['datetime'].dt.hour
df['dayofweek'] = df['datetime'].dt.dayofweek
df['month'] = df['datetime'].dt.month
df['year'] = df['datetime'].dt.year
df['weekend'] = (df['dayofweek'] ==5) | (df['dayofweek'] == 6) | No | 5 | 8 | Data_Transform | feature_engineering | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 7 | 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"] | 10 | A |
4,595 | train['datetime'] = pd.to_datetime(train['datetime'])
train['day'] = train['datetime'].dt.day
train['hour'] = train['datetime'].dt.hour
train['dayofweek'] = train['datetime'].dt.dayofweek
train['month'] = train['datetime'].dt.month
train['year'] = train['datetime'].dt.year
train['weekend'] = (train['dayofweek'] ==5) | ... | No | 4 | 8 | Data_Transform | feature_engineering | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 7 | 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"] | 10 | A |
4,596 | df.drop(['datetime'], axis=1, inplace=True) | No | 5 | 10 | Data_Transform | drop_column | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | ok | 1 | 1 | [{"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 11"}] | A | no applicable ML-specific findings | [] | ["InPlace Checker"] | 10 | A |
4,597 | figure, axs = plt.subplots(3,2, figsize = (15,10))
sns.barplot(data=train, x = "day", y = target, ax = axs[0][0])
sns.barplot(data=train, x = "hour", y = target, ax = axs[0][1])
sns.barplot(data=train, x = "dayofweek", y = target, ax = axs[1][0])
sns.barplot(data=train, x = "weekend", y = target, ax = axs[1][1])
sns.b... | No | 5 | 75 | Visualization | time_series | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 7 | 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"] | 10 | A |
4,598 | df=df.drop(columns=['month', 'day']) | No | 5 | 10 | Data_Transform | drop_column | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,599 | df | 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 |
4,600 | sns.barplot(data=df[:len(train)], x='season', y=target) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,601 | season_encoded = pd.get_dummies(df['season'],prefix= 'season')
df = pd.concat((df,season_encoded), axis=1)
df = df.drop(columns = 'season') | Yes | 4 | 20 | Data_Transform | categorify | 9,485,463 | 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"] | 10 | A |
4,602 | sns.barplot(data=df[:len(train)], x='holiday', y=target) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,603 | sns.barplot(data=df[:len(train)], x='workingday', y=target) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,604 | sns.barplot(data=df[:len(train)], x='weather', y=target)
df['weather'] = df['weather'] | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,605 | weather_encoded = pd.get_dummies(df['weather'],prefix= 'weather')
df = pd.concat((df,weather_encoded), axis=1)
df = df.drop(columns = 'weather') | Yes | 4 | 20 | Data_Transform | categorify | 9,485,463 | 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"] | 10 | A |
4,606 | fig, (ax1, ax2, ax3, ax4, ax5) = plt.subplots(nrows = 5)
fig.set_size_inches(20,30)
sns.pointplot(data = train, x = "hour", y = "count", ax = ax1)
sns.pointplot(data = train, x = "hour", y = "count", hue = "season", ax = ax2)
sns.pointplot(data = train, x = "hour", y = "count", hue = "holiday", ax = ax3)
sns.pointplot... | No | 5 | 75 | Visualization | time_series | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 7 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,607 | from scipy.stats import skew
skew = df.apply(lambda x: skew(x))
skew.sort_values(ascending = False) | Yes | 4 | 40 | Debug | show_table_attributes | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 3 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,608 | skew = skew[abs(skew) > 0.5]
skew | No | 5 | 14 | Data_Transform | filter | 9,485,463 | 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"] | 10 | A |
4,609 | cor = train.iloc[:,1:-1].corr()
cor.head() | No | 5 | 40 | Debug | show_table_attributes | 9,485,463 | 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"}] | [] | 10 | B |
4,610 | mask = np.array(cor)
mask[np.tril_indices_from(mask)] = False
fig,ax= plt.subplots()
fig.set_size_inches(20,10)
sns.heatmap(cor,mask= mask,square=True,annot=True) | No | 5 | 80 | Visualization | heatmap | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 5 | ok | 2 | 2 | [{"detector": "framework_specific", "framework": "NumPy", "name": "Array Creation Efficiency", "fix": "Specify dtype when creating arrays.", "benefits": "Improves memory efficiency and avoids unnecessary conversions.", "location": "Line 11"}, {"detector": "framework_specific", "framework": "Pandas", "name": "Column Sel... | A | no applicable ML-specific findings | [] | ["Array Creation Efficiency", "Column Selection Checker"] | 10 | A |
4,611 | from statsmodels.stats.outliers_influence import variance_inflation_factor | No | 5 | 22 | Environment | import_modules | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,612 | vif_data = df.iloc[:,:6]
vif_data.info() | Yes | 4 | 40 | Debug | show_table_attributes | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,613 | vif = pd.DataFrame()
vif['Features'] = vif_data.columns
vif['vif'] = [variance_inflation_factor(
vif_data.values, i) for i in range(vif_data.shape[1])]
vif.sort_values(by='vif',ascending=False) | Yes | 4 | 12 | Data_Transform | create_dataframe | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 5 | 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"] | 10 | A |
4,614 | sns.distplot(df['pca'], fit=norm) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,615 | fig, [ax1,ax2,ax3] = plt.subplots(1,3)
fig.set_size_inches(12,5)
sns.regplot(train['temp'], 'count', data = train, ax=ax1)
sns.regplot(train['humidity'], 'count', data = train, ax=ax2)
sns.regplot(train['windspeed'], 'count', data = train, ax=ax3) | No | 5 | 33 | Visualization | distribution | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 5 | 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"] | 10 | A |
4,616 | stats.pearsonr(train['temp'],target) | No | 4 | 47 | Model_Evaluation | statistical_test | 9,485,463 | 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"] | 10 | A |
4,617 | sns.countplot(data = df, x = "windspeed") | No | 5 | 33 | Visualization | distribution | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,618 | df = df.drop(columns=['temp','atemp']) | No | 5 | 10 | Data_Transform | drop_column | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,619 | fig, axes = plt.subplots(nrows=3, ncols=2, figsize = (15,20))
sns.boxplot(data = train, y="count", x = "holiday", orient = "v", ax = axes[0][0])
sns.boxplot(data = train, y="count", x = "workingday", orient = "v", ax = axes[0][1])
sns.boxplot(data = train, y="count", x = "hour", orient = "v", ax = axes[1][0])
sns.boxpl... | No | 5 | 33 | Visualization | distribution | 9,485,463 | 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"] | 10 | A |
4,620 | from sklearn.model_selection import KFold, cross_val_score, train_test_split, GridSearchCV
from sklearn.metrics import mean_squared_log_error
from sklearn.preprocessing import RobustScaler
from sklearn.pipeline import make_pipeline
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor
from xgboo... | No | 5 | 22 | Environment | import_modules | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 8 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,621 | new_train = df[:train.shape[0]]
new_test = df[train.shape[0]:] | No | 5 | 13 | Data_Transform | split | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,622 | target = train['log_count'] | No | 5 | 21 | Data_Transform | prepare_x_and_y | 9,485,463 | 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"] | 10 | A |
4,623 | X_train, X_val, y_train, y_val = train_test_split(new_train, target, test_size=0.2, shuffle=True) | No | 5 | 13 | Data_Transform | split | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,624 | def rmsle_score(preds, true):
rmsle_score = (np.sum((np.log1p(preds)-np.log1p(true))**2)/len(true))**0.5
return rmsle_score | No | 5 | 84 | Other | not_enough_vertices | null | 1 | A | 0 | 1 | 0 | 0 | 0 | 3 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,625 | from sklearn.metrics.scorer import make_scorer
RMSLE = make_scorer(rmsle_score) | Yes | 5 | 84 | Other | not_enough_vertices | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | 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"] | 0 | A |
4,626 | import statsmodels.api as sm | No | 5 | 22 | Environment | import_modules | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,627 | lasso = make_pipeline(GridSearchCV(Lasso(random_state=1),param,
cv=10, scoring = RMSLE)) | No | 5 | 53 | Other | something_strange | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 3 | 3 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Verbose Mode Checker", "fix": "Enable verbose mode for long training processes.", "benefits": "Provides better insights into model training progress.", "location": "Line 11"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": ... | A | no applicable ML-specific findings | [] | ["Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"] | 10 | A |
4,628 | lasso.fit(X_train,y_train) | No | 5 | 7 | Model_Train | train_model | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,629 | la_yhat = lasso.predict(X_val) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
4,630 | s_lasso = rmsle_score(la_yhat,y_val)
s_lasso | No | 5 | 49 | Model_Evaluation | compute_test_metric | 9,485,463 | 1 | A | 0 | 0 | 0 | 1 | 0 | 2 | 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"] | 10 | A |
4,631 | pred_la = lasso.predict(new_test) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
4,632 | param_e = {'alpha' :[0.1,1.0,10], 'max_iter' :[1000000], 'l1_ratio':[0.04,0.05],
'normalize':[True,False]} | No | 5 | 5 | Hyperparam_Tuning | define_search_space | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,633 | Enet.fit(X_train,y_train) | No | 5 | 7 | Model_Train | train_model | 9,485,463 | 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"] | 10 | B |
4,634 | Enet_yhat = Enet.predict(X_val) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
4,635 | s_Enet = rmsle_score(Enet_yhat,y_val)
s_Enet | No | 5 | 49 | Model_Evaluation | compute_test_metric | 9,485,463 | 1 | A | 0 | 0 | 0 | 1 | 0 | 2 | 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"] | 10 | A |
4,636 | pred_Enet = Enet.predict(new_test) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
4,637 | param_Rf = {'min_samples_split' : [3,4,6,10], 'n_estimators' : [70,100], 'random_state': [5] } | No | 5 | 5 | Hyperparam_Tuning | define_search_space | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,638 | RF = make_pipeline(GridSearchCV(RandomForestRegressor(random_state=1),param_Rf,
cv=10, scoring = RMSLE)) | No | 5 | 82 | Hyperparam_Tuning | define_search_model | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 4 | 3 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Verbose Mode Checker", "fix": "Enable verbose mode for long training processes.", "benefits": "Provides better insights into model training progress.", "location": "Line 11"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": ... | A | no applicable ML-specific findings | [] | ["Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"] | 10 | A |
4,639 | RF.fit(X_train,y_train) | No | 5 | 7 | Model_Train | train_model | null | 1 | A | 0 | 0 | 0 | 0 | 0 | 1 | no_ml_import | 0 | 0 | [] | null | no_ml_import | [] | [] | 0 | null |
4,640 | RF_yhat = RF.predict(X_val)
s_RF = rmsle_score(RF_yhat,y_val)
s_RF | No | 3 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 1 | A | 0 | 0 | 0 | 1 | 0 | 3 | 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"] | 10 | A |
4,641 | pred_RF = RF.predict(new_test) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
4,642 | param_GB = [{'learning_rate': [1,0.1,0.01,0.001],
'n_estimators': [50, 100, 200, 500, 1000]}] | No | 5 | 5 | Hyperparam_Tuning | define_search_space | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,643 | GB = make_pipeline(GridSearchCV(GradientBoostingRegressor(random_state=1),param_GB,
cv=10, scoring = RMSLE)) | No | 5 | 4 | Model_Train | choose_model_class | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 4 | 3 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Verbose Mode Checker", "fix": "Enable verbose mode for long training processes.", "benefits": "Provides better insights into model training progress.", "location": "Line 11"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": ... | A | no applicable ML-specific findings | [] | ["Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"] | 10 | A |
4,644 | GB.fit(X_train,y_train) | No | 5 | 7 | Model_Train | train_model | 9,485,463 | 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"] | 10 | B |
4,645 | GB_yhat = GB.predict(X_val)
s_GB = rmsle_score(GB_yhat,y_val)
s_GB | Yes | 3 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 1 | A | 0 | 0 | 0 | 1 | 0 | 3 | 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"] | 10 | A |
4,646 | pred_GB = GB.predict(new_test) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
4,647 | param_lgb = param_grid = [{
'n_estimators': [400, 700, 1000],
'max_depth': [15,20,25],
'num_leaves': [50, 100, 200],
'min_split_gain': [0.3, 0.4],
}] | No | 5 | 5 | Hyperparam_Tuning | define_search_space | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 6 | ok | 0 | 0 | [] | A | no applicable ML-specific findings | [] | [] | 10 | A |
4,648 | lgb = make_pipeline(GridSearchCV(LGBMRegressor(verbose_eval=False,random_state=1),param_lgb,
cv=10, scoring = RMSLE)) | No | 3 | 4 | Model_Train | choose_model_class | 9,485,463 | 1 | A | 0 | 0 | 0 | 0 | 0 | 2 | ok | 3 | 3 | [{"detector": "framework_specific", "framework": "ScikitLearn", "name": "Verbose Mode Checker", "fix": "Enable verbose mode for long training processes.", "benefits": "Provides better insights into model training progress.", "location": "Line 11"}, {"detector": "framework_specific", "framework": "ScikitLearn", "name": ... | A | no applicable ML-specific findings | [] | ["Exception Handling Checker", "Unit Testing Checker", "Verbose Mode Checker"] | 10 | A |
4,649 | lgb.fit(X_train,y_train) | No | 5 | 7 | Model_Train | train_model | 9,485,463 | 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"] | 10 | B |
4,650 | lgb_yhat = lgb.predict(X_val)
s_lgb = rmsle_score(lgb_yhat,y_val)
s_lgb | Yes | 4 | 27 | Model_Train | predict_on_train | 9,485,463 | 1 | A | 0 | 0 | 0 | 1 | 0 | 3 | 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"] | 10 | A |
4,651 | pred_lgb = lgb.predict(new_test) | No | 5 | 48 | Model_Evaluation | predict_on_test | 9,485,463 | 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"] | 10 | A |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.