<jupyter_start><jupyter_text>Dragon Fly Optimization  Installation<jupyter_code>!pip install zoofs==0.1.24<jupyter_output>Collecting zoofs==0.1.24
  Downloading zoofs-0.1.24.tar.gz (28 kB)
Requirement already satisfied: pandas>=1.3.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from zoofs==0.1.24) (1.3.2)
Requirement already satisfied: numpy in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from zoofs==0.1.24) (1.21.2)
Requirement already satisfied: scipy>=1.4.1 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from zoofs==0.1.24) (1.7.1)
Requirement already satisfied: plotly>=5.6.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from zoofs==0.1.24) (5.6.0)
Requirement already satisfied: colorlog>=6.6.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from zoofs==0.1.24) (6.6.0)
Requirement already satisfied: colorama in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from colorlog>=6.6.0->zoofs==0.1.24) (0.4.4)
Requirement already satisfied: python-d[...]<jupyter_text>Load Breast cancer dataset<jupyter_code>from sklearn.datasets import load_breast_cancer
import pandas as pd
data = load_breast_cancer()
X_train=pd.DataFrame(data['data'],columns=data['feature_names'])
y_train=pd.Series(data['target'])<jupyter_output><empty_output><jupyter_text>Importing Zoofs Algo<jupyter_code>from zoofs import DragonFlyOptimization<jupyter_output><empty_output><jupyter_text>Setting up Objective function and fitting algo<jupyter_code>from sklearn.metrics import log_loss
# define your own objective function, make sure the function receives four parameters,
#  fit your model and return the objective value ! 
def objective_function_topass(model,X_train, y_train, X_valid, y_valid):      
    model.fit(X_train,y_train)  
    P=log_loss(y_valid,model.predict_proba(X_valid))
    return P
    
# create object of algorithm
algo_object=DragonFlyOptimization(objective_function_topass,n_iteration=20,method='linear',
                                    population_size=20,minimize=True)
import lightgbm as lgb
lgb_model = lgb.LGBMClassifier()                                       
# fit the algorithm
algo_object.fit(lgb_model,X_train, y_train, X_train, y_train,verbose=True)
#plot your results<jupyter_output>[32m [ 2022-03-03 01:30:48,867 ] [0mFinished iteration #0 with objective value 0.00042688493007979523. Current best value is 0.00042688493007979523 [0m
[32m [ 2022-03-03 01:30:50,737 ] [0mFinished iteration #1 with objective value 0.0004796281004668964. Current best value is 0.00042688493007979523 [0m
[32m [ 2022-03-03 01:30:52,479 ] [0mFinished iteration #2 with objective value 0.00048376590822600817. Current best value is 0.00042688493007979523 [0m
[32m [ 2022-03-03 01:30:54,171 ] [0mFinished iteration #3 with objective value 0.0004998724444697643. Current best value is 0.00042688493007979523 [0m
[32m [ 2022-03-03 01:30:56,029 ] [0mFinished iteration #4 with objective value 0.0005036852166138854. Current best value is 0.00042688493007979523 [0m
[32m [ 2022-03-03 01:30:57,911 ] [0mFinished iteration #5 with objective value 0.00046699316834635933. Current best value is 0.00042688493007979523 [0m
[32m [ 2022-03-03 01:30:59,430 ] [0mFinished iteration #6 with objectiv[...]<jupyter_text>Plotting the Results<jupyter_code>algo_object.plot_history()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1195745903995401, 'fraction_numerical': 0.14084507042253522, 'mean_word_length': 5.553672316384181, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '388217', 'license': 'Apache-2.0', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1257, 'n_words': 241, 'path': 'docs/Dragon_Fly_optimization_example.ipynb', 'repo_name': 'gitter-badger/zoofs', 'size': '3479'}