You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
@@ -194,6 +195,30 @@ The code below is an example of this process:
194
195
print("Best Eval")
195
196
print(best_eval)
196
197
```
198
+
###Importing and Exporting Optimizer State
199
+
200
+
Some optimizer information can be exported or imported. This varies based on each optimizer.
201
+
202
+
Optimizer state can be exported at any step. When importing an optimizer state, the optimizer should be initialized first, and then the state information can be imported via a Python pickle file. Other methods can be used if custom code is written to handle preprocessing.
203
+
204
+
205
+
Returning data from optimizer and saving to a .pkl file:
206
+
```python
207
+
data= demo_optimizer.export_swarm()
208
+
data_df= pd.DataFrame(data)
209
+
print(data_df)
210
+
data_df.to_pickle('output_data_df.pkl')
211
+
212
+
```
213
+
214
+
215
+
Importing data from a .pkl file and importing it into the optimizer:
216
+
```python
217
+
data_df= pd.read_pickle('output_data_df.pkl')
218
+
demo_optimizer.import_swarm(data_df)
219
+
220
+
```
221
+
197
222
198
223
###Constraint Handling
199
224
Users must create their own constraint function for their problems, if there are constraints beyond the problem bounds. This is then passed into the constructor. If the default constraint function is used, it always returns true (which means there are no constraints).