Skip to content

Instantly share code, notes, and snippets.

@anabastos
Last active November 11, 2020 17:46
Show Gist options
  • Save anabastos/d9e360aa3fa394813d86c6458beaed21 to your computer and use it in GitHub Desktop.
Save anabastos/d9e360aa3fa394813d86c6458beaed21 to your computer and use it in GitHub Desktop.
IA

PCA

principal component analysis (PCA). PCA is fundamentally a dimensionality reduction algorithm, but it can also be useful as a tool for visualiza‐ tion, for noise filtering, for feature extraction and engineering, and much more

  • O que é inteligência artificial?
  • Diferença de busca em largura e busca em profundidade Busca em profundidade é recursiva com iteraçoes de profundidades do grafos aumentando a profundidade da busca na arvore binari enquanto a em largura em cada estagio, o vertice é expandido proximo a indicação de marcação.

Largura

  • Loop
  • Pop o node mais pra cima
  • p/ cada açao ligada ao vertice pega os filhos

Expande a fronteira entre vértices descobertos e não descobertos uniformemente através da largura da fronteira. O algoritmo descobre todos os vértices a uma distância k do vértice origem antes de descobrir qualquer vértice a uma distância k + 1

Profundidade

  • Loop

As arestas são exploradas a partir do vértice v mais recentemente descoberto que ainda possui arestas não exploradas saindo dele.

Quando todas as arestas adjacentes a v tiverem sido exploradas a busca anda para trás para explorar vértices que saem do vértice do qual v foi descoberto (backtraking)

