So I'm trying to run this docker container
FROM ubuntu:latest
RUN apt update
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt install python3-pip -y
RUN apt-get remove swig
RUN apt-get install swig3.0
RUN ln -s /usr/bin/swig3.0 /usr/bin/swig
RUN pip3 install auto-sklearn
# During debugging, this entry point will be overridden. For more information, please refer to
https://aka.ms/vscode-docker-python-debug
/>
ADD . /test.py
WORKDIR /
CMD ["python3", "test.py"]
and I get the error "/usr/bin/python3: can't find 'main' module in 'test.py'" from Docker Desktop. There are other posts similar to this on Stack Overflow, but I made the appropriate changes and it still doesn't seem to work. My Python code is quite simple
import pandas as pd
import autosklearn.classification as classification
import sklearn.model_selection as model_selection
if __name__ == "__main__":
def split_train_val(self, X: pd.DataFrame, y: pd.DataFrame):
X_train, X_val, y_train, y_val = model_selection.train_test_split(
X, y, test_size=0.25)
return X_train, X_val, y_train.to_frame(), y_val.to_frame()
model = classification.AutoSklearnClassifier(
time_left_for_this_task=3600,
ensemble_size=1,
ensemble_nbest=1,
)
dataset = pd.read_csv('data.csv')
dataset = dataset.iloc[:100]
X, y = dataset.drop(columns=[target_col]), dataset[target_col]
self.model.fit(X, y)
print(self.model.cv_results_)
Running Python code in Docker gives: "/usr/bin/python3: can't find '__main__' module in 'test.py'"
Programing Coderfunda
March 05, 2024
No comments
Related Posts:
ACID Properties in DBMS ACID Properties in DBMSDBMS is the management of data that should remain integrated when any changes are done in it. It is because if the integr… Read More
ER Design Issues ER Design IssuesIn the previous sections of the data modeling, we learned to design an ER diagram. We also discussed different ways of defining … Read More
Mapping Constraints Mapping ConstraintsA mapping constraint is a data constraint that expresses the number of entities to which another entity can be related via a … Read More
DBMS Notation of ER diagram Notation of ER diagramDatabase can be represented using the notations. In ER diagram, many notations are used to express the cardinality. These … Read More
DBMS ER Model ConceptER modelER model stands for an Entity-Relationship model. It is a high-level data model. This model is used to define the data elements and relationsh… Read More
0 comments:
Post a Comment
Thanks