![AboutMe.gif](https://gist.github.com/bharatc9530/c001c25b19082061d5c6e04a97b3c0ff/raw/8ecf0ac85e848f526dd1776d087db9dc7aaaedc5/AboutMe.gif)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import pickle | |
df = pd.read_csv('iris.data') | |
X = np.array(df.iloc[:, 0:4]) | |
y = np.array(df.iloc[:, 4:]) | |
from sklearn.preprocessing import LabelEncoder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request | |
import pickle | |
import numpy as np | |
app = Flask(__name__) | |
model = pickle.load(open('iri.pkl', 'rb')) | |
@app.route('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body bgcolor=#d4a3ae> | |
<center> | |
<h1> IRIS FLOWER DETECTION </h1><br> | |
<form method="POST", action="{{url_for('home')}}"> | |
<b> First value : <input type="text", name='a', placeholder="enter 1"> <br><br> | |
Second value : <input type="text", name='b', placeholder="enter 2"> <br><br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body bgcolor=#9d3bc4> | |
<center> | |
<h1> PREDICTION : </h1> | |
{%if data == 0%} | |
<h1>Iris-setosa</h1> |
![hemorrhage.png](https://gist.github.com/bharatc9530/3d73e5066f0f7bbe787ad67a631afe80/raw/ca5d9cb2775f09b5bc7f2c6dcab248233c11c0b4/hemorrhage.png)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from numpy import array | |
from keras.preprocessing.text import one_hot, Tokenizer | |
from keras.preprocessing.sequence import pad_sequences | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from keras.layers import Flatten | |
from keras.layers.embeddings import Embedding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df = pd.read_csv('Review.csv').sample(frac=1).reset_index(drop=True) | |
df['sentiment'] = df['sentiment'].astype('category',inplace = True).cat.codes | |
df.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docs = df['review'] | |
labels = array(df['sentiment']) | |
from sklearn.model_selection import train_test_split | |
X_train, X_test , y_train, y_test = train_test_split(docs, labels , test_size = 0.40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = Tokenizer() | |
t.fit_on_texts(docs) | |
vocab_size = len(t.word_index) + 1 | |
# integer encode the documents | |
print(vocab_size) | |
X_train = [one_hot(d, vocab_size,filters='!"#$%&()*+,-./:;<=>?@[\]^_`{|}~',lower=True, split=' ') for d in X_train] | |
X_test = [one_hot(d, vocab_size,filters='!"#$%&()*+,-./:;<=>?@[\]^_`{|}~',lower=True, split=' ') for d in X_test] |
OlderNewer