Ekjaer commited on
Commit
92e909a
·
1 Parent(s): 0bf8457

pushing files to the repo from the example!

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. init_repo_MLstructureMining.py +12 -12
README.md CHANGED
@@ -185,7 +185,7 @@ The model is trained with below hyperparameters.
185
 
186
  The model plot is below.
187
 
188
- <style>#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 {color: black;background-color: white;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 pre{padding: 0;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-toggleable {background-color: white;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-estimator:hover {background-color: #d4ebff;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-item {z-index: 1;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel-item {display: flex;flex-direction: column;position: relative;background-color: white;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-parallel-item:only-child::after {width: 0;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;position: relative;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-label label {font-family: monospace;font-weight: bold;background-color: white;display: inline-block;line-height: 1.2em;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-label-container {position: relative;z-index: 2;text-align: center;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-800ead0c-95d2-4adb-adfc-71adae7c28c0 div.sk-text-repr-fallback {display: none;}</style><div id="sk-800ead0c-95d2-4adb-adfc-71adae7c28c0" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>XGBClassifier(base_score=0.5, booster=&#x27;gbtree&#x27;, colsample_bylevel=1,colsample_bynode=1, colsample_bytree=1, enable_categorical=False,gamma=0, gpu_id=-1, importance_type=None,interaction_constraints=&#x27;&#x27;, learning_rate=0.300000012,max_delta_step=0, max_depth=6, min_child_weight=1, missing=nan,monotone_constraints=&#x27;()&#x27;, n_estimators=100, n_jobs=8,num_parallel_tree=1, predictor=&#x27;auto&#x27;, random_state=0,reg_alpha=0, reg_lambda=1, scale_pos_weight=None, subsample=1,tree_method=&#x27;auto&#x27;, validate_parameters=1, verbosity=None)</pre><b>Please rerun this cell to show the HTML repr or trust the notebook.</b></div><div class="sk-container" hidden><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="b4173fad-9393-4606-92e6-246559a01a45" type="checkbox" checked><label for="b4173fad-9393-4606-92e6-246559a01a45" class="sk-toggleable__label sk-toggleable__label-arrow">XGBClassifier</label><div class="sk-toggleable__content"><pre>XGBClassifier(base_score=0.5, booster=&#x27;gbtree&#x27;, colsample_bylevel=1,colsample_bynode=1, colsample_bytree=1, enable_categorical=False,gamma=0, gpu_id=-1, importance_type=None,interaction_constraints=&#x27;&#x27;, learning_rate=0.300000012,max_delta_step=0, max_depth=6, min_child_weight=1, missing=nan,monotone_constraints=&#x27;()&#x27;, n_estimators=100, n_jobs=8,num_parallel_tree=1, predictor=&#x27;auto&#x27;, random_state=0,reg_alpha=0, reg_lambda=1, scale_pos_weight=None, subsample=1,tree_method=&#x27;auto&#x27;, validate_parameters=1, verbosity=None)</pre></div></div></div></div></div>
189
 
190
  ## Evaluation Results
191
 
 
185
 
186
  The model plot is below.
187
 
188
+ <style>#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 {color: black;background-color: white;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 pre{padding: 0;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-toggleable {background-color: white;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-estimator:hover {background-color: #d4ebff;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-item {z-index: 1;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel-item {display: flex;flex-direction: column;position: relative;background-color: white;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-parallel-item:only-child::after {width: 0;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;position: relative;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-label label {font-family: monospace;font-weight: bold;background-color: white;display: inline-block;line-height: 1.2em;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-label-container {position: relative;z-index: 2;text-align: center;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-c0be133d-c30b-49f5-a2b3-96bdba68e768 div.sk-text-repr-fallback {display: none;}</style><div id="sk-c0be133d-c30b-49f5-a2b3-96bdba68e768" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>XGBClassifier(base_score=0.5, booster=&#x27;gbtree&#x27;, colsample_bylevel=1,colsample_bynode=1, colsample_bytree=1, enable_categorical=False,gamma=0, gpu_id=-1, importance_type=None,interaction_constraints=&#x27;&#x27;, learning_rate=0.300000012,max_delta_step=0, max_depth=6, min_child_weight=1, missing=nan,monotone_constraints=&#x27;()&#x27;, n_estimators=100, n_jobs=8,num_parallel_tree=1, predictor=&#x27;auto&#x27;, random_state=0,reg_alpha=0, reg_lambda=1, scale_pos_weight=None, subsample=1,tree_method=&#x27;auto&#x27;, validate_parameters=1, verbosity=None)</pre><b>Please rerun this cell to show the HTML repr or trust the notebook.</b></div><div class="sk-container" hidden><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="a8a3e199-8311-41f7-b297-2437550e529a" type="checkbox" checked><label for="a8a3e199-8311-41f7-b297-2437550e529a" class="sk-toggleable__label sk-toggleable__label-arrow">XGBClassifier</label><div class="sk-toggleable__content"><pre>XGBClassifier(base_score=0.5, booster=&#x27;gbtree&#x27;, colsample_bylevel=1,colsample_bynode=1, colsample_bytree=1, enable_categorical=False,gamma=0, gpu_id=-1, importance_type=None,interaction_constraints=&#x27;&#x27;, learning_rate=0.300000012,max_delta_step=0, max_depth=6, min_child_weight=1, missing=nan,monotone_constraints=&#x27;()&#x27;, n_estimators=100, n_jobs=8,num_parallel_tree=1, predictor=&#x27;auto&#x27;, random_state=0,reg_alpha=0, reg_lambda=1, scale_pos_weight=None, subsample=1,tree_method=&#x27;auto&#x27;, validate_parameters=1, verbosity=None)</pre></div></div></div></div></div>
189
 
190
  ## Evaluation Results
191
 
init_repo_MLstructureMining.py CHANGED
@@ -32,18 +32,18 @@ param_grid = {
32
  "max_depth": [2, 5, 10],
33
  }
34
 
35
- model = HalvingGridSearchCV(
36
- estimator=HistGradientBoostingClassifier(),
37
- param_grid=param_grid,
38
- random_state=42,
39
- n_jobs=-1,
40
- ).fit(X_train, y_train)
41
- model.score(X_test, y_test)# The file name is not significant, here we choose to save it with a `pkl`
42
- # extension.
43
-
44
- _, pkl_name = mkstemp(prefix="skops-", suffix=".pkl")
45
- with open(pkl_name, mode="bw") as f:
46
- pickle.dump(model, file=f)
47
 
48
  booster = xgboost.Booster({'nthread': 8})
49
  booster.load_model("xgb_model_bayse_optimization_00000.bin")
 
32
  "max_depth": [2, 5, 10],
33
  }
34
 
35
+ # model = HalvingGridSearchCV(
36
+ # estimator=HistGradientBoostingClassifier(),
37
+ # param_grid=param_grid,
38
+ # random_state=42,
39
+ # n_jobs=-1,
40
+ # ).fit(X_train, y_train)
41
+ # model.score(X_test, y_test)# The file name is not significant, here we choose to save it with a `pkl`
42
+ # # extension.
43
+
44
+ # _, pkl_name = mkstemp(prefix="skops-", suffix=".pkl")
45
+ # with open(pkl_name, mode="bw") as f:
46
+ # pickle.dump(model, file=f)
47
 
48
  booster = xgboost.Booster({'nthread': 8})
49
  booster.load_model("xgb_model_bayse_optimization_00000.bin")