<jupyter_start><jupyter_text>PREDICTIONG / SUBMISSION  LOAD MODEL AND WEIGHTS<jupyter_code># serialize model to JSON
from keras.models import model_from_json
# load json and create model
json_file = open('caavo-1.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
model_final = model_from_json(loaded_model_json)
# load weights into new model
model_final.load_weights("caavo-1.h5")
print("Loaded model from disk")


pred=model_final.predict(test_img, batch_size=128,verbose=1)
i=5200
print(np.argmax(pred[i]))
plt.pyplot.imshow(test_img[i])

p=[]
for i in range(test_img.shape[0]):
    p.append(np.argmax(pred[i]))
len(p)
sub=pd.read_csv('sample_submissioin.csv')
sub.head()
sub1=pd.DataFrame()
sub1['image_name']=img_test
sub1['image_name']=sub1['image_name'].apply(lambda x : x.split("/")[1])
sub1.head()
sub1['category']=p
sub1.to_csv('sub1.csv',index=False)
sub1.head()
sub1.category.value_counts()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15822784810126583, 'fraction_numerical': 0.024261603375527425, 'mean_word_length': 8.038095238095238, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '32487', 'license': 'MIT', 'n_tokens_mistral': 388, 'n_tokens_neox': 380, 'n_words': 61, 'path': 'caavo.ipynb', 'repo_name': 'rajat-1994/HackerEarth-caavo', 'size': '948'}