O que é aprendizagem de máquina?

  • Descreva 3 exemplos de áreas nas quais o uso de aprendizagem de máquina tem sido realizado.

  • Quais são as principais bibliotecas da linguagem Python usadas na arendizagem de máquina e qual é a finalidade de cada uma delas? Python SciPy Anaconda : Visualização e exploracao scikit-learn (http://scikit-learn.org): Numpy / Scipy / Cython implementations for major algorithms PyBrain: Redes neurais

  • A biblioteca NumPy apresenta uma forma alternativa de representação de vetores distinta da representação de list da Python. Qual é o motivo da criação dessa forma alternativa de represen-tação de vetores?

  • O que é um problema de classificação?

  • O que é um problema de agrupamento?

Grafos

Uma inteligência artificial pode ser representada com grafos sendo os nós dos grafos são estados e as arestas do grafo são como ações e a representação de caminhos no grafo é como uma sequência de estados conectados por uma sequência de estados. Esse estrutura funciona em algoritmos de busca pois a estrutura de dado necessária que constroi o algoritmo de busca contem 4 componentes: • n.STATE: the state in the state space to which the node corresponds; • n.PARENT: the node in the search tree that generated this node; • n.ACTION: the action that was applied to the parent to generate the node; • n.PATH-COST: the cost, traditionally denoted by g(n), of the path from the initial state to the node, as indicated by the parent pointers.

Dessa forma diversos algoritmos de busca em grafo em que se controi uma arvore de busca m contains at most one copy of each state, so we can think of it as growing a tree directly on the state-space graph, The algorithm has another nice property: the frontier separates the state-space graph into the explored region and the unexplored region, so that every path from the initial state to an unexplored state has to pass through a state in the frontier “”A sequence of search trees generated by a graph search on the Romania problem of Figure 3.2. At each stage, we have extended each path by one step””

Given the components for a parent node, it is easy to see how to compute the necessary components for a child node. The function CHILD-NODE takes a parent node and an action and returns the resulting child node: In theoretical computer science, the typical measure is the size of the state space graph, |V | + |E|, where V is the set of vertices (nodes) of the graph and E is the set of edges (links). This is appropriate when the graph is an explicit data structure that is input to the search program. (The map of Romania is an example of this.) In AI, the graph is often represented implicitly by the initial state, actions, and transition model and is frequently infi- nite. For these reasons, complexity is expressed in terms of three quantities: b, the branching BRANCHING FACTOR factor or maximum number of successors of any node; d, the depth of the shallowest goal DEPTH node (i.e., the number of steps along the path from the root); and m, the maximum length of any path in the state space. Time is often measured in terms of the number of nodes generated during the search, and space in terms of the maximum number of nodes stored in memory. For the most part, we describe time and space complexity for search on a tree; for a graph, the answer depends on how “redundant” the paths in the state space are

(Fazer um resumão embromation)

K-means

Clustering algorithms seek to learn, from the properties of the data, an optimal division or discrete labeling of groups of points

Procura por um numero predeterminado de clusters. Nele o centro é a media aritmentica de todos os pontos pertencentes a ele. Cada ponto esta proximo do seu proprio centro.

O k-means usa do expectativa-maximização(E-M), que  um algoritmo poderoso que pode ser utilizado em diversos contextos. Consistindo no seguinte procedimento: 1- Selecione alguns k centros 2- Repita ate convergido: - E-Step: Associe os pontos ao centro do grupo mais proximo   - M-Step: Atualize o centro do grupo como ponto médio dos meus membros.

there is no assurance that it will lead to the global best solution. For exam‐ ple, if we use a different random seed in our simple procedure, the particular starting guesses lead to poor results

the algorithm will often be ineffec‐ tive if the clusters have complicated geometries. the boundaries between k-means clusters will always be linear. To fix it It uses the graph of nearest neighbors to com‐ pute a higher-dimensional representation of the data, and then assigns labels using a k-means algorithm

k-means can be slow for large numbers of samples

Here the “E-step” or “Expectation step” is so named because it involves updating our expectation of which cluster each point belongs to. The “M-step” or “Maximization step” is so named because it involves maximizing some fitness function that defines the location of the cluster centers—in this case, that maximization is accomplished by taking a simple mean of the data in each cluster.

The literature about this algorithm is vast, but can be summarized as follows: under typical circumstances, each repetition of the E-step and M-step will always result in a better estimate of the cluster characteristics.

There are a few issues to be aware of when using the expectation–maximization algorithm. The number of clusters must be selected beforehand Uma escolha de numero de clusters errada pode provocar o comportamento da imagem. Another common challenge with k-means is that you must tell it how many clus‐ ters you expect: it cannot learn the number of clusters from the data. For exam‐ ple, if we ask the algorithm to identify six clusters, it will happily proceed and find the best six clusters.

Whether the result is meaningful is a question that is difficult to answer defini‐ tively; one approach that is rather intuitive, but that we won’t discuss further here, is called silhouette analysis. Alternatively, you might use a more complicated clustering algorithm which has a better quantitative measure of the fitness per number of clusters (e.g., Gaussian mixture models; see “In Depth: Gaussian Mixture Models” on page 476) or which can choose a suitable number of clusters (e.g., DBSCAN, mean-shift, or affinity propagation, all available in the sklearn.cluster submodule).

A*

Ele evalua nós combinando g(n), o custo para chegar no nó, e h(n), o custo pra chegar do nó até o objetivo. f(n) = g(n) + h(n).

Já que g(n) dá o custo do caminho do nó inicial até o nó n, e h(n) é o custo estimado do caminho mais barato de n até o objetivo, nós temos f(n) = custo estimado da solução mais barata de n. Se estamos tentando achar a soluço mais barata, tentamos o node com o menor valor de g(n) + h(n)

Introdução à Aprendizagem de Máquina

3 Tipos de Aprendizagem:

  • supervisionada
  • não supervisionada
  • por reforço Tarefas de Aprendizagem de máquina:
  • classificação
  • regressão
  • agrupamento
  • redução de dimensionalidade
  • previsão de séries temporais
  • reduçao de dimensionalidade

Classificaçao Objetivo: Prever "Rotulo" de novas instancias usando como base observações passadas. Exemplos: Filtro de Spam(classificacao binaria), Identificaçao de Letras(problema de multiclassificacao)

Regressao Numa analise de regresso, recebemos uma quantidade de variaveis e, para cada uma um valor referente a um resoltado sobre ela com o objetivo de tentar descobrir qual relaionamento existe entre a variavel e o resultado p/ ela Exemplo: Nota prevista com base no tempo dedicado de estudo, treino do sistema com pares(tempo de estudo, nota)

Agrupamento(clustering) Tecnica usada p/ organizar um conjunto de dados que compartilham de dados em subgrupos. Cria um grupo de dados que compartilham de certa similiariadade e que sao de certa forma, distintos dos dados pertencentes a outros grupos. Exemplos: Classificaçã

  • não supervisionadao de clientes com base nos seus interesses para direcionar estrategias de marketing

Previsao de series temporarais Previsao de valores futuros de um dado usando os valores que ele assumiu durante a passagem do tempo.

Redução de dimensionalidade As vezes o dado utilizado incorpora uma quantidade grande de valores e isso pode comprometer sua utilizacao pratica. O objetivo de redução de dimensionalidade é preprocessar os dados removendo algumas "dimensões" e ao mesmo tempo mantendo suas caracteristicas recentes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment