[Question] How do I fix this issue?

Author: jordannelson0Created Dec 28, 2023Updated May 7, 2026

Here is my code:

from pandas import read_csv
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from autosklearn.classification import AutoSklearnClassifier

dataframe = read_csv("Spy.csv", skiprows=0)
dataset = dataframe.values
x = dataset[:, 0:9503]
y = dataset[:, 9503]
print(dataset)

# Split the dataset into training and testing sets
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2)

# define search
model = AutoSklearnClassifier(ensemble_kwargs={'ensemble_size': 1},
							  initial_configurations_via_metalearning=0,
							  memory_limit=2000,
							  time_left_for_this_task=10 * 60,
							  per_run_time_limit=60,
							  n_jobs=24)
# perform the search
model.fit(x_train, y_train)

# summarize
print(model.sprint_statistics())
# evaluate best model
y_hat = model.predict(x_test)
acc = accuracy_score(y_test, y_hat)
print("Accuracy: %.3f" % acc)

Here is the warning I'm receiving:

RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jordan/Documents/Brighton_University/venv/lib/python3.10/site-packages/autosklearn/automl.py", line 961, in fit
    self._logger.exception(e)
AttributeError: 'NoneType' object has no attribute 'exception'

During handling of the above exception, another exception occurred:

Followed by:

File "/home/jordan/Documents/Brighton_University/auto_scikit.py", line 23, in <module>
    model.fit(x_train, y_train)
AttributeError: 'NoneType' object has no attribute 'info'

I have no idea how to fix this, I have been looking for hours and trying different things - even changing datasets and nothings worked. Can anyone help with code snippets preferably?

Expected behaviour

For it to run as normal

Environment and installation:

Please give details about your installation:

  • OS: Ubuntu 22.04.3 LTS
  • Pycharm IDE
  • Python version: 3.10.12
  • Auto-sklearn version 0.15.0