1
Hello, I made a neural net watching a video class on, the code is very simple but functional. And open a csv file, sort the data and do the training, right after the test is done and the result is shown. Great, is there no way to take it already trained and execute it?? Because the way it is always going to be done the training.
import pandas as pd
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.ensemble import ExtraTreesClassifier
arquivo = pd.read_csv("/Users/marlorodrigues/wine_dataset.csv")
arquivo.head()
arquivo['style'] = arquivo['style'].replace('red', 0)
arquivo['style'] = arquivo['style'].replace('white', 1)
y = arquivo['style']
x = arquivo.drop('style', axis = 1)
x_treino, x_teste, y_treino, y_teste = train_test_split(x, y, test_size = 0.3)
modelo = ExtraTreesClassifier()
modelo.fit(x_treino, y_treino)
resultado = modelo.score(x_teste, y_teste)
# print("Acuracia da Rede Neural #1 --->> ", resultado)
print(y_teste[334:339])`
previsoes = modelo.predict(x_teste[334:339])
print(previsoes)
I admired the patience of putting the ` in each line of your code.
– CypherPotato
At the beginning of the question it says: "I made a neural network", in addition to the tag "neural networks" and the title, but in the code there is a model
ExtraTreesClassifier
. The question is how to save a Neural Network or sklearn model?– AlexCiuffa
@Alexciuffa - the Extratreesclassifier model is not considered a way to make a neural network??
– Colono Pooper
@Cypherpotato kkkkkkkkkkkk tried to copy the whole code, but it did not give, so I went line by line
– Colono Pooper
@Colonopooper, no! Extratreesclassifier is an algorithm based on a set of decision trees. It can be used for selection of Features (inputs). The selected Features can be used for another model, such as a neural network, but are different models.
– AlexCiuffa