1234567891011121314151617181920212223242526272829303132 |
- defmodule Train do
- def data do
- opts = [
- model: :multinomial,
- storage: :file_system,
- file_path: "lib/medicine_dataset.txt"
- ]
- SimpleBayes.init(opts)
- |> SimpleBayes.train(:zebutal, "tension headaches")
- |> SimpleBayes.train(:dvita, "vitamin that helps your body absorb calcium and phosphorus")
- |> SimpleBayes.train(:tyneol, "treat mild to moderate pain from headaches, menstrual periods, toothaches, backaches, osteoarthritis, or cold, flu aches and pains and to reduce fever",weight: 0.6)
- |> SimpleBayes.train(:duraflu, "is used to temporarily treat cough, chest congestion, fever, body aches, and stuffy nose symptoms caused by the common cold, flu, or other breathing illnesses")
- |> SimpleBayes.train(:duraflu, "side effects: Dizziness, drowsiness, headache, nausea, nervousness, or trouble sleeping may occur")
- |> SimpleBayes.train(:aspirin, "reduce fever and relieve mild to moderate pain from conditions such as muscle aches, toothaches, common cold, and headache")
- |> SimpleBayes.train(:pamelor, "treat mental/mood problems such as depression")
- |> SimpleBayes.train(:diphenhist, "it is an antihistamine used to relieve symptoms of allergy, hay fever, and the common cold")
- |> SimpleBayes.train(:aleve, "headache, muscle aches, dental pain, menstrual cramps, or arthritis")
- |> SimpleBayes.train(:nuvigil, "narcolepsy and other sleep disorders, such as periods of stopped breathing during sleep (obstructive sleep apnea)")
- |> SimpleBayes.train(:indomethacin,"used to relieve pain, swelling, and joint stiffness caused by arthritis, gout, bursitis, and tendonitis")
- |> SimpleBayes.train(:ceftin, "Cefuroxime is used to treat a wide variety of bacterial infections")
- |> SimpleBayes.train(:norel, "common cold, flu, allergies, or other breathing illnesses (such as sinusitis, bronchitis)",weight: 0.6)
- |> SimpleBayes.train(:sinutab, "common cold, flu, allergies, or other breathing illnesses (such as sinusitis, bronchitis)",weight: 0.4)
- |> SimpleBayes.train(:benadryl, "allergy, hay fever, and the common cold. These symptoms include rash, itching, watery eyes, itchy eyes/nose/throat, cough, runny nose, and sneezing",weight: 0.6)
- |> SimpleBayes.train(:ibuprofen, "headache, dental pain, menstrual cramps, muscle aches, or arthritis")
- |> SimpleBayes.train(:zanamivir, "flu virus (influenza) it helps lessen symptoms (such as stuffy nose, cough, sore throat, fever/chills, headache, body aches, tiredness")
- |> SimpleBayes.train(:goto_doctor,"still",weight: 2)
- |> SimpleBayes.save()
- end
- end
|