Writing an algorithm to complete a checklist, where to start? [closed] - algorithm

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm completing a dissertation in health economics and would like to explore the possibility of using an algorithm to answer a checklist that I manually filled in during my research.
The checklist is a 24-item checklist which asks questions such as "Was a discount rate reported?". Now, the articles I've been reviewing tend to be very codified. That is, there are only a few ways that they report an answer (e.g. "we discounted at 3% in this evaluation").
Theoretically, I think it would be possible to write a program that could search text and fill out the majority of these checklist items. However, I have very little experience in programming. As far as I can see, a program like this would involve writing an algorithm of sorts, but that is where my knowledge ends.
Particularly, I would like to know
- Is this possible?
- If so, how would I go about exploring this further? Ideally, I'd like to get to a point where I could play around with writing an algorithm to look through my database.

This could definitely be done with simple logic and parsing, but the key to it would be that the manual entries are consistent in the way that they are "codified".
For example, you'd parse your line for a specific token (or validation word).
In your case above you could parse word for word the string: "we discounted at 3% in this evaluation"
Code wise we could implement a basic logical comparison to each word parsed in the string.
if(currentWord is equal to "discounted")
create a checkmark.

Related

How to improve coding skills? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I can't say I'm weak in programming but I can't come up with the logic faster. I can analyse others code and get to know the logic. But I can't do it on my own. How can I improve my programming skills?
Quite a broad question but from my own, 30yr experience I can tell you there is no way around starting to
analyze existing code,
modify some things (play with it until it feels like it's your own code)
see what the changes do
develop your own ideas on how to do things faster/better/more beautiful
implement your ideas
see if it works
go on to more complex tasks
read books (very important, because many things can't just be discovered by trial'n'error)
be very passionate and determined about what you want to become reality
if you want to learn faster, then write more code
One very important item. You should have fun with what you do is always the best guarantee for success
If you fail at these items then I'm afraid you will never succeed with programming. But then maybe it's like any other field of knowledge.
I experience the same difficulties during my learning journey, too. When I complete challenge tasks I create more complex tasks for myself to see what I can do. It takes me to the next levels of solving problems.
Practice, Practice, Practice!

Split text files into two groups - unsupervised learning [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Imagine, you are a librarian and during time you
have classified a bunch of text files (approx 100)
with a general ambiguous keyword.
Every text file is actually a topic of keyword_meaning1
or a topic of keyword_meaning2.
Which unsupervised learning approach would you use,
to split the text files into two groups?
What precision (in percentage) of correct classification
can be achieved according to a number of text files?
Or can be somehow indicated in one group, that there is
a need of a librarian to check certain files, because
they may be classifed incorrectly?
The easiest starting point would be to use a naive Bayes classifier. It's hard to speculate about the expected precision. You have to test it yourself. Just get a program for e-mail spam detection and try it out. For example, SpamBayes (http://spambayes.sourceforge.net/) is a quite good starting point and easily hackable. SpamBayes has a nice feature that it will label messages as "unsure" when there is no clear separation between two classes.
Edit: When you really want unsupervised clustering method, then perhaps something like Carrot2 (http://project.carrot2.org/) is more appropriate.

Algorithm for finding similar words [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
In order to support users learning English, I want to make a multiple-choice quiz using the vocabulary that the user is studying.
For example, if the user is learning "angel" then I need an algorithm to produce some similar words such as "angle" and "angled"
Another example, if the user is learning "accountant" then I need an algorithm to produce some similar words such as "accounttant" and "acountant", "acounttant"
You could compute the Levenshtein Distance from the starting word to each word in your vocabulary and pick the 2 or 3 shortest ones.
Depending on how many words are in your dictionary this might take a long time though, so I would recommend bailing out after a certain (small) number of steps - i.e. if you have made 3 mutations and still haven't arrived at your target word then stop and move on to the next one.

Style of writing conditional operators [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is considered more appropriate style of writing conditional operators?
if(1){
puts("Hello")
}
or
if(1) puts("Hello")
Similar aspects of coding style are welcome too.
That's all depends on your preference, that's why we rarely see people code in the same style.. Moreover, it depends on which programming language you're using.. IMHO, the important thing in coding is code readability and comments, so when your BOSS asks other people to help or develop your code. He /she will spend the least amount of their time to understand your code..
If you ask specifically from your example above, I would prefer the first one.. Because in my OPINION, imagining the WHOLE code, that one will give better readability. HOWEVER, some people may argue that it will spend some of your time typing those brackets over and over..
As per the PSR standards any structure must always enclose the code in parentheses.
The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body.
from the official website
Please have a look under control structures section http://www.php-fig.org/psr/psr-2/

Algorithm vs Code [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I came across the declaration in a software best practices guide that algorithm and code shouldn't get mixed up. I'm not sure what is meant by this? As far as I understand, code is the implementation of the algorithm, isn't is? So, what exactly is meant by this statement? and why it is considered as a good practice?
Thank You!
The context in which the author mentioned would be clearer if you had pasted the surrounding lines.
Though what it would mean to me is, an algorithm is just a clear step-by-step logic that you would use to implement. You would leave out the finer implementation details like selection of the right data structure and other implementation details while you write/design the algorithm.
A good explanation can be found here
An algorithm is a series of steps for solving a problem, completing a task or performing a calculation. Algorithms are usually executed by computer programs but the term can also apply to steps in domains such as mathematics for human problem solving.
Code is a series of steps that machines can execute. In many cases, code is composed in a high level language that is then automatically translated into instructions that machines understand.

Resources