这听起来可能很简单,但我有这个问题。
我有两个docker容器在运行。一个是我的front-end,另一个是我的backend服务。
这些是Dockerfile两个服务的s。
前端 Dockerfile:
# Use an official node runtime as a parent image
FROM node:8
WORKDIR /app
# Install dependencies
COPY package.json /app
RUN npm install --silent
# Add rest of the client code
COPY . /app
EXPOSE 3000
CMD npm start
Run Code Online (Sandbox Code Playgroud)
后端 Dockerfile:
FROM python:3.7.7
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY server.py /usr/src/app
COPY . /usr/src/app
EXPOSE 8083
# CMD ["python3", …Run Code Online (Sandbox Code Playgroud) 我有一个Gaussian naive bayes针对数据集运行的算法。我需要的是获得目标类的特征重要性(特征的影响力)。
这是我的代码:
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(inputs, target, test_size=0.2)
gaussian_nb = GaussianNB()
Run Code Online (Sandbox Code Playgroud)
gaussian_nb.fit(X_train, y_train)
Run Code Online (Sandbox Code Playgroud)
gaussian_nb.score(X_test, y_test)*100
Run Code Online (Sandbox Code Playgroud)
我尝试过:
importance = gaussian_nb.coefs_ # and even tried coef_
Run Code Online (Sandbox Code Playgroud)
它给出了一个错误:
AttributeError:“GaussianNB”对象没有属性“coefs_”
有人可以帮帮我吗